bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Don't cast to int, but to long


From: Andreas Schwab
Subject: Re: [PATCH] Don't cast to int, but to long
Date: Mon, 04 Apr 2005 22:48:14 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

Mads Martin Joergensen <address@hidden> writes:

> Hey gettext people,
>
> Casting pointers to int is a bad idea on many 64-bit systems since int
> is 32-bit. Here's a patch (agian 0.14.3) to correct this.

Even better, just remove these broken casts.

--- gettext-runtime/m4/gettext.m4
+++ gettext-runtime/m4/gettext.m4
@@ -139,7 +139,7 @@
 ], [])[extern int _nl_msg_cat_cntr;
 extern int *_nl_domain_bindings;],
             [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext 
("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
+return (gettext ("") != 0)]ifelse([$2], [need-ngettext], [ + (ngettext ("", 
"", 0) != 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
             gt_cv_func_gnugettext_libc=yes,
             gt_cv_func_gnugettext_libc=no)])
 
@@ -175,7 +175,7 @@
 #endif
 const char *_nl_expand_alias (const char *);],
               [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext 
("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+return (gettext ("") != 0)]ifelse([$2], [need-ngettext], [ + (ngettext ("", 
"", 0) != 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
               gt_cv_func_gnugettext_libintl=yes,
               gt_cv_func_gnugettext_libintl=no)
             dnl Now see whether libintl exists and depends on libiconv.
@@ -196,7 +196,7 @@
 #endif
 const char *_nl_expand_alias (const char *);],
                 [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext 
("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+return (gettext ("") != 0)]ifelse([$2], [need-ngettext], [ + (ngettext ("", 
"", 0) != 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
                [LIBINTL="$LIBINTL $LIBICONV"
                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
                 gt_cv_func_gnugettext_libintl=yes

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]