PATCH: dlls/ole32/storage.c

Gerald Pfeifer pfeifer at
Mon Jan 27 11:27:12 CST 2003

I sent a variant of this some time ago, but it wasn't applied and I didn't
get a bounce/response.

Given that STORAGE_get_nth_next_small_blocknr() does the same kind of
initialization (which I just simplify with the first hunk below), it would
be nice to avoid the compiler warning in STORAGE_get_free_pps_entry(),
even though in theory a compiler might be able to prove that lastblocknr
is in fact not used uninitialized.


Avoid compiler warning in STORAGE_get_free_pps_entry().

Index: storage.c
RCS file: /home/wine/wine/dlls/ole32/storage.c,v
retrieving revision 1.30
diff -u -3 -p -r1.30 storage.c
--- storage.c	7 Jan 2003 20:36:25 -0000	1.30
+++ storage.c	27 Jan 2003 17:23:59 -0000
@@ -281,13 +281,12 @@ STORAGE_get_next_small_blocknr(HANDLE hf
 static int
 STORAGE_get_nth_next_small_blocknr(HANDLE hf,int blocknr,int nr) {
-	int	lastblocknr;
+	int	lastblocknr=-1;
 	BYTE	block[BIGSIZE];
 	LPINT	sbd = (LPINT)block;
 	struct storage_header sth;

-	lastblocknr=-1;
 	while ((nr--) && (blocknr>=0)) {
 		if (lastblocknr/128!=blocknr/128) {
@@ -659,7 +658,7 @@ STORAGE_get_free_small_blocknr(HANDLE hf
 static int
 STORAGE_get_free_pps_entry(HANDLE hf) {
-	int	blocknr,i,curblock,lastblocknr;
+	int	blocknr, i, curblock, lastblocknr=-1;
 	BYTE	block[BIGSIZE];
 	struct storage_pps_entry *stde = (struct storage_pps_entry*)block;
 	struct storage_header sth;

More information about the wine-patches mailing list