]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix some warnings
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 29 Oct 2010 20:19:14 +0000 (20:19 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 30 Oct 2010 08:55:39 +0000 (10:55 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10570 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=018f5c7c845311a157da255d819683770c6543c4

crypto-keygen-standalone.c

index 732d8d9d9d01526dbc388c7b0d15ba8fc557d996..7ae6d66e37523797337d6fa0f4c1a1a85139b011 100644 (file)
@@ -1,5 +1,8 @@
+#define _GNU_SOURCE
+
 #include <d0_blind_id/d0_blind_id.h>
 
+#include <ctype.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <getopt.h>
@@ -334,7 +337,7 @@ int main(int argc, char **argv)
                        for(i = 0; infix[i]; ++i)
                                if(toupper(infix[i]) != tolower(infix[i]))
                                        guesscount /= 2;
-               for(i = 0; i < prefixlen; ++i)
+               for(i = 0; i < (int)prefixlen; ++i)
                        if(toupper(prefix[i]) != tolower(prefix[i]))
                                guesscount /= 2;
        }
@@ -583,16 +586,16 @@ int main(int argc, char **argv)
                                char buf2[65536]; size_t buf2size;
                                bufsize = sizeof(buf);
                                CHECK(d0_blind_id_authenticate_with_private_id_start(ctx, 1, 1, "hello world", 11, buf, &bufsize));
-                               for(i = 0; i < bufsize; ++i)
+                               for(i = 0; i < (int)bufsize; ++i)
                                        sprintf(&hexbuf[2*i], "%02x", (unsigned char)buf[i]);
                                printf("%s\n", hexbuf);
                                fgets(hexbuf, sizeof(hexbuf), stdin);
                                buf2size = strlen(hexbuf) / 2;
-                               for(i = 0; i < buf2size; ++i)
+                               for(i = 0; i < (int)buf2size; ++i)
                                        buf2[i] = ((strchr(hex, hexbuf[2*i]) - hex) << 4) | (strchr(hex, hexbuf[2*i+1]) - hex);
                                bufsize = sizeof(buf);
                                CHECK(d0_blind_id_authenticate_with_private_id_response(ctx, buf2, buf2size, buf, &bufsize));
-                               for(i = 0; i < bufsize; ++i)
+                               for(i = 0; i < (int)bufsize; ++i)
                                        sprintf(&hexbuf[2*i], "%02x", (unsigned char)buf[i]);
                                printf("%s\n", hexbuf);
                        }
@@ -607,16 +610,16 @@ int main(int argc, char **argv)
                                D0_BOOL status;
                                fgets(hexbuf, sizeof(hexbuf), stdin);
                                buf2size = strlen(hexbuf) / 2;
-                               for(i = 0; i < buf2size; ++i)
+                               for(i = 0; i < (int)buf2size; ++i)
                                        buf2[i] = ((strchr(hex, hexbuf[2*i]) - hex) << 4) | (strchr(hex, hexbuf[2*i+1]) - hex);
                                bufsize = sizeof(buf);
                                CHECK(d0_blind_id_authenticate_with_private_id_challenge(ctx, 1, 1, buf2, buf2size, buf, &bufsize, &status));
-                               for(i = 0; i < bufsize; ++i)
+                               for(i = 0; i < (int)bufsize; ++i)
                                        sprintf(&hexbuf[2*i], "%02x", (unsigned char)buf[i]);
                                printf("%s\n", hexbuf);
                                fgets(hexbuf, sizeof(hexbuf), stdin);
                                buf2size = strlen(hexbuf) / 2;
-                               for(i = 0; i < buf2size; ++i)
+                               for(i = 0; i < (int)buf2size; ++i)
                                        buf2[i] = ((strchr(hex, hexbuf[2*i]) - hex) << 4) | (strchr(hex, hexbuf[2*i+1]) - hex);
                                bufsize = sizeof(buf);
                                CHECK(d0_blind_id_authenticate_with_private_id_verify(ctx, buf2, buf2size, buf, &bufsize, &status));