Browse Source

Merge branch 'miko-avoid-declaration-after-statements' into develop

This closes #101
Steffen Jaeckel 9 years ago
parent
commit
4a3b53dbee
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/prngs/rng_get_bytes.c

+ 3 - 2
src/prngs/rng_get_bytes.c

@@ -21,14 +21,15 @@
 static unsigned long rng_nix(unsigned char *buf, unsigned long len,
 static unsigned long rng_nix(unsigned char *buf, unsigned long len,
                              void (*callback)(void))
                              void (*callback)(void))
 {
 {
-    LTC_UNUSED_PARAM(callback);
 #ifdef LTC_NO_FILE
 #ifdef LTC_NO_FILE
+    LTC_UNUSED_PARAM(callback);
     LTC_UNUSED_PARAM(buf);
     LTC_UNUSED_PARAM(buf);
     LTC_UNUSED_PARAM(len);
     LTC_UNUSED_PARAM(len);
     return 0;
     return 0;
 #else
 #else
     FILE *f;
     FILE *f;
     unsigned long x;
     unsigned long x;
+    LTC_UNUSED_PARAM(callback);
 #ifdef LTC_TRY_URANDOM_FIRST
 #ifdef LTC_TRY_URANDOM_FIRST
     f = fopen("/dev/urandom", "rb");
     f = fopen("/dev/urandom", "rb");
     if (f == NULL)
     if (f == NULL)
@@ -107,8 +108,8 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
 static unsigned long rng_win32(unsigned char *buf, unsigned long len,
 static unsigned long rng_win32(unsigned char *buf, unsigned long len,
                                void (*callback)(void))
                                void (*callback)(void))
 {
 {
-   LTC_UNUSED_PARAM(callback);
    HCRYPTPROV hProv = 0;
    HCRYPTPROV hProv = 0;
+   LTC_UNUSED_PARAM(callback);
    if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
    if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
                             (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) &&
                             (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) &&
        !CryptAcquireContext (&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
        !CryptAcquireContext (&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,