I just wrote a simple python script to fix all the compiler warnings
caused by missing GObject type-casting.
It's in git repo of devtools. Get it here:
http://lxde.git.sourceforge.net/git/gitweb.cgi?p=lxde/devtools;a=blob;f=fix-gtk-type-casting.py;h=ca4abba84abeb2589e8a4737595dbf375f7ba2ba;hb=HEAD

Let's use lxpanel as an example:
> cd lxpanel
> make > log.txt 2>&1
now the build log should be in log.txt.
> ./fix-gtk-type-casting.py log.txt ./src
done! All missing type-casting are added automatically.
> make clean all
See if the fixed code work.

Gtk+ uses C to emulate object oriented programming, but there is no
subclass in C, so when you use a pointer and want to do dynamic
casting between different classes, gtk+ uses its own RTTI mechanism.
To convert a GtkWidget* to GtkWindow*, you need the macro
GTK_WINDOW(). Otherwise there will be compiler warnings complaining of
incompatible pointer types.

This script automatically fixes all of this kind of missing type-casting macros.
So LXDE developers, feel free to try it and to see if it work for you.
This should eliminate most of the warnings in LXDE components.

However, after adding all those macros, things will slow down since
this enables runtime type-casting, which is only needed on debug.
Luckily there is an glib compiler flag to turn runtime check off. So
we can only enable this for debug build.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list

Reply via email to