summaryrefslogtreecommitdiffstats
path: root/intl/plural-eval.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-11-29 13:19:59 +0000
committerBruno Haible <bruno@clisp.org>2009-06-21 23:28:33 +0200
commit1b511b028349c7b8fd35f2ade6cdeec326f1cbc2 (patch)
tree9930c6f128710ea9586b374c0963b4767c7de223 /intl/plural-eval.c
parent46e510e8532ef3f902244838ea50e4ef7621cf10 (diff)
downloadexternal_gettext-1b511b028349c7b8fd35f2ade6cdeec326f1cbc2.zip
external_gettext-1b511b028349c7b8fd35f2ade6cdeec326f1cbc2.tar.gz
external_gettext-1b511b028349c7b8fd35f2ade6cdeec326f1cbc2.tar.bz2
Merge with glibc: make plural_eval a static function inside glibc and libintl.
Diffstat (limited to 'intl/plural-eval.c')
-rw-r--r--intl/plural-eval.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/intl/plural-eval.c b/intl/plural-eval.c
index e35a6fa..12d2326 100644
--- a/intl/plural-eval.c
+++ b/intl/plural-eval.c
@@ -15,15 +15,19 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
+#ifndef STATIC
+#define STATIC static
#endif
-#include "plural-exp.h"
+/* Evaluate the plural expression and return an index value. */
+STATIC unsigned long int plural_eval PARAMS ((struct expression *pexp,
+ unsigned long int n))
+ internal_function;
+STATIC
unsigned long int
internal_function
-PLURAL_EVAL (pexp, n)
+plural_eval (pexp, n)
struct expression *pexp;
unsigned long int n;
{
@@ -44,19 +48,19 @@ PLURAL_EVAL (pexp, n)
case 1:
{
/* pexp->operation must be lnot. */
- unsigned long int arg = PLURAL_EVAL (pexp->val.args[0], n);
+ unsigned long int arg = plural_eval (pexp->val.args[0], n);
return ! arg;
}
case 2:
{
- unsigned long int leftarg = PLURAL_EVAL (pexp->val.args[0], n);
+ unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
if (pexp->operation == lor)
- return leftarg || PLURAL_EVAL (pexp->val.args[1], n);
+ return leftarg || plural_eval (pexp->val.args[1], n);
else if (pexp->operation == land)
- return leftarg && PLURAL_EVAL (pexp->val.args[1], n);
+ return leftarg && plural_eval (pexp->val.args[1], n);
else
{
- unsigned long int rightarg = PLURAL_EVAL (pexp->val.args[1], n);
+ unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
switch (pexp->operation)
{
@@ -92,8 +96,8 @@ PLURAL_EVAL (pexp, n)
case 3:
{
/* pexp->operation must be qmop. */
- unsigned long int boolarg = PLURAL_EVAL (pexp->val.args[0], n);
- return PLURAL_EVAL (pexp->val.args[boolarg ? 1 : 2], n);
+ unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
+ return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
}
}
/* NOTREACHED */