Run entire source base through GNU indent to tidy up the varying
[u/mdw/putty] / sshcrc.c
index 63050b9..fb0db0c 100644 (file)
--- a/sshcrc.c
+++ b/sshcrc.c
@@ -89,7 +89,7 @@
 #define POLY (0xEDB88320L)
 
 #ifdef GENPROGRAM
-#define INITFUNC /* the gen program needs the init func :-) */
+#define INITFUNC                      /* the gen program needs the init func :-) */
 #endif
 
 #ifdef INITFUNC
  */
 static unsigned long crc32_table[256];
 
-void crc32_init(void) {
+void crc32_init(void)
+{
     unsigned long crcword;
     int i;
-    
+
     for (i = 0; i < 256; i++) {
-        unsigned long newbyte, x32term;
-        int j;
-        crcword = 0;
-        newbyte = i;
-        for (j = 0; j < 8; j++) {
-            x32term = (crcword ^ newbyte) & 1;
-            crcword = (crcword >> 1) ^ (x32term * POLY);
-            newbyte >>= 1;
-        }
-        crc32_table[i] = crcword;
+       unsigned long newbyte, x32term;
+       int j;
+       crcword = 0;
+       newbyte = i;
+       for (j = 0; j < 8; j++) {
+           x32term = (crcword ^ newbyte) & 1;
+           crcword = (crcword >> 1) ^ (x32term * POLY);
+           newbyte >>= 1;
+       }
+       crc32_table[i] = crcword;
     }
 }
 
@@ -193,29 +194,31 @@ static const unsigned long crc32_table[256] = {
 #endif
 
 #ifdef GENPROGRAM
-int main(void) {
+int main(void)
+{
     unsigned long crcword;
     int i;
 
     crc32_init();
     for (i = 0; i < 256; i++) {
-        printf("%s0x%08XL%s",
-               (i % 4 == 0 ? "    " : " "),
-               crc32_table[i],
-               (i % 4 == 3 ? (i == 255 ? "\n" : ",\n") : ","));
+       printf("%s0x%08XL%s",
+              (i % 4 == 0 ? "    " : " "),
+              crc32_table[i],
+              (i % 4 == 3 ? (i == 255 ? "\n" : ",\n") : ","));
     }
 
     return 0;
 }
 #endif
 
-unsigned long crc32(const void *buf, size_t len) {
+unsigned long crc32(const void *buf, size_t len)
+{
     unsigned long crcword = 0L;
     const unsigned char *p = (const unsigned char *) buf;
     while (len--) {
-        unsigned long newbyte = *p++;
-        newbyte ^= crcword & 0xFFL;
-        crcword = (crcword >> 8) ^ crc32_table[newbyte];
+       unsigned long newbyte = *p++;
+       newbyte ^= crcword & 0xFFL;
+       crcword = (crcword >> 8) ^ crc32_table[newbyte];
     }
     return crcword;
 }