diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2006-05-25 05:36:48 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2006-05-25 05:36:48 +0000 |
commit | d1e4e901e29d8ef27a6583648c7148b1a5b2facf (patch) | |
tree | fb34ead4006e43ac22aa6368c6a622320f234261 /intl/eval-plural.h | |
parent | 729598cb00d791bbdfe23ebe0023d3a1c3962f83 (diff) | |
download | tigervnc-d1e4e901e29d8ef27a6583648c7148b1a5b2facf.tar.gz tigervnc-d1e4e901e29d8ef27a6583648c7148b1a5b2facf.zip |
Migrating to new directory structure adopted from the RealVNC's source tree. Windows part should be complete. For the Unix part, more changes will follow.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@592 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'intl/eval-plural.h')
-rw-r--r-- | intl/eval-plural.h | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/intl/eval-plural.h b/intl/eval-plural.h deleted file mode 100644 index 01bd5af5..00000000 --- a/intl/eval-plural.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Plural expression evaluation. - Copyright (C) 2000-2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef STATIC -#define STATIC static -#endif - -/* Evaluate the plural expression and return an index value. */ -STATIC -unsigned long int -internal_function -plural_eval (struct expression *pexp, unsigned long int n) -{ - switch (pexp->nargs) - { - case 0: - switch (pexp->operation) - { - case var: - return n; - case num: - return pexp->val.num; - default: - break; - } - /* NOTREACHED */ - break; - case 1: - { - /* pexp->operation must be lnot. */ - 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); - if (pexp->operation == lor) - return leftarg || plural_eval (pexp->val.args[1], n); - else if (pexp->operation == land) - return leftarg && plural_eval (pexp->val.args[1], n); - else - { - unsigned long int rightarg = plural_eval (pexp->val.args[1], n); - - switch (pexp->operation) - { - case mult: - return leftarg * rightarg; - case divide: -#if !INTDIV0_RAISES_SIGFPE - if (rightarg == 0) - raise (SIGFPE); -#endif - return leftarg / rightarg; - case module: -#if !INTDIV0_RAISES_SIGFPE - if (rightarg == 0) - raise (SIGFPE); -#endif - return leftarg % rightarg; - case plus: - return leftarg + rightarg; - case minus: - return leftarg - rightarg; - case less_than: - return leftarg < rightarg; - case greater_than: - return leftarg > rightarg; - case less_or_equal: - return leftarg <= rightarg; - case greater_or_equal: - return leftarg >= rightarg; - case equal: - return leftarg == rightarg; - case not_equal: - return leftarg != rightarg; - default: - break; - } - } - /* NOTREACHED */ - break; - } - 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); - } - } - /* NOTREACHED */ - return 0; -} |