Final round of printf warnings fixes for the moment.
authorTim Potter <tpot@samba.org>
Thu, 6 Nov 2003 22:11:08 +0000 (22:11 +0000)
committerTim Potter <tpot@samba.org>
Thu, 6 Nov 2003 22:11:08 +0000 (22:11 +0000)
(This used to be commit 0519a7022b4979c0e8ddd4907f4b858a59299c06)

source3/nmbd/nmbd_processlogon.c
source3/nsswitch/winbindd.c
source3/script/mkbuildoptions.awk
source3/torture/denytest.c
source3/torture/torture.c
source3/torture/utable.c
source3/utils/ntlm_auth.c
source3/utils/smbcontrol.c
source3/utils/smbfilter.c

index 816b3514644a73ea3dd7b78326a4486b6eb88b13..3b021978056c04db6657b97635bc887570c8f48a 100644 (file)
@@ -255,7 +255,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                        q = ALIGN4(q, buf);
                                }
 
-                               DEBUG(3,("process_logon_packet: len = %d PTR_DIFF(q, buf) = %d\n", len, PTR_DIFF(q, buf) ));
+                               DEBUG(3,("process_logon_packet: len = %d PTR_DIFF(q, buf) = %ld\n", len, (unsigned long)PTR_DIFF(q, buf) ));
 
                                if (len - PTR_DIFF(q, buf) > 8) {
                                        /* with NT5 clients we can sometimes
index 4f161604b5d3bd01cf1fff65bfa22ad4684a1636..4b47ac13a2f3cbe3d149999ec636ba680078f57f 100644 (file)
@@ -452,7 +452,7 @@ void winbind_client_read(struct winbindd_cli_state *state)
                 (char *)&state->request, 
                 sizeof(state->request) - state->read_buf_len);
        
-       DEBUG(10,("client_read: read %d bytes. Need %d more for a full request.\n", n, sizeof(state->request) - n - state->read_buf_len ));
+       DEBUG(10,("client_read: read %d bytes. Need %ld more for a full request.\n", n, (unsigned long)(sizeof(state->request) - n - state->read_buf_len) ));
 
        /* Read failed, kill client */
        
@@ -719,8 +719,8 @@ static void process_loop(void)
 
                                        if (state->read_buf_len >= sizeof(uint32)
                                            && *(uint32 *) &state->request != sizeof(state->request)) {
-                                               DEBUG(0,("process_loop: Invalid request size from pid %lu: %d bytes sent, should be %d\n",
-                                                               (unsigned long)state->request.pid, *(uint32 *) &state->request, sizeof(state->request)));
+                                               DEBUG(0,("process_loop: Invalid request size from pid %lu: %d bytes sent, should be %ld\n",
+                                                               (unsigned long)state->request.pid, *(uint32 *) &state->request, (unsigned long)sizeof(state->request)));
 
                                                remove_client(state);
                                                break;
index e47664add41a865045fe62c3b5a83bd19f2cc794..9c226623109ca6e1ee22048a45175ba2900af6a4 100644 (file)
@@ -242,14 +242,14 @@ END {
        # add code to display the various type sizes
        print "       /* Output the sizes of the various types */";
        print "       output(screen, \"\\nType sizes:\\n\");";
-       print "       output(screen, \"   sizeof(char):    %lu\\n\",sizeof(char));";
-       print "       output(screen, \"   sizeof(int):     %lu\\n\",sizeof(int));";
-       print "       output(screen, \"   sizeof(long):    %lu\\n\",sizeof(long));";
-       print "       output(screen, \"   sizeof(uint8):   %lu\\n\",sizeof(uint8));";
-       print "       output(screen, \"   sizeof(uint16):  %lu\\n\",sizeof(uint16));";
-       print "       output(screen, \"   sizeof(uint32):  %lu\\n\",sizeof(uint32));";
-       print "       output(screen, \"   sizeof(short):   %lu\\n\",sizeof(short));";
-       print "       output(screen, \"   sizeof(void*):   %lu\\n\",sizeof(void*));";
+       print "       output(screen, \"   sizeof(char):    %lu\\n\",(unsigned long)sizeof(char));";
+       print "       output(screen, \"   sizeof(int):     %lu\\n\",(unsigned long)sizeof(int));";
+       print "       output(screen, \"   sizeof(long):    %lu\\n\",(unsigned long)sizeof(long));";
+       print "       output(screen, \"   sizeof(uint8):   %lu\\n\",(unsigned long)sizeof(uint8));";
+       print "       output(screen, \"   sizeof(uint16):  %lu\\n\",(unsigned long)sizeof(uint16));";
+       print "       output(screen, \"   sizeof(uint32):  %lu\\n\",(unsigned long)sizeof(uint32));";
+       print "       output(screen, \"   sizeof(short):   %lu\\n\",(unsigned long)sizeof(short));";
+       print "       output(screen, \"   sizeof(void*):   %lu\\n\",(unsigned long)sizeof(void*));";
 
        ##################################################
        # add code to give information about modules
index 3a7906fb33b3e091e2ee4bc10fc22836a86ac416..89b0fdf93f6f4bdcb9d76b2a827108a8c10fe19b 100644 (file)
@@ -1427,7 +1427,7 @@ BOOL torture_denytest1(int dummy)
                cli_close(cli1, fnum1);
        }
 
-       printf("testing %d entries\n", ARRAY_SIZE(denytable1));
+       printf("testing %ld entries\n", (unsigned long)ARRAY_SIZE(denytable1));
 
        for (i=0; i<ARRAY_SIZE(denytable1); i++) {
                enum deny_result res;
index d20c48d6454682fb1f13740d3fd51d7a60725322..bf3f0c6194d17f2f23e1fa00fdfcb7ba65335c93 100644 (file)
@@ -427,9 +427,9 @@ static BOOL rw_torture3(struct cli_state *c, char *lockfname)
                                                  sizeof(buf)-count);
                        if (sent < 0)
                        {
-                               printf("read failed offset:%d size:%d (%s)\n",
-                                               count, sizeof(buf)-count,
-                                               cli_errstr(c));
+                               printf("read failed offset:%d size:%ld (%s)\n",
+                                      count, (unsigned long)sizeof(buf)-count,
+                                      cli_errstr(c));
                                correct = False;
                                sent = 0;
                        }
@@ -438,8 +438,7 @@ static BOOL rw_torture3(struct cli_state *c, char *lockfname)
                                if (memcmp(buf_rd+count, buf+count, sent) != 0)
                                {
                                        printf("read/write compare failed\n");
-                                       printf("offset: %d req %d recvd %d\n",
-                                               count, sizeof(buf)-count, sent);
+                                       printf("offset: %d req %ld recvd %ld\n", count, (unsigned long)sizeof(buf)-count, (unsigned long)sent);
                                        correct = False;
                                        break;
                                }
@@ -504,7 +503,8 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2)
 
                if ((bytes_read = cli_read(c2, fnum2, buf_rd, 0, buf_size)) != buf_size) {
                        printf("read failed (%s)\n", cli_errstr(c2));
-                       printf("read %d, expected %d\n", bytes_read, buf_size); 
+                       printf("read %d, expected %ld\n", bytes_read, 
+                              (unsigned long)buf_size); 
                        correct = False;
                        break;
                }
@@ -620,9 +620,11 @@ static BOOL run_readwritelarge(int dummy)
        }
 
        if (fsize == sizeof(buf))
-               printf("readwritelarge test 1 succeeded (size = %x)\n", fsize);
+               printf("readwritelarge test 1 succeeded (size = %lx)\n", 
+                      (unsigned long)fsize);
        else {
-               printf("readwritelarge test 1 failed (size = %x)\n", fsize);
+               printf("readwritelarge test 1 failed (size = %lx)\n", 
+                      (unsigned long)fsize);
                correct = False;
        }
 
@@ -652,9 +654,11 @@ static BOOL run_readwritelarge(int dummy)
        }
 
        if (fsize == sizeof(buf))
-               printf("readwritelarge test 2 succeeded (size = %x)\n", fsize);
+               printf("readwritelarge test 2 succeeded (size = %lx)\n", 
+                      (unsigned long)fsize);
        else {
-               printf("readwritelarge test 2 failed (size = %x)\n", fsize);
+               printf("readwritelarge test 2 failed (size = %lx)\n", 
+                      (unsigned long)fsize);
                correct = False;
        }
 
index 3ec5932b79140f7e897c686caf76f7c63fa83f26..5d819cc6af04815c79259698f093c9e50f64f627 100644 (file)
@@ -165,8 +165,8 @@ BOOL torture_casetable(int dummy)
                        int c2[MAX_EQUIVALENCE];
 
                        if (size/sizeof(int) >= MAX_EQUIVALENCE) {
-                               printf("too many chars match?? size=%d c=0x%04x\n",
-                                      size, c);
+                               printf("too many chars match?? size=%ld c=0x%04x\n",
+                                      (unsigned long)size, c);
                                cli_close(cli, fnum);
                                return False;
                        }
index 7cd7e0b0875fce4133a7d63b16f3fac244fb54d6..13b9550347db7ce97269d1ae02f18e555a8a3fe0 100644 (file)
@@ -1984,8 +1984,8 @@ enum {
                        if ((challenge_len = strhex_to_str(challenge, 
                                                           strlen(hex_challenge), 
                                                           hex_challenge)) != 8) {
-                               x_fprintf(x_stderr, "hex decode of %s failed (only got %u bytes)!\n", 
-                                       hex_challenge, challenge_len);
+                               x_fprintf(x_stderr, "hex decode of %s failed (only got %lu bytes)!\n", 
+                                       hex_challenge, (unsigned long)challenge_len);
                                exit(1);
                        }
                        opt_challenge = data_blob(challenge, challenge_len);
index 190627e2a52b8c9dcbb8f983471cc32c96638dad..eae1f97b58bedabb4c30d9c85c77643941bf3740 100644 (file)
@@ -203,7 +203,8 @@ static void profilelevel_cb(int msg_type, pid_t pid, void *buf, size_t len)
        num_replies++;
 
        if (len != sizeof(int)) {
-               fprintf(stderr, "invalid message length %d returned\n", len);
+               fprintf(stderr, "invalid message length %ld returned\n", 
+                       (unsigned long)len);
                return;
        }
 
index 1a0d639f0254efdbef8a1476b5d1eec7e943c3c3..5d67c8fc7cf96e283f60d795a781da29fdbb8323 100644 (file)
@@ -47,7 +47,7 @@ static void save_file(const char *fname, void *packet, size_t length)
                return;
        }
        close(fd);
-       printf("Wrote %d bytes to %s\n", length, fname);
+       printf("Wrote %ld bytes to %s\n", (unsigned long)length, fname);
 }
 
 static void filter_reply(char *buf)