Commit Graph

11 Commits

Author SHA1 Message Date
Denys Vlasenko
1961aea305 move endofname() to libbb
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-26 00:36:53 +01:00
Denys Vlasenko
bed7c81ea2 shell/math: deconvolute and explain ?: handling. Give better error message
function                                             old     new   delta
arith_apply                                         1271    1283     +12

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-16 11:50:46 +02:00
Denys Vlasenko
063847d6bd shell/math: return string error indicator, not integer
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>
2010-09-15 13:33:02 +02:00
Denys Vlasenko
0eac8ff164 shell/math.c: stop using bss variable
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>
2010-09-13 12:49:52 +02:00
Denys Vlasenko
06d44d7dfb shell/math.c: rename arith_eval_hooks to arith_state, put error code into it
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>
2010-09-13 12:49:03 +02:00
Denys Vlasenko
8b2f13d84d shell: unify endofname() in hush and ash
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>
2010-09-07 12:19:33 +02:00
Denys Vlasenko
03dad22f8a hush: use ash's read builtin
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>
2010-01-12 23:29:57 +01:00
Denys Vlasenko
71016baf55 printf: accept negative numbers for %x; sh: overflowed numbers are 0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-05 16:24:29 +02:00
Denis Vlasenko
f81e8dbc74 *: make "pragma GCC visibility push(hidden)" less ugly 2009-04-09 12:35:13 +00:00
Denis Vlasenko
cc8289dc04 shell/math: randomconfig fix 2009-04-03 21:13:31 +00:00
Mike Frysinger
98c52645c0 split math code out of ash and into a standalone library so we can use it in any shell (like hush!) 2009-04-02 10:02:37 +00:00