Re: [xpad-devel] Compiling xpad-2.12 fails if debugging enabled
Brought to you by:
mikix
From: Michael T. <mi...@mt...> - 2007-07-23 23:03:55
|
Thanks for the interest! I've commented below: On 7/23/07, Daniel Macks <dm...@ne...> wrote: > A pointer is declared as a GtkWidget but then handled as an > XpadPad. That latter type is a struct whose first element is a > GtkWindow. I guess the assuption here is that a GtkWindow is a > GtkWidget and a pointer to the struct is a pointer to its first > element? That's pretty fragile! I don't entirely understand gtk > coding, but if the pad is initialized as a pointer to just the > GtkWidget and then passed as the whole struct, don't Bad Things happen > when other struct elements get accessed (read/write beyond the > struct's memory region)? If the pad object is indeed the whole struct, > need to allocate the whole thing and then assign the GtkW* to its > appropriate element in that struct. Even if my paranoia is misplaced, > need some casting to clear the warning. The paranoia is understandable. I think just a base static cast is techinically valid here, but to clear the warning and as a safeguard, there should be a XPAD_PAD() cast. This is in CVS. > Lots of variables declared then not used for anything (maybe dead code > from old versions or plans for future code that hasn't been written > yet?), so probably safe to remove them. It appears that some of these > were reported on this mailing list and a patch provided over a year > ago (which was several months before the 2.12 release)... Fixed in CVS. > xpad-toolbar.c: In function `xpad_toolbar_init': > xpad-toolbar.c:216: warning: implicit declaration of function `gtk_toolbar_set_icon_size' > > That function's prototype in gtk/gtktoolbar.h is protected with > GTK_DISABLE_DEPRECATED and its documentation states: This warning is fixed in CVS, though the code does the same thing (I get around the warning by just using g_object_set). The reason we do this and ignore the user's preferences in this regard is because this toolbar is slightly different than most common app toolbars. It is designed to be as unobtrusive as possible. I could believe this is a misplaced effort, but it does have some intention behind it. Thanks! -mt |