[Ocfs2-tools-commits] zab commits r249 - in trunk: debugfs.ocfs2 extras fsck.ocfs2 libocfs2 mkfs.ocfs2 mounted.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Sep 23 16:37:05 CDT 2004


Author: zab
Date: 2004-09-23 16:37:04 -0500 (Thu, 23 Sep 2004)
New Revision: 249

Modified:
   trunk/debugfs.ocfs2/commands.c
   trunk/debugfs.ocfs2/readfs.c
   trunk/extras/Makefile
   trunk/extras/find_dup_extents.c
   trunk/extras/find_hardlinks.c
   trunk/extras/find_inode_paths.c
   trunk/fsck.ocfs2/Makefile
   trunk/libocfs2/Makefile
   trunk/libocfs2/bitmap.c
   trunk/libocfs2/dir_iterate.c
   trunk/libocfs2/extent_map.c
   trunk/libocfs2/extents.c
   trunk/libocfs2/fileio.c
   trunk/libocfs2/inode.c
   trunk/libocfs2/inode_scan.c
   trunk/libocfs2/lookup.c
   trunk/libocfs2/openfs.c
   trunk/libocfs2/unix_io.c
   trunk/mkfs.ocfs2/Makefile
   trunk/mkfs.ocfs2/mkfs.c
   trunk/mounted.ocfs2/Makefile
Log:
o remove -Wno-error and fix some bugs highlighted by warnings
o Use <inttypes.h> formats to print stdint types without warnings


Modified: trunk/debugfs.ocfs2/commands.c
===================================================================
--- trunk/debugfs.ocfs2/commands.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/debugfs.ocfs2/commands.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -39,7 +39,6 @@
 };
 
 static Command  *find_command (char  *cmd);
-static char    **get_data     (void);
 
 static void do_open (char **args);
 static void do_close (char **args);
@@ -455,15 +454,6 @@
 }					/* do_curdev */
 
 /*
- * get_data()
- *
- */
-static char ** get_data (void)
-{
-	return NULL;
-}					/* get_data */
-
-/*
  * do_super()
  *
  */

Modified: trunk/debugfs.ocfs2/readfs.c
===================================================================
--- trunk/debugfs.ocfs2/readfs.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/debugfs.ocfs2/readfs.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -24,6 +24,7 @@
  */
 
 #include <main.h>
+#include <inttypes.h>
 
 extern dbgfs_gbls gbls;
 
@@ -104,14 +105,14 @@
  */
 int read_inode (int fd, __u64 blknum, char *buf, int buflen)
 {
-	__u64 off;
+	uint64_t off;
 	ocfs2_dinode *inode;
 	int ret = 0;
 
 	off = blknum << gbls.blksz_bits;
 
 	if ((pread64(fd, buf, buflen, off)) == -1)
-		DBGFS_FATAL("%s off=%llu", strerror(errno), off);
+		DBGFS_FATAL("%s off=%"PRIu64, strerror(errno), off);
 
 	inode = (ocfs2_dinode *)buf;
 

Modified: trunk/extras/Makefile
===================================================================
--- trunk/extras/Makefile	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/extras/Makefile	2004-09-23 21:37:04 UTC (rev 249)
@@ -2,7 +2,7 @@
 
 include $(TOPDIR)/Preamble.make
 
-WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \
+WARNINGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
 ifdef OCFS_DEBUG

Modified: trunk/extras/find_dup_extents.c
===================================================================
--- trunk/extras/find_dup_extents.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/extras/find_dup_extents.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -32,6 +32,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -123,7 +124,7 @@
 		}
 		if (oldval) {
 			fprintf(stdout,
-				"Dup! % 20llu : %u\n",
+				"Dup! %20"PRIu64" : %u\n",
 				we->blkno, cluster + i);
 		}
 	}
@@ -199,8 +200,7 @@
 						   we);
 			if (ret) {
 				com_err(we->argv0, ret,
-					"while walking inode %llu",
-					blkno);
+					"while walking inode %"PRIu64, blkno);
 				goto out_close_scan;
 			}
 		}

Modified: trunk/extras/find_hardlinks.c
===================================================================
--- trunk/extras/find_hardlinks.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/extras/find_hardlinks.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <getopt.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -93,7 +94,8 @@
 		ret = ocfs2_bitmap_test(wp->dup_map, dentry->inode,
 					&oldval);
 		if (oldval) {
-			fprintf(stdout, "Dup! % 20llu %s\n", dentry->inode, path);
+			fprintf(stdout, "Dup! %20"PRIu64" %s\n", dentry->inode, 
+					path);
 		}
 		goto out;
 	}
@@ -102,7 +104,7 @@
 	ret = ocfs2_bitmap_set(wp->inode_map, dentry->inode, &oldval);
 	if (ret) {
 		com_err(wp->argv0, ret,
-			"while setting bitmap bit %llu\n",
+			"while setting bitmap bit %"PRIu64"\n",
 			dentry->inode);
 		reti = OCFS2_DIRENT_ABORT;
 		goto out;
@@ -114,7 +116,7 @@
 				       NULL);
 		if (ret) {
 			com_err(wp->argv0, ret,
-				"while setting dup bit %llu\n",
+				"while setting dup bit %"PRIu64"\n",
 				dentry->inode);
 			reti = OCFS2_DIRENT_ABORT;
 			goto out;
@@ -122,7 +124,7 @@
 	}
 
 	if (!wp->quiet)
-		fprintf(stdout, "% 20llu %s\n", dentry->inode, path);
+		fprintf(stdout, "%20"PRIu64" %s\n", dentry->inode, path);
 
 	if (dentry->file_type == OCFS2_FT_DIR) {
 		old_path = wp->path;
@@ -213,7 +215,7 @@
 				0, NULL, walk_tree_func, &wp);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while walking sysdm dir inode %llu on \"%s\"\n",
+			"while walking sysdm dir inode %"PRIu64" on \"%s\"\n",
 			blkno, filename);
 		goto out_close;
 	}
@@ -224,7 +226,7 @@
 				0, NULL, walk_tree_func, &wp);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while walking root inode %llu on \"%s\"\n",
+			"while walking root inode %"PRIu64" on \"%s\"\n",
 			blkno, filename);
 		goto out_close;
 	}
@@ -240,7 +242,8 @@
 					0, NULL, walk_tree_func, &wp);
 		if (ret) {
 			com_err(argv[0], ret,
-				"while dup scanning sysdm dir inode %llu on \"%s\"\n",
+				"while dup scanning sysdm dir inode %"PRIu64
+			        " on \"%s\"\n",
 				blkno, filename);
 			goto out_close;
 		}
@@ -251,7 +254,8 @@
 					0, NULL, walk_tree_func, &wp);
 		if (ret) {
 			com_err(argv[0], ret,
-				"while dup scanning root inode %llu on \"%s\"\n",
+				"while dup scanning root inode %"PRIu64
+			       	" on \"%s\"\n",
 				blkno, filename);
 			goto out_close;
 		}

Modified: trunk/extras/find_inode_paths.c
===================================================================
--- trunk/extras/find_inode_paths.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/extras/find_inode_paths.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -34,6 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <getopt.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -90,10 +91,12 @@
 	oldval = 0;
 
 	if (!wp->quiet)
-		fprintf(stdout, "[trace] % 13llu %s\n", dentry->inode, path);
+		fprintf(stdout, "[trace] %13"PRIu64" %s\n", dentry->inode, 
+				path);
 
 	if (dentry->inode == wp->inode)
-		fprintf(stdout, "[found] % 13llu %s\n", dentry->inode, path);
+		fprintf(stdout, "[found] %13"PRIu64" %s\n", dentry->inode, 
+				path);
 
 	if (dentry->file_type == OCFS2_FT_DIR) {
 		old_path = wp->path;
@@ -163,7 +166,7 @@
 		goto out;
 	}
 	wp.fs = fs;
-	fprintf(stdout, "Finding all paths leading to inode %llu\n", 
+	fprintf(stdout, "Finding all paths leading to inode %"PRIu64"\n", 
 		wp.inode);
 
 	if (!wp.quiet)
@@ -174,7 +177,7 @@
 				0, NULL, walk_tree_func, &wp);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while walking sysdm dir inode %llu on \"%s\"\n",
+			"while walking sysdm dir inode %"PRIu64" on \"%s\"\n",
 			blkno, filename);
 		goto out_close;
 	}
@@ -187,7 +190,7 @@
 				0, NULL, walk_tree_func, &wp);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while walking root inode %llu on \"%s\"\n",
+			"while walking root inode %"PRIu64" on \"%s\"\n",
 			blkno, filename);
 		goto out_close;
 	}

Modified: trunk/fsck.ocfs2/Makefile
===================================================================
--- trunk/fsck.ocfs2/Makefile	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/fsck.ocfs2/Makefile	2004-09-23 21:37:04 UTC (rev 249)
@@ -8,7 +8,7 @@
 INCLUDES = -Iinclude -I$(TOPDIR)/libocfs2/include
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 
-CFLAGS := -g -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \
+CFLAGS := -g -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations -fno-strict-aliasing
 
 DEFINES = -DOCFS2_FLAT_INCLUDES

Modified: trunk/libocfs2/Makefile
===================================================================
--- trunk/libocfs2/Makefile	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/Makefile	2004-09-23 21:37:04 UTC (rev 249)
@@ -2,7 +2,7 @@
 
 include $(TOPDIR)/Preamble.make
 
-WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \
+WARNINGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \
 	-Wmissing-declarations
 
 ifdef OCFS_DEBUG

Modified: trunk/libocfs2/bitmap.c
===================================================================
--- trunk/libocfs2/bitmap.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/bitmap.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -29,6 +29,7 @@
 
 #include <string.h>
 #include <limits.h>
+#include <inttypes.h>
 
 #include <asm/bitops.h>
 
@@ -591,14 +592,14 @@
 	struct list_head *pos;
 	struct ocfs2_bitmap_cluster *bc;
 
-	fprintf(stdout, "Bitmap \"%s\": total = %llu, set = %llu\n",
+	fprintf(stdout, "Bitmap \"%s\": total = %"PRIu64", set = %"PRIu64"\n",
 		bitmap->b_description, bitmap->b_total_bits,
 		bitmap->b_set_bits);
 	list_for_each(pos, &bitmap->b_clusters) {
 		bc = list_entry(pos, struct ocfs2_bitmap_cluster,
 				bc_list);
 		fprintf(stdout,
-			"(start: %llu, n: %d, set: %d, cpos: %u)\n",
+			"(start: %"PRIu64", n: %d, set: %d, cpos: %"PRIu32")\n",
 			bc->bc_start_bit, bc->bc_total_bits,
 			bc->bc_set_bits, bc->bc_cpos);
 	}
@@ -623,12 +624,12 @@
 				continue;
 			}
 			com_err("print_bitmap", ret,
-				"while testing bit %llu\n", bitno);
+				"while testing bit %"PRIu64"\n", bitno);
 			break;
 		}
 		if (gap) {
 			fprintf(stdout,
-				"\nGap of length %llu at %llu\n",
+				"\nGap of length %"PRIu64" at %"PRIu64"\n",
 				bitno - gap_start, gap_start);
 			gap = bitno % 72;
 			gap += gap / 8;
@@ -679,8 +680,7 @@
 
 	ret = (*func)(bitmap, bitno, ret_val);
 	if (ret) {
-		com_err("try_op", ret,
-			"while setting bit %llu\n", bitno);
+		com_err("try_op", ret, "while setting bit %"PRIu64"\n", bitno);
 		return 1;
 	}
 

Modified: trunk/libocfs2/dir_iterate.c
===================================================================
--- trunk/libocfs2/dir_iterate.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/dir_iterate.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -30,6 +30,8 @@
 #define _XOPEN_SOURCE 600 /* Triggers magic in features.h */
 #define _LARGEFILE64_SOURCE
 
+#include <inttypes.h>
+
 #include "ocfs2.h"
 
 #include "dir_iterate.h"
@@ -263,7 +265,7 @@
 	memcpy(name, dentry->name, dentry->name_len);
 	name[dentry->name_len] = '\0';
 
-	fprintf(stdout, "% 20llu %s\n", dentry->inode, name);
+	fprintf(stdout, "%20"PRIu64" %s\n", dentry->inode, name);
 
 	return 0;
 }
@@ -330,21 +332,20 @@
 
 	ret = ocfs2_read_inode(fs, blkno, buf);
 	if (ret) {
-		com_err(argv[0], ret,
-			"while reading inode %llu", blkno);
+		com_err(argv[0], ret, "while reading inode %"PRIu64, blkno);
 		goto out_free;
 	}
 
 	di = (ocfs2_dinode *)buf;
 
-	fprintf(stdout, "OCFS2 inode %llu on \"%s\"\n",
+	fprintf(stdout, "OCFS2 inode %"PRIu64" on \"%s\"\n",
 		blkno, filename);
 
 	ret = ocfs2_dir_iterate(fs, blkno, 0, NULL,
 				walk_names_func, NULL);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while listing inode %llu on \"%s\"\n",
+			"while listing inode %"PRIu64" on \"%s\"\n",
 			blkno, filename);
 		goto out_free;
 	}

Modified: trunk/libocfs2/extent_map.c
===================================================================
--- trunk/libocfs2/extent_map.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/extent_map.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -28,6 +28,7 @@
 #define _LARGEFILE64_SOURCE
 
 #include <string.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -233,7 +234,8 @@
 	list_for_each(pos, &em->em_extents) {
 		ent = list_entry(pos, ocfs2_extent_map_entry, e_list);
 
-		fprintf(stdout, "(%08u, %08lu, %08llu) | + %08lu = %08lu / %08lu\n",
+		fprintf(stdout, "(%08"PRIu32", %08"PRIu32", %08"PRIu64") |"
+				" + %08"PRIu32" = %08"PRIu32" / %08"PRIu32"\n",
 			ent->e_rec.e_cpos, ent->e_rec.e_clusters,
 			ent->e_rec.e_blkno, ccount,
 			ccount + ent->e_rec.e_clusters,
@@ -242,7 +244,7 @@
 		ccount += ent->e_rec.e_clusters;
 	}
 
-	fprintf(stdout, "TOTAL: %u\n", cinode->ci_inode->i_clusters);
+	fprintf(stdout, "TOTAL: %"PRIu32"\n", cinode->ci_inode->i_clusters);
 
 	return 0;
 }
@@ -300,12 +302,11 @@
 
 	ret = ocfs2_read_cached_inode(fs, blkno, &cinode);
 	if (ret) {
-		com_err(argv[0], ret,
-			"while reading inode %llu", blkno);
+		com_err(argv[0], ret, "while reading inode %"PRIu64, blkno);
 		goto out_close;
 	}
 
-	fprintf(stdout, "OCFS2 inode %llu on \"%s\" has depth %d\n",
+	fprintf(stdout, "OCFS2 inode %"PRIu64" on \"%s\" has depth %"PRId16"\n",
 		blkno, filename,
 		cinode->ci_inode->id2.i_list.l_tree_depth);
 

Modified: trunk/libocfs2/extents.c
===================================================================
--- trunk/libocfs2/extents.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/extents.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -32,6 +32,7 @@
 #define _LARGEFILE64_SOURCE
 
 #include <string.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -444,10 +445,11 @@
 	if (!ccount && !pad_amount)
 		fprintf(stdout, "EXTENTS:\n");
 
-	fprintf(stdout, "0x%08llX:%02u ", ref_blkno, ref_recno);
+	fprintf(stdout, "0x%08"PRIX64":%02u ", ref_blkno, ref_recno);
 	for (i = 0; i < pad_amount; i++)
 		fprintf(stdout, " ");
-	fprintf(stdout, "(%08u, %08lu, %08llu) | + %08lu = %08lu / %08lu\n",
+	fprintf(stdout, "(%08"PRIu32", %08"PRIu32", %08"PRIu64") |"
+			" + %08"PRIu32" = %08"PRIu32" / %08"PRIu32"\n",
 		rec->e_cpos, rec->e_clusters,
 		rec->e_blkno, ccount, ccount + rec->e_clusters,
 		wi->di->i_clusters);
@@ -484,11 +486,12 @@
 			fprintf(stdout, ", ");
 
 		if ((wb->run_first_bcount + 1) == bcount) {
-			fprintf(stdout, "(%llu):%llu",
+			fprintf(stdout, "(%"PRIu64"):%"PRIu64"",
 				wb->run_first_bcount,
 				wb->run_first_blkno);
 		} else {
-			fprintf(stdout, "(%llu-%llu):%llu-%llu",
+			fprintf(stdout, 
+				"(%"PRIu64"-%"PRIu64"):%"PRIu64"-%"PRIu64"",
 				wb->run_first_bcount,
 				bcount - 1,
 				wb->run_first_blkno,
@@ -503,17 +506,18 @@
 			fprintf(stdout, ", ");
 
 		if ((wb->run_prev_blkno + 1) != blkno) {
-			fprintf(stdout, "(%llu):%llu\n",
+			fprintf(stdout, "(%"PRIu64"):%"PRIu64"\n",
 				bcount, blkno);
 		} else {
-			fprintf(stdout, "(%llu-%llu):%llu-%llu\n",
+			fprintf(stdout, 
+				"(%"PRIu64"-%"PRIu64"):%"PRIu64"-%"PRIu64"\n",
 				wb->run_first_bcount,
 				bcount,
 				wb->run_first_blkno,
 				blkno);
 		}
 
-		fprintf(stdout, "TOTAL: %llu\n", bcount + 1);
+		fprintf(stdout, "TOTAL: %"PRIu64"\n", bcount + 1);
 	}
 
 	wb->run_prev_blkno = blkno;
@@ -600,14 +604,13 @@
 
 	ret = ocfs2_read_inode(fs, blkno, buf);
 	if (ret) {
-		com_err(argv[0], ret,
-			"while reading inode %llu", blkno);
+		com_err(argv[0], ret, "while reading inode %"PRIu64, blkno);
 		goto out_free;
 	}
 
 	di = (ocfs2_dinode *)buf;
 
-	fprintf(stdout, "OCFS2 inode %llu on \"%s\" has depth %d\n",
+	fprintf(stdout, "OCFS2 inode %"PRIu64" on \"%s\" has depth %"PRId16"\n",
 		blkno, filename, di->id2.i_list.l_tree_depth);
 
 	if (walk_extents) {

Modified: trunk/libocfs2/fileio.c
===================================================================
--- trunk/libocfs2/fileio.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/fileio.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -32,6 +32,7 @@
 
 #include <string.h>
 #include <limits.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -260,7 +261,8 @@
 				   &result_blkno);
 		if (ret) {
 			com_err(argv[0], ret,
-				"while looking up \"%s\" in inode %llu on \"%s\"\n",
+				"while looking up \"%s\" in inode %"PRIu64
+			       	" on \"%s\"\n",
 				lookup_name, blkno, filename);
 			goto out_free;
 		}

Modified: trunk/libocfs2/inode.c
===================================================================
--- trunk/libocfs2/inode.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/inode.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -31,6 +31,7 @@
 #define _LARGEFILE64_SOURCE
 
 #include <string.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -180,8 +181,7 @@
 	if (argc > 2) {
 		blkno = read_number(argv[2]);
 		if (blkno < OCFS2_SUPER_BLOCK_BLKNO) {
-			fprintf(stderr, "Invalid blockno: %s\n",
-				blkno);
+			fprintf(stderr, "Invalid blockno: %"PRIu64"\n", blkno);
 			print_usage();
 			return 1;
 		}
@@ -204,14 +204,13 @@
 
 	ret = ocfs2_read_inode(fs, blkno, buf);
 	if (ret) {
-		com_err(argv[0], ret,
-			"while reading inode %llu", blkno);
+		com_err(argv[0], ret, "while reading inode %"PRIu64, blkno);
 		goto out_free;
 	}
 
 	di = (ocfs2_dinode *)buf;
 
-	fprintf(stdout, "OCFS2 inode %llu on \"%s\"\n", blkno,
+	fprintf(stdout, "OCFS2 inode %"PRIu64" on \"%s\"\n", blkno,
 		filename);
 
 

Modified: trunk/libocfs2/inode_scan.c
===================================================================
--- trunk/libocfs2/inode_scan.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/inode_scan.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -33,6 +33,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -391,7 +392,8 @@
 			if (!(di->i_flags & OCFS2_VALID_FL))
 				continue;
 
-			fprintf(stdout, "%snode %llu with size %llu\n",
+			fprintf(stdout, 
+				"%snode %"PRIu64" with size %"PRIu64"\n",
 				(di->i_flags & OCFS2_SYSTEM_FL) ?
 				"System i" : "I",
 				blkno, di->i_size);

Modified: trunk/libocfs2/lookup.c
===================================================================
--- trunk/libocfs2/lookup.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/lookup.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -31,6 +31,7 @@
 #define _LARGEFILE64_SOURCE
 
 #include <string.h>
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -180,7 +181,7 @@
 
 	lookup_path = p;
 
-	fprintf(stdout, "/ (%llu)\n", blkno);
+	fprintf(stdout, "/ (%"PRIu64")\n", blkno);
 
 	indent = 0;
 	for (p = lookup_path; ; p++) {
@@ -194,7 +195,8 @@
 				   &result_blkno);
 		if (ret) {
 			com_err(argv[0], ret,
-				"while looking up \"%s\" in inode %llu on \"%s\"\n",
+				"while looking up \"%s\" in inode %"PRIu64" on"
+			        " \"%s\"\n",
 				lookup_name, blkno, filename);
 			goto out_free;
 		}
@@ -202,7 +204,7 @@
 		indent += 4;
 		for (c = 0; c < indent; c++)
 			fprintf(stdout, " ");
-		fprintf(stdout, "%s (%llu)\n", lookup_name,
+		fprintf(stdout, "%s (%"PRIu64")\n", lookup_name,
 			result_blkno);
 
 		blkno = result_blkno;

Modified: trunk/libocfs2/openfs.c
===================================================================
--- trunk/libocfs2/openfs.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/openfs.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -31,6 +31,7 @@
 #define _LARGEFILE64_SOURCE
 
 #include <string.h>
+#include <inttypes.h>
 
 /* I hate glibc and gcc */
 #ifndef ULLONG_MAX
@@ -338,7 +339,7 @@
 	}
 
 	if (blksize % OCFS2_MIN_BLOCKSIZE) {
-		fprintf(stderr, "Invalid blocksize: %lld\n", blksize);
+		fprintf(stderr, "Invalid blocksize: %"PRId64"\n", blksize);
 		print_usage();
 		return 1;
 	}
@@ -363,7 +364,7 @@
 		"\tblocksize = %d\n"
  		"\tclustersize = %d\n"
 		"\tclusters = %u\n"
-		"\tblocks = %llu\n",
+		"\tblocks = %"PRIu64"\n",
  		fs->fs_blocksize,
 		fs->fs_clustersize,
 		fs->fs_clusters,

Modified: trunk/libocfs2/unix_io.c
===================================================================
--- trunk/libocfs2/unix_io.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/libocfs2/unix_io.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -42,6 +42,7 @@
 #include <sys/resource.h>
 #include <sys/utsname.h>
 #endif
+#include <inttypes.h>
 
 #include "ocfs2.h"
 
@@ -310,18 +311,17 @@
 
 static void dump_block(int64_t blkno, int blksize, char *buf)
 {
-	unsigned int i;
+	size_t i;
 	uint32_t *vals = (uint32_t *)buf;
 
-	fprintf(stdout, "Dumping block %lld (%d bytes):\n", blkno,
+	fprintf(stdout, "Dumping block %"PRId64" (%d bytes):\n", blkno,
 		blksize);
 
 	for (i = 0; i < (blksize / sizeof(uint32_t)); i++) {
 		if (!(i % 4)) {
 			if (i)
 				fprintf(stdout, "\n");
-			fprintf(stdout, "0x%08X\t",
-				i * sizeof(uint32_t));
+			fprintf(stdout, "0x%08zu\t", i * sizeof(uint32_t));
 		}
 		dump_u32(&vals[i]);
 		fprintf(stdout, " ");
@@ -398,13 +398,13 @@
 	}
 
 	if (blksize % OCFS2_MIN_BLOCKSIZE) {
-		fprintf(stderr, "Invalid blocksize: %lld\n", blksize);
+		fprintf(stderr, "Invalid blocksize: %"PRId64"\n", blksize);
 		print_usage();
 		return 1;
 	}
 	if (count < 0) {
 		if (-count > (int64_t)INT_MAX) {
-			fprintf(stderr, "Count is too large: %lld\n",
+			fprintf(stderr, "Count is too large: %"PRId64"\n",
 				count);
 			print_usage();
 			return 1;
@@ -412,7 +412,7 @@
 		count = -count / blksize;
 	} else  {
 		if ((count * blksize) > INT_MAX) {
-			fprintf(stderr, "Count is too large: %lld\n",
+			fprintf(stderr, "Count is too large: %"PRId64"\n",
 				count);
 			print_usage();
 			return 1;
@@ -437,15 +437,15 @@
 	ret = ocfs2_malloc_blocks(channel, (int)count, &blks);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while allocating %d blocks", count);
+			"while allocating %"PRId64" blocks", count);
 		goto out_channel;
 	}
 
 	ret = io_read_block(channel, blkno, (int)count, blks);
 	if (ret) {
 		com_err(argv[0], ret,
-			"while reading %d blocks at block %lld (%s)",
-			(int)count, blkno,
+			"while reading %"PRId64" blocks at block %"PRId64" (%s)",
+			count, blkno,
 			strerror(io_get_error(channel)));
 		goto out_blocks;
 	}

Modified: trunk/mkfs.ocfs2/Makefile
===================================================================
--- trunk/mkfs.ocfs2/Makefile	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/mkfs.ocfs2/Makefile	2004-09-23 21:37:04 UTC (rev 249)
@@ -2,7 +2,7 @@
 
 include $(TOPDIR)/Preamble.make
 
-WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \
+WARNINGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
 ifdef OCFS_DEBUG

Modified: trunk/mkfs.ocfs2/mkfs.c
===================================================================
--- trunk/mkfs.ocfs2/mkfs.c	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/mkfs.ocfs2/mkfs.c	2004-09-23 21:37:04 UTC (rev 249)
@@ -39,6 +39,7 @@
 #include <time.h>
 #include <libgen.h>
 #include <netinet/in.h>
+#include <inttypes.h>
 
 #include <asm/bitops.h>
 
@@ -373,7 +374,7 @@
 	leading_space = alloc_inode(s, LEADING_SPACE_BLOCKS);
 	if (leading_space != 0ULL) {
 		com_err(s->progname, 0,
-			"Leading space blocks start at byte %llu, "
+			"Leading space blocks start at byte %"PRIu64", "
 			"must start at 0", leading_space);
 		exit(1);
 	}
@@ -381,10 +382,11 @@
 	superblock_rec.fe_off = alloc_inode(s, SUPERBLOCK_BLOCKS);
 	if (superblock_rec.fe_off != (__u64)MAGIC_SUPERBLOCK_BLOCK_NUMBER << s->blocksize_bits) {
 		com_err(s->progname, 0,
-			"Superblock starts at byte %llu, "
-			"must start at %llu",
+			"Superblock starts at byte %"PRIu64", "
+			"must start at %"PRIu64"",
 			superblock_rec.fe_off,
-			MAGIC_SUPERBLOCK_BLOCK_NUMBER << s->blocksize_bits);
+			(uint64_t)MAGIC_SUPERBLOCK_BLOCK_NUMBER << 
+			s->blocksize_bits);
 		exit(1);
 	}
 
@@ -964,7 +966,7 @@
 
 	if (start_bit == (uint32_t)-1) {
 		com_err(s->progname, 0,
-			"Could not allocate %llu bits from %s bitmap",
+			"Could not allocate %"PRIu64" bits from %s bitmap",
 			num_bits, bitmap->name);
 		exit(1);
 	}

Modified: trunk/mounted.ocfs2/Makefile
===================================================================
--- trunk/mounted.ocfs2/Makefile	2004-09-23 00:18:24 UTC (rev 248)
+++ trunk/mounted.ocfs2/Makefile	2004-09-23 21:37:04 UTC (rev 249)
@@ -2,7 +2,7 @@
 
 include $(TOPDIR)/Preamble.make
 
-WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \
+WARNINGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
 ifdef OCFS_DEBUG



More information about the Ocfs2-tools-commits mailing list