Need some help with a patch for version.dll
Hi, I've finally nailed the last (?) bugs in version.dll. The attached patch shows how. There is however a warning during compile and I have no clue (still learning C :-) ) how to fix that: info.c: In function `VerQueryValueA': info.c:754: warning: pointer of type `void *' used in arithmetic info.c:754: warning: pointer of type `void *' used in arithmetic info.c: In function `VerQueryValueW': info.c:817: warning: pointer of type `void *' used in subtraction info.c:817: warning: pointer of type `void *' used in arithmetic Any idea's ? Cheers, Paul.
Am Donnerstag, 25. August 2005 13:45 schrieb Paul Vriens:
Hi,
I've finally nailed the last (?) bugs in version.dll. The attached patch shows how. There is however a warning during compile and I have no clue (still learning C :-) ) how to fix that:
info.c: In function `VerQueryValueA': info.c:754: warning: pointer of type `void *' used in arithmetic info.c:754: warning: pointer of type `void *' used in arithmetic info.c: In function `VerQueryValueW': info.c:817: warning: pointer of type `void *' used in subtraction info.c:817: warning: pointer of type `void *' used in arithmetic
Any idea's ? Get a good C book and read about Pointer arithmetics ;-)
I haven't applied the patch and looked at the existing code, but from the warnings I can tell that you're doing arithmetic with a pointer which has no type( "void *" ). Assumed, you have a char *Pc and a int *Pi both point to 0x10. If you do "Pc++" and "Pi++" then sizeof(char) and sizeof(int) are added to the pointers, so Pc will point to 0x11 and Pi to 0x14. But what to do with a void * ? sizeof(void) = ???? So you have to give the pointers the compiler complains about a type, most likely you want a char *. Hope I helped, Stefan
participants (2)
-
Paul Vriens -
Stefan Dösinger