CABINET: Debug output fixes
Thomas Weidenmueller
wine-patches at reactsoft.com
Tue Jun 7 08:41:06 CDT 2005
Hi,
I attached a patch that removes local variables only used in TRACE
statements. The problem is that they generate warnings (unused
variables) as soon as the TRACE statements are not expanded. No other
changes.
Thomas
-------------- next part --------------
Index: dlls/cabinet/cabextract.c
===================================================================
RCS file: /home/wine/wine/dlls/cabinet/cabextract.c,v
retrieving revision 1.18
diff -u -r1.18 cabextract.c
--- dlls/cabinet/cabextract.c 18 Apr 2005 15:33:15 -0000 1.18
+++ dlls/cabinet/cabextract.c 7 Jun 2005 13:36:08 -0000
@@ -31,6 +31,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
#include "windef.h"
#include "winbase.h"
@@ -2523,7 +2524,6 @@
* print_fileinfo (internal)
*/
void print_fileinfo(struct cab_file *fi) {
- int d = fi->date, t = fi->time;
char *fname = NULL;
if (fi->attribs & cffile_A_NAME_IS_UTF) {
@@ -2536,8 +2536,8 @@
TRACE("%9u | %02d.%02d.%04d %02d:%02d:%02d | %s\n",
fi->length,
- d & 0x1f, (d>>5) & 0xf, (d>>9) + 1980,
- t >> 11, (t>>5) & 0x3f, (t << 1) & 0x3e,
+ fi->date & 0x1f, (fi->date>>5) & 0xf, (fi->date>>9) + 1980,
+ fi->time >> 11, (fi->time>>5) & 0x3f, (fi->time << 1) & 0x3e,
fname ? fname : fi->filename
);
Index: dlls/cabinet/cabinet_main.c
===================================================================
RCS file: /home/wine/wine/dlls/cabinet/cabinet_main.c,v
retrieving revision 1.7
diff -u -r1.7 cabinet_main.c
--- dlls/cabinet/cabinet_main.c 14 Dec 2004 11:38:50 -0000 1.7
+++ dlls/cabinet/cabinet_main.c 7 Jun 2005 13:37:26 -0000
@@ -89,12 +89,12 @@
HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR what)
{
#define DUMPC(idx) idx >= sizeof(EXTRACTdest) ? ' ' : \
- ptr[idx] >= 0x20 ? ptr[idx] : '.'
+ ((unsigned char*) dest)[idx] >= 0x20 ? \
+ ((unsigned char*) dest)[idx] : '.'
-#define DUMPH(idx) idx >= sizeof(EXTRACTdest) ? 0x55 : ptr[idx]
+#define DUMPH(idx) idx >= sizeof(EXTRACTdest) ? 0x55 : ((unsigned char*) dest)[idx]
LPSTR dir;
- unsigned char *ptr = (unsigned char*) dest;
unsigned int i;
TRACE("(dest == %0lx, what == %s)\n", (long) dest, debugstr_a(what));
More information about the wine-patches
mailing list