Package: helpdeco
Version: 2.1.1-2
Severity: normal
Tags: patch

When building 'helpdeco' on amd64/unstable with gcc-4.0,
I get the following error:

helpdeco.c: In function 'DumpTopic':
helpdeco.c:4353: warning: pointer targets in passing argument 1 of 
'HexDumpMemory' differ in signedness
helpdeco.c:4427: error: invalid lvalue in increment
helpdeco.c:4447: error: invalid lvalue in increment
helpdeco.c: In function 'main':
helpdeco.c:5809: warning: format '%d' expects type 'int', but argument 3 has 
type 'long unsigned int'
make[1]: *** [helpdeco.o] Error 1
make[1]: Leaving directory `/helpdeco-2.1.1'
make: *** [build] Error 2

With the attached patch 'helpdeco' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/helpdeco-2.1.1/helpdec1.c ./helpdec1.c
--- ../tmp-orig/helpdeco-2.1.1/helpdec1.c       2005-05-19 14:11:36.000000000 
+0200
+++ ./helpdec1.c        2005-06-20 08:12:49.000000000 +0200
@@ -612,20 +612,41 @@
 /* scan-functions for reading compressed values from LinkData1 */
 short scanint(char **ptr) /* scan a compressed short */
 {
-    if(*(*ptr)&1) return (*(((unsigned short *)(*ptr))++)>>1)-0x4000;
-    return (*(((unsigned char *)(*ptr))++)>>1)-0x40;
+    short ret;
+    if(*(*ptr)&1) {
+       ret = (*(((unsigned short *)(*ptr)))>>1)-0x4000;
+        ptr=((unsigned short *)*ptr)+1;
+    } else {
+        ret = (*(((unsigned char *)(*ptr)))>>1)-0x40;
+        ptr=((unsigned char *)*ptr)+1;
+    }
+    return ret;
 }
 
 unsigned short scanword(char **ptr) /* scan a compressed unsiged short */
 {
-    if(*(*ptr)&1) return *(((unsigned short *)(*ptr))++)>>1;
-    return *(((unsigned char *)(*ptr))++)>>1;
+    short ret;
+    if(*(*ptr)&1) {
+       ret = (*(((unsigned short *)(*ptr)))>>1);
+        ptr=((unsigned short *)*ptr)+1;
+    } else {
+        ret = (*(((unsigned char *)(*ptr)))>>1);
+        ptr=((unsigned char *)*ptr)+1;
+    }
+    return ret;
 }
 
 long scanlong(char **ptr)  /* scan a compressed long */
 {
-    if(*(*ptr)&1) return (*(((unsigned long *)(*ptr))++)>>1)-0x40000000L;
-    return (*(((unsigned short *)(*ptr))++)>>1)-0x4000;
+    long ret;
+    if(*(*ptr)&1) {
+       ret = (*(((unsigned long *)(*ptr)))>>1)-0x40000000L;
+        ptr=((unsigned long *)*ptr)+1;
+    } else {
+        ret = (*(((unsigned short *)(*ptr)))>>1)-0x4000;
+        ptr=((unsigned short *)*ptr)+1;
+    }
+    return ret;
 }
 
 /* locates internal file FileName or internal directory if FileName is NULL
diff -urN ../tmp-orig/helpdeco-2.1.1/helpdeco.c ./helpdeco.c
--- ../tmp-orig/helpdeco-2.1.1/helpdeco.c       2005-05-19 14:11:38.000000000 
+0200
+++ ./helpdeco.c        2005-06-20 08:02:44.000000000 +0200
@@ -4424,7 +4424,8 @@
                }
                printf("%02x %d id=%04x ",*(unsigned char *)ptr,*(unsigned char 
*)(ptr+1)-0x80,*(unsigned short *)(ptr+2));
                ptr+=4;
-               x2=*((unsigned short *)ptr)++;
+               x2=*((unsigned short *)ptr);
+               ptr=((unsigned short *)ptr)+1;
                if(x2&0x0001) printf("unknownbit01=%ld ",scanlong(&ptr)); /* 
found in MVBs, purpose unknown, may mean that x2 is compressed long */
                if(x2&0x0002) printf("topspacing=%d ",scanint(&ptr));
                if(x2&0x0004) printf("bottomspacing=%d ",scanint(&ptr));
@@ -4444,7 +4445,8 @@
                    if(x1&0x20) fputs("thickborder ",stdout);
                    if(x1&0x40) fputs("doubleborder ",stdout);
                    if(x1&0x80) fputs("unknownborder",stdout);
-                   printf("%04x ",*((unsigned short *)ptr)++);
+                   printf("%04x ",*((unsigned short *)ptr));
+                   ptr=(unsigned short*)ptr+1;
                }
                if(x2&0x0200)
                {


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to