Fix improper use of function sentinel

This patch addresses this warning of gcc:

wfontpanel.c: In function 'listFamilies':
wfontpanel.c:588: warning: missing sentinel in function call

Fix it by using the 'NULL' pointer instead of 0 (zero) as the
sentinel.

For more information, see
http://www.linuxonly.nl/docs/2/2_GCC_4_warnings_about_sentinels.html
in particular,

   "On most systems, there is no difference between 0 and (char *)0.
    On 64 bit systems, however, the integer 0 is 32 bits and the
    pointer 0 is 64 bits. The compiler does not know whether it is
    an integer or a pointer, and defaults for the integer. This will
    not clear the upper 32 bits and the function will not stop
    scanning its parameters."

Note that here in my 64-bit Mandriva I don't need to cast (char *)NULL.
---
 WINGs/wfontpanel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c
index 537e54d..c03a779 100644
--- a/WINGs/wfontpanel.c
+++ b/WINGs/wfontpanel.c
@@ -585,7 +585,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
     int i;
 
     pat = FcPatternCreate();
-    os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, 0);
+    os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
     fs = FcFontList(0, pat, os);
     if (!fs) {
         WMRunAlertPanel(scr, panel->win, _("Error"),
-- 
1.6.4.rc1.13.gec7b


-- 
To unsubscribe, send mail to [email protected].

Reply via email to