On 8/29/07, Uwe Hermann uwe@hermann-uwe.de wrote:
On Wed, Aug 29, 2007 at 09:20:05AM -0700, ron minnich wrote:
Signed-off-by: Ronald G. Minnich rminnich@gmail.com===================================================================
What's up with that "============" line?
my mistake.
--- lib/lar.c (revision 480) +++ lib/lar.c (working copy) @@ -31,6 +31,13 @@ #define ntohl(x) (x) #endif
+int run_address(void *f) +{
int (*v) (void);
v = f;
return v();
+}
Add a doxygen comment please.
done. Please note that I did not write this stuff, there were never comments in there :-)
int find_file(struct mem_file *archive, char *filename, struct mem_file *result)
Same here.
done.
filename can be 'const char *filename' I guess.
done. The next patch will include a patch to lar.h for this change.
result->entry = (void *)ntohl(header->entry);
result->loadaddress = (void *)ntohl(header->loadaddress);
Just curious, is the cast to (void *) really needed?
yes. ntohl is a long. To get to void * you need the cast.
+void *load_file(struct mem_file *archive, char *filename)
Add doxygen comment, please.
done
return (void *)-1;
Uh? What is '(void *)-1' supposed to be? Will that work? Is the cast needed?
(void *)-1 is a commonly used synonym for "bad address". It's the most portable way to indicate a bad address.
printk(BIOS_SPEW, "where is %p\n", where); v = where;
return v();
ret = v();
^^
Two spaces where only one should be.
fixed.
new patch attached.
ron