bug-coreutils
[Top][All Lists]
Advanced

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

use 1000000 not 1000 for reducing plurals


From: Paul Eggert
Subject: use 1000000 not 1000 for reducing plurals
Date: Fri, 18 Aug 2006 11:13:43 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

After further discussion with Bruno I installed this into coreutils:

2006-08-18  Paul Eggert  <address@hidden>

        * src/system.h (select_plural): Reduce by 1000000, not 1000, since
        the CVS gettext manual now suggests 1000000.

Index: src/system.h
===================================================================
RCS file: /fetish/cu/src/system.h,v
retrieving revision 1.151
diff -p -u -r1.151 system.h
--- src/system.h        16 Aug 2006 19:36:46 -0000      1.151
+++ src/system.h        18 Aug 2006 18:12:12 -0000
@@ -388,7 +388,10 @@ static inline unsigned char to_uchar (ch
 static inline unsigned long int
 select_plural (uintmax_t n)
 {
-  return (n <= ULONG_MAX ? n : n % 1000 + 1000);
+  /* Reduce by a power of ten, but keep it away from zero.  The
+     gettext manual says 1000000 should be safe.  */
+  enum { PLURAL_REDUCER = 1000000 };
+  return (n <= ULONG_MAX ? n : n % PLURAL_REDUCER + PLURAL_REDUCER);
 }
 
 #define STREQ(a, b) (strcmp ((a), (b)) == 0)




reply via email to

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