Symbian compilation fixes.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 29 Dec 2006 19:38:11 +0000 (19:38 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 29 Dec 2006 19:38:11 +0000 (19:38 +0000)
lib/silccrypt/silcrng.c
lib/silccrypt/twofish.c

index d32b708b1613dbee7a617df2d0ea86bc7b22b404..9538289bab4944b529fb7eea5daef53aa2854565 100644 (file)
@@ -286,6 +286,7 @@ static void silc_rng_get_soft_noise(SilcRng rng)
   silc_rng_xor(rng, (r.ru_utime.tv_sec ^ r.ru_utime.tv_usec), pos++);
   silc_rng_xor(rng, (r.ru_stime.tv_sec + r.ru_stime.tv_usec), pos++);
   silc_rng_xor(rng, (r.ru_stime.tv_sec ^ r.ru_stime.tv_usec), pos++);
+#ifndef SILC_SYMBIAN
   silc_rng_xor(rng, (r.ru_maxrss + r.ru_ixrss), pos++);
   silc_rng_xor(rng, (r.ru_maxrss ^ r.ru_ixrss), pos++);
   silc_rng_xor(rng, (r.ru_idrss + r.ru_idrss), pos++);
@@ -302,6 +303,7 @@ static void silc_rng_get_soft_noise(SilcRng rng)
   silc_rng_xor(rng, (r.ru_nsignals << 16), pos++);
   silc_rng_xor(rng, (r.ru_nvcsw + r.ru_nivcsw), pos++);
   silc_rng_xor(rng, (r.ru_nvcsw ^ r.ru_nivcsw), pos++);
+#endif /*  SILC_SYMBIAN */
 #endif
   
 #ifdef SILC_RNG_DEBUG
@@ -335,7 +337,7 @@ static void silc_rng_get_medium_noise(SilcRng rng)
 
 static void silc_rng_get_hard_noise(SilcRng rng)
 {
-#ifndef SILC_WIN32
+#if defined(SILC_UNIX)
   unsigned char buf[32];
   int fd, len, i;
 
@@ -367,7 +369,7 @@ static void silc_rng_get_hard_noise(SilcRng rng)
 
 static void silc_rng_exec_command(SilcRng rng, char *command)
 {
-#ifndef SILC_WIN32
+#if defined(SILC_UNIX)
   unsigned char buf[1024];
   FILE *fd;
   int i;
@@ -549,7 +551,7 @@ SilcUInt8 silc_rng_get_byte(SilcRng rng)
 
 SilcUInt8 silc_rng_get_byte_fast(SilcRng rng)
 {
-#ifndef SILC_WIN32
+#if defined(SILC_UNIX)
   unsigned char buf[1];
 
   if (rng->fd_devurandom == -1) {
index c52438125f83fc1cfd7719c5971491fffd7d7933..103c27c113273dc2185831195d08544a8a7e838b 100644 (file)
@@ -173,7 +173,7 @@ u1byte qp(const u4byte n, const u1byte x)
     a3 = a2 ^ b2; b3 = ror4[b2] ^ ashx[a2];
     a4 = qt2[n][a3]; b4 = qt3[n][b3];
     return (b4 << 4) | a4;
-};
+}
 
 #ifdef  Q_TABLES
 
@@ -190,7 +190,7 @@ void gen_qtab(void)
         q(0,i) = qp(0, (u1byte)i);
         q(1,i) = qp(1, (u1byte)i);
     }
-};
+}
 
 #else
 
@@ -216,7 +216,7 @@ void gen_mtab(void)
         m_tab[1][i] = fef + (fef << 8) + (f5b << 16) + (f01 << 24);
         m_tab[3][i] = f5b + (f01 << 8) + (fef << 16) + (f5b << 24);
     }
-};
+}
 
 #define mds(n,x)    m_tab[n][x]
 
@@ -295,7 +295,7 @@ u4byte h_fun(TwofishContext *ctx, const u4byte x, const u4byte key[])
     return b0 | (b3 << 8) | (b2 << 16) | (b1 << 24);
 
 #endif
-};
+}
 
 #ifdef  MK_TABLE
 
@@ -364,7 +364,7 @@ void gen_mk_tab(TwofishContext *ctx, u4byte key[])
 #endif
             }
     }
-};
+}
 
 #  ifdef ONE_STEP
 #    define g0_fun(x) ( mk_tab[0][byte(x,0)] ^ mk_tab[1][byte(x,1)] \
@@ -491,7 +491,7 @@ u4byte *twofish_set_key(TwofishContext *ctx,
 #endif
 
     return l_key;
-};
+}
 
 /* encrypt a block of text  */
 
@@ -522,7 +522,7 @@ void twofish_encrypt(TwofishContext *ctx,
     out_blk[1] = blk[3] ^ l_key[5];
     out_blk[2] = blk[0] ^ l_key[6];
     out_blk[3] = blk[1] ^ l_key[7];
-};
+}
 
 /* decrypt a block of text  */
 
@@ -553,4 +553,4 @@ void twofish_decrypt(TwofishContext *ctx,
     out_blk[1] = blk[3] ^ l_key[1];
     out_blk[2] = blk[0] ^ l_key[2];
     out_blk[3] = blk[1] ^ l_key[3];
-};
+}