diff options
Diffstat (limited to 'sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch')
-rw-r--r-- | sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch b/sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch deleted file mode 100644 index 438b39b0e772..000000000000 --- a/sci-calculators/pcalc/files/pcalc-1.0.0-operator-updates.patch +++ /dev/null @@ -1,106 +0,0 @@ -Change operator order so that binary 'or' and binary 'and' are -not on the same level, but so that 'and' comes before 'or'. -This is to match the standard C precedence. - -Also add support for the % (modulus), < (binary left shift), -and > (binary right shift) operators. - -Patch by Mike Frysinger <vapier@gentoo.org> - ---- pcalc-000/README -+++ pcalc-000/README -@@ -60,10 +60,12 @@ - Operator priorities: - -- LOW '=' assignment -- or and binary or/binary and -- '+' '-' addition/subtruction -- '*' '/' multiply/divide -- '-' unary minus -- HIGH '^' exponentation -+ LOW '=' assignment -+ or binary or -+ and binary and -+ '>' '<' binary left/right shift -+ '+' '-' addition/subtruction -+ '*' '/' '%' multiply/divide/modulus -+ '-' unary minus -+ HIGH '^' exponentation - - Syntax: ---- pcalc-000/help.c -+++ pcalc-000/help.c -@@ -40,5 +40,5 @@ - \n\ - Operators:\n\ -- '+' '-' '*' '/' '^'\n\ -+ '+' '-' '*' '/' '%' '^'\n\ - \n\ - Constants: (case sensitive)\n\ -@@ -81,10 +81,12 @@ - Operator priorities:\n\ - \n\ -- right assotiation: '=' ASSIGNMENT\n\ -- left assotiation: or and BINARY OR/BINARY AND\n\ -- left assotiation: '+' '-' ADDITION/SUBTRUCTION\n\ -- left assotiation: '*' '/' MULTIPLY/DIVIDE\n\ -- left assotiation: '-' UNARY MINUS\n\ -- right assotiation: '^' EXPONENTATION\n\ -+ right assotiation: '=' ASSIGNMENT\n\ -+ left assotiation: or BINARY OR\n\ -+ left assotiation: and BINARY AND\n\ -+ left assotiation: '<' '>' BINARY LEFT/RIGHT SHIFT\n\ -+ left assotiation: '+' '-' ADDITION/SUBTRUCTION\n\ -+ left assotiation: '*' '/' '%' MULTIPLY/DIVIDE\n\ -+ left assotiation: '-' UNARY MINUS\n\ -+ right assotiation: '^' EXPONENTATION\n\ - \n\ - "); ---- pcalc-000/pcalc.txt -+++ pcalc-000/pcalc.txt -@@ -59,10 +59,12 @@ - Operator priorities:
-
-- LOW '=' assignment
-- or and binary or/binary and
-- '+' '-' addition/subtruction
-- '*' '/' multiply/divide
-- '-' unary minus
-- HIGH '^' exponentation
-+ LOW '=' assignment
-+ or binary or
-+ and binary and
-+ '<' '>' binary left/right shift
-+ '+' '-' addition/subtruction
-+ '*' '/' '%' multiply/divide/modulus
-+ '-' unary minus
-+ HIGH '^' exponentation
-
- Syntax:
---- pcalc-000/pcalc.y -+++ pcalc-000/pcalc.y -@@ -59,7 +59,9 @@ - - %right '=' --%left '|' '&' -+%left '|' -+%left '&' -+%left '<' '>' - %left '+' '-' --%left '*' '/' -+%left '*' '/' '%' - %left UNARYMINUS - %right '^' /* exponentiation */ -@@ -113,4 +113,6 @@ - | expr '|' expr { $$ = (long)$1 | (long)$3 ;} - | expr '&' expr { $$ = (long)$1 & (long)$3 ;} -+ | expr '<' expr { $$ = (long)$1 << (long)$3 ; } -+ | expr '>' expr { $$ = (long)$1 >> (long)$3 ; } - | expr '+' expr { $$ = $1 + $3 ; } - | expr '-' expr { $$ = $1 - $3 ; } -@@ -119,4 +120,5 @@ - $$ = $1 / $3 ; - } -+ | expr '%' expr { $$ = (long)$1 % (long)$3 ; } - | expr '^' expr { $$ = Pow( $1, $3) ; } - | '(' expr ')' { $$ = $2 ; } |