From a228eefe6da4ab497c3909faa81b74c146dca420 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Wed, 24 Jan 2007 22:37:52 +0000 Subject: [PATCH] rsaenh: Declare some functions static. --- dlls/rsaenh/des.c | 2 +- dlls/rsaenh/handle.c | 48 ++++++++++++++++++++++---------------------- dlls/rsaenh/handle.h | 2 -- dlls/rsaenh/rsa.c | 4 ++-- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/dlls/rsaenh/des.c b/dlls/rsaenh/des.c index 67b6871ab8c..67931de351b 100644 --- a/dlls/rsaenh/des.c +++ b/dlls/rsaenh/des.c @@ -1282,7 +1282,7 @@ static const ulong64 des_fp[8][256] = { static void cookey(const ulong32 *raw1, ulong32 *keyout); -void deskey(const unsigned char *key, short edf, ulong32 *keyout) +static void deskey(const unsigned char *key, short edf, ulong32 *keyout) { ulong32 i, j, l, m, n, kn[32]; unsigned char pc1m[56], pcr[56]; diff --git a/dlls/rsaenh/handle.c b/dlls/rsaenh/handle.c index d924c2d2581..12386517b79 100644 --- a/dlls/rsaenh/handle.c +++ b/dlls/rsaenh/handle.c @@ -121,6 +121,28 @@ exit: return ret; } +/****************************************************************************** + * release_all_handles + * + * Releases all valid handles in the given handle table and shrinks the table + * to zero size. + * + * PARAMS + * lpTable [I] The table of which all valid handles shall be released. + */ +static void release_all_handles(HANDLETABLE *lpTable) +{ + unsigned int i; + + TRACE("(lpTable=%p)\n", lpTable); + + EnterCriticalSection(&lpTable->mutex); + for (i=0; iiEntries; i++) + if (lpTable->paEntries[i].pObject) + release_handle(lpTable, lpTable->paEntries[i].pObject->dwType, INDEX2HANDLE(i)); + LeaveCriticalSection(&lpTable->mutex); +} + /****************************************************************************** * alloc_handle_table * @@ -235,10 +257,10 @@ static int grow_handle_table(HANDLETABLE *lpTable) * non zero, if successful * zero, if not successful (no free handle) */ -int alloc_handle(HANDLETABLE *lpTable, OBJECTHDR *lpObject, unsigned int *lpHandle) +static int alloc_handle(HANDLETABLE *lpTable, OBJECTHDR *lpObject, unsigned int *lpHandle) { int ret = 0; - + TRACE("(lpTable=%p, lpObject=%p, lpHandle=%p)\n", lpTable, lpObject, lpHandle); EnterCriticalSection(&lpTable->mutex); @@ -313,28 +335,6 @@ exit: return ret; } -/****************************************************************************** - * release_all_handles - * - * Releases all valid handles in the given handle table and shrinks the table - * to zero size. - * - * PARAMS - * lpTable [I] The table of which all valid handles shall be released. - */ -void release_all_handles(HANDLETABLE *lpTable) -{ - unsigned int i; - - TRACE("(lpTable=%p)\n", lpTable); - - EnterCriticalSection(&lpTable->mutex); - for (i=0; iiEntries; i++) - if (lpTable->paEntries[i].pObject) - release_handle(lpTable, lpTable->paEntries[i].pObject->dwType, INDEX2HANDLE(i)); - LeaveCriticalSection(&lpTable->mutex); -} - /****************************************************************************** * lookup_handle * diff --git a/dlls/rsaenh/handle.h b/dlls/rsaenh/handle.h index 6fa96398da4..b9ca6a8a708 100644 --- a/dlls/rsaenh/handle.h +++ b/dlls/rsaenh/handle.h @@ -56,10 +56,8 @@ typedef struct tagHANDLETABLE int alloc_handle_table (HANDLETABLE **lplpTable); void init_handle_table (HANDLETABLE *lpTable); -void release_all_handles (HANDLETABLE *lpTable); int release_handle_table(HANDLETABLE *lpTable); void destroy_handle_table(HANDLETABLE *lpTable); -int alloc_handle (HANDLETABLE *lpTable, OBJECTHDR *lpObject, unsigned int *lpHandle); int release_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType); int copy_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType, unsigned int *copy); int lookup_handle (HANDLETABLE *lpTable, unsigned int handle, DWORD dwType, OBJECTHDR **lplpObject); diff --git a/dlls/rsaenh/rsa.c b/dlls/rsaenh/rsa.c index 00a65e51f06..e6ccddfc781 100644 --- a/dlls/rsaenh/rsa.c +++ b/dlls/rsaenh/rsa.c @@ -39,7 +39,7 @@ static const struct { }; /* convert a MPI error to a LTC error (Possibly the most powerful function ever! Oh wait... no) */ -int mpi_to_ltc_error(int err) +static int mpi_to_ltc_error(int err) { int x; @@ -58,7 +58,7 @@ static int rand_prime_helper(unsigned char *dst, int len, void *dat) return gen_rand_impl(dst, len) ? len : 0; } -int rand_prime(mp_int *N, long len) +static int rand_prime(mp_int *N, long len) { int type;