Ensure parameter types match format string
authorDerrell Lipman <derrell@dworkin.(none)>
Fri, 27 Mar 2009 22:03:00 +0000 (18:03 -0400)
committerDerrell Lipman <derrell@dworkin.(none)>
Fri, 27 Mar 2009 22:03:00 +0000 (18:03 -0400)
examples/libsmbclient/testbrowse.c
examples/libsmbclient/testfstatvfs.c
examples/libsmbclient/testsmbc.c
examples/libsmbclient/teststatvfs.c

index a6e6395078f0b98124e75d14d33227600bd7cd30..c3fb3946dab92ec8b41b9a9ee63d6dd8015d35a2 100644 (file)
@@ -197,7 +197,7 @@ get_auth_data_with_context_fn(SMBCCTX * context,
                               char * pPassword,
                               int maxLenPassword)
 {
-    printf("Authenticating with context 0x%lx", context);
+    printf("Authenticating with context %p", context);
     if (context != NULL) {
         char *user_data = smbc_getOptionUserData(context);
         printf(" with user data %s", user_data);
index b4dafefff60a4dc2991c9cf9b2659004b832a08e..73f42d446ab00955c0638ed835ab81199e3a51aa 100644 (file)
@@ -75,13 +75,20 @@ int main(int argc, char * argv[])
             printf("\n");
             printf("Block Size: %lu\n", statvfsbuf.f_bsize);
             printf("Fragment Size: %lu\n", statvfsbuf.f_frsize);
-            printf("Blocks: %llu\n", statvfsbuf.f_blocks);
-            printf("Free Blocks: %llu\n", statvfsbuf.f_bfree);
-            printf("Available Blocks: %llu\n", statvfsbuf.f_bavail);
-            printf("Files : %llu\n", statvfsbuf.f_files);
-            printf("Free Files: %llu\n", statvfsbuf.f_ffree);
-            printf("Available Files: %llu\n", statvfsbuf.f_favail);
-            printf("File System ID: %lu\n", statvfsbuf.f_fsid);
+            printf("Blocks: %llu\n",
+                   (unsigned long long) statvfsbuf.f_blocks);
+            printf("Free Blocks: %llu\n",
+                   (unsigned long long) statvfsbuf.f_bfree);
+            printf("Available Blocks: %llu\n",
+                   (unsigned long long) statvfsbuf.f_bavail);
+            printf("Files : %llu\n",
+                   (unsigned long long) statvfsbuf.f_files);
+            printf("Free Files: %llu\n",
+                   (unsigned long long) statvfsbuf.f_ffree);
+            printf("Available Files: %llu\n",
+                   (unsigned long long) statvfsbuf.f_favail);
+            printf("File System ID: %lu\n",
+                   (unsigned long) statvfsbuf.f_fsid);
             printf("\n");
 
             printf("Flags: 0x%lx\n", statvfsbuf.f_flag);
index 1f06437293a749331f743820bbf553e8c4d21c3b..de42428c2b0096376683a704900d8c0131c1e682 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/time.h>
 #include <string.h>
 #include <unistd.h>
@@ -33,8 +34,12 @@ int global_id = 0;
 void print_list_fn(struct print_job_info *pji)
 {
 
-  fprintf(stdout, "Print job: ID: %u, Prio: %u, Size: %u, User: %s, Name: %s\n",
-         pji->id, pji->priority, pji->size, pji->user, pji->name);
+  fprintf(stdout, "Print job: ID: %u, Prio: %u, Size: %lu, User: %s, Name: %s\n",
+         pji->id,
+          pji->priority,
+          (unsigned long) pji->size,
+          pji->user,
+          pji->name);
 
   global_id = pji->id;
 
@@ -137,7 +142,8 @@ int main(int argc, char *argv[])
 
   }
 
-  fprintf(stdout, "Wrote %d bytes to file: %s\n", sizeof(buff), buff);
+  fprintf(stdout, "Wrote %lu bytes to file: %s\n",
+          (unsigned long) sizeof(buff), buff);
 
   /* Now, seek the file back to offset 0 */
 
index 8812002d5ce25742cf0066d871a3678f5f50ec18..b7e6b5159e1ddaeb5f20d929723f13c4d69f353d 100644 (file)
@@ -49,13 +49,20 @@ int main(int argc, char * argv[])
             printf("\n");
             printf("Block Size: %lu\n", statvfsbuf.f_bsize);
             printf("Fragment Size: %lu\n", statvfsbuf.f_frsize);
-            printf("Blocks: %llu\n", statvfsbuf.f_blocks);
-            printf("Free Blocks: %llu\n", statvfsbuf.f_bfree);
-            printf("Available Blocks: %llu\n", statvfsbuf.f_bavail);
-            printf("Files : %llu\n", statvfsbuf.f_files);
-            printf("Free Files: %llu\n", statvfsbuf.f_ffree);
-            printf("Available Files: %llu\n", statvfsbuf.f_favail);
-            printf("File System ID: %lu\n", statvfsbuf.f_fsid);
+            printf("Blocks: %llu\n",
+                   (unsigned long long) statvfsbuf.f_blocks);
+            printf("Free Blocks: %llu\n",
+                   (unsigned long long) statvfsbuf.f_bfree);
+            printf("Available Blocks: %llu\n",
+                   (unsigned long long) statvfsbuf.f_bavail);
+            printf("Files : %llu\n",
+                   (unsigned long long) statvfsbuf.f_files);
+            printf("Free Files: %llu\n",
+                   (unsigned long long) statvfsbuf.f_ffree);
+            printf("Available Files: %llu\n",
+                   (unsigned long long) statvfsbuf.f_favail);
+            printf("File System ID: %lu\n",
+                   (unsigned long) statvfsbuf.f_fsid);
             printf("\n");
 
             printf("Flags: 0x%lx\n", statvfsbuf.f_flag);