summaryrefslogtreecommitdiff
path: root/shell/math.h
Commit message (Collapse)AuthorAgeFilesLines
* Make it possible to select "sh" and "bash" aliases without selecting ash or hushDenys Vlasenko2016-12-231-1/+1
| | | | | | | The same can be done for msh, but we are probably better off just deleting it in a next versio or two. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move endofname() to libbbDenys Vlasenko2013-02-261-5/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell/math: deconvolute and explain ?: handling. Give better error messageDenys Vlasenko2010-09-161-16/+4
| | | | | | | function old new delta arith_apply 1271 1283 +12 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math: return string error indicator, not integerDenys Vlasenko2010-09-151-1/+1
| | | | | | | | | | | | | | | | function old new delta expand_and_evaluate_arith 87 106 +19 expand_one_var 1563 1570 +7 arith 12 18 +6 evaluate_string 678 680 +2 arith_apply 1269 1271 +2 builtin_umask 133 132 -1 ash_arith 118 75 -43 expand_vars_to_list 1094 1038 -56 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/3 up/down: 36/-100) Total: -64 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math.c: stop using bss variableDenys Vlasenko2010-09-131-2/+3
| | | | | | | | | | | | | | | | function old new delta evaluate_string - 678 +678 expand_one_var 1543 1563 +20 builtin_type 114 116 +2 expand_and_evaluate_arith 89 87 -2 prev_chk_var_recursive 4 - -4 ash_arith 122 118 -4 arith_lookup_val 142 132 -10 arith 674 12 -662 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/4 up/down: 700/-682) Total: 18 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math.c: rename arith_eval_hooks to arith_state, put error code into itDenys Vlasenko2010-09-131-46/+45
| | | | | | | | | | | | | function old new delta expand_and_evaluate_arith 79 89 +10 arith 675 674 -1 arith_lookup_val 151 142 -9 ash_arith 135 122 -13 arith_apply 1304 1269 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 10/-58) Total: -48 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell: unify endofname() in hush and ashDenys Vlasenko2010-09-071-2/+7
| | | | | | | | | | | | | function old new delta builtin_umask 132 133 +1 changepath 195 194 -1 expand_and_evaluate_arith 77 69 -8 ash_arith 143 135 -8 expand_one_var 1551 1515 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 1/-53) Total: -52 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: use ash's read builtinDenys Vlasenko2010-01-121-5/+6
| | | | | | | | | | | | | | | | | function old new delta shell_builtin_read - 1000 +1000 set_local_var_from_halves - 24 +24 setvar2 - 7 +7 ... popstring 140 134 -6 ash_main 1375 1368 -7 setvar 184 174 -10 arith_set_local_var 36 - -36 builtin_read 1096 185 -911 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 5/23 up/down: 1038/-1007) Total: 31 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* printf: accept negative numbers for %x; sh: overflowed numbers are 0Denys Vlasenko2009-06-051-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make "pragma GCC visibility push(hidden)" less uglyDenis Vlasenko2009-04-091-2/+6
|
* shell/math: randomconfig fixDenis Vlasenko2009-04-031-3/+1
|
* split math code out of ash and into a standalone library so we can use it in ↵Mike Frysinger2009-04-021-0/+101
any shell (like hush!)