Hi Justus, On Wed, Apr 23, 2008 at 11:53:24PM +0200, Justus Winter wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hey@all :)
I ran into some issues compiling dillo. I solved / worked around them, patches are attached. Here are my findings and my interpretations (let me know in case I am way off somewhere):
dw2 === gcc-4.2 on linux/x86_64 complained about two casts in lout/object.cc:
object.cc:118: error: cast from ?void*? to ?int? loses precision
I felt it was nonsense to check the size of void* at runtime and used the preprocessor to choose which instruction to use based on the value of SIZEOF_VOID_P.
I think the idea is that the compiler will optimize out unnecessary branches. And indeed the assembly code looks like this here: .globl _ZN6object7Pointer9hashValueEv .type _ZN6object7Pointer9hashValueEv, @function _ZN6object7Pointer9hashValueEv: .LFB70: .loc 1 115 0 .LVL1: pushl %ebp .LCFI2: movl %esp, %ebp .LCFI3: .loc 1 115 0 movl 8(%ebp), %eax movl 4(%eax), %eax .loc 1 126 0 leave ret .LFE70: .size _ZN6object7Pointer9hashValueEv, .-_ZN6object7Pointer9hashValueEv So, as far as I can see it really works. Cheers, Johannes
dillo2 ====== There was another complaint by gcc:
dialog.cc:249: error: cast from ?void*? to ?int? loses precision
A parameter of type void* for a callback is used to carry a small integer (most likely the number of the button pressed or something). I solved this one by first casting to long and then to int. I saw this somewhere on the net, don't know if this is too hacky.
dillo2/dpi ========== downloads.cc failed to compile since gcc couldn't find the fltk includes (I chose not to install them to /usr/local/lib), so I poked around in dpi/Makefile.am and managed to include LIBFLTK_CXXFLAGS into cxxflags (/me is an automake n00b).
With my three patches applied dillo compiles and runs fine, however I had to create ~/.dillo and manually start dpid. Did I miss something here?
Cheers, Justus - -- gpg key fingerprint: C82D 382A AB38 1A54 5290 19D6 A0F9 B035 686C 6996 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFID6/ToPmwNWhsaZYRApgwAJsENlC0vsniya14RBTU8yrXVVjVyACff2HD GLM/iKxXf3UjBA6+GFOSE78= =JuDE -----END PGP SIGNATURE-----
diff -pru dw2/lout/object.cc dw2-cur/lout/object.cc --- dw2/lout/object.cc 2007-10-26 14:17:43.000000000 +0200 +++ dw2-cur/lout/object.cc 2008-04-23 23:13:31.000000000 +0200 @@ -114,28 +114,21 @@ bool Pointer::equals(Object *other)
int Pointer::hashValue() { - if(sizeof (int) == sizeof (void*)) - return (int)value; - else if (2 * sizeof (int) == sizeof (void*)) - return ((int*)value)[0] ^ ((int*)value)[1]; - else { - // unhandled case - misc::assertNotReached (); - return 0; - } +#if SIZEOF_VOID_P == 4 + return (int)value; +#else + return ((int*)value)[0] ^ ((int*)value)[1]; +#endif }
void Pointer::intoStringBuffer(misc::StringBuffer *sb) { char buf[64]; - if(sizeof (int) == sizeof (void*)) - sprintf(buf, "0x%x", (int)value); - else if (sizeof (long) == sizeof (void*)) - sprintf(buf, "0x%lx", (long)value); - else { - // unhandled case - misc::assertNotReached (); - } +#if SIZEOF_VOID_P == 4 + sprintf(buf, "0x%x", (int)value); +#else + sprintf(buf, "0x%lx", (long)value); +#endif sb->append(buf); }
diff -pru dillo2/src/dialog.cc dillo2-cur/src/dialog.cc --- dillo2/src/dialog.cc 2008-04-11 14:51:24.000000000 +0200 +++ dillo2-cur/src/dialog.cc 2008-04-23 22:38:50.000000000 +0200 @@ -246,7 +246,7 @@ static int choice5_answer;
void choice5_cb(Widget *button, void *number) { - choice5_answer = (int)number; + choice5_answer = (int)(long)number; _MSG("choice5_cb: %d\n", choice5_answer); button->window()->make_exec_return(true); }
diff -pru dillo2/dpi/Makefile.am dillo2-cur/dpi/Makefile.am --- dillo2/dpi/Makefile.am 2007-10-07 00:36:34.000000000 +0200 +++ dillo2-cur/dpi/Makefile.am 2008-04-23 22:53:32.000000000 +0200 @@ -1,3 +1,5 @@ +AM_CXXFLAGS = @LIBFLTK_CXXFLAGS@ + bookmarksdir = $(libdir)/dillo/dpi/bookmarks downloadsdir = $(libdir)/dillo/dpi/downloads ftpdir = $(libdir)/dillo/dpi/ftp
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev