diff options
author | Jan Beulich <jbeulich@suse.com> | 2024-03-28 11:54:48 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2024-03-28 11:54:48 +0100 |
commit | 1c6310c97b04bc79637fed66d2cbc61ee5888e31 (patch) | |
tree | b6009e07d045208ea0108834c49a4826b3d28256 /gas | |
parent | 09be89098e3a85785429130030842d4ab11e57e5 (diff) | |
download | binutils-1c6310c97b04bc79637fed66d2cbc61ee5888e31.zip binutils-1c6310c97b04bc79637fed66d2cbc61ee5888e31.tar.gz binutils-1c6310c97b04bc79637fed66d2cbc61ee5888e31.tar.bz2 |
gas: drop integer_constant()'s maxdig
Once properly set, it's only ever holding the same value as "radix".
Even if there was some plan with it, that plan hasn't made it anywhere
in over 20 years.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/expr.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -279,7 +279,6 @@ integer_constant (int radix, expressionS *expressionP) char c; valueT number; /* Offset or (absolute) value. */ short int digit; /* Value of next digit in current radix. */ - short int maxdig = 0; /* Highest permitted digit value. */ int too_many_digits = 0; /* If we see >= this number of. */ char *name; /* Points to name of symbol. */ symbolS *symbolP; /* Points to symbol. */ @@ -365,26 +364,23 @@ integer_constant (int radix, expressionS *expressionP) switch (radix) { case 2: - maxdig = 2; too_many_digits = valuesize + 1; break; case 8: - maxdig = radix = 8; too_many_digits = (valuesize + 2) / 3 + 1; break; case 16: - maxdig = radix = 16; too_many_digits = (valuesize + 3) / 4 + 1; break; case 10: - maxdig = radix = 10; too_many_digits = (valuesize + 11) / 4; /* Very rough. */ + break; } #undef valuesize start = input_line_pointer; c = *input_line_pointer++; for (number = 0; - (digit = hex_value (c)) < maxdig; + (digit = hex_value (c)) < radix; c = *input_line_pointer++) { number = number * radix + digit; @@ -411,7 +407,7 @@ integer_constant (int radix, expressionS *expressionP) int ndigit = 0; number = 0; for (c = *input_line_pointer++; - (digit = hex_value (c)) < maxdig; + (digit = hex_value (c)) < radix; c = *(input_line_pointer++)) { number = number * radix + digit; @@ -487,7 +483,7 @@ integer_constant (int radix, expressionS *expressionP) generic_bignum[3] = 0; input_line_pointer = start; /* -> 1st digit. */ c = *input_line_pointer++; - for (; (carry = hex_value (c)) < maxdig; c = *input_line_pointer++) + for (; (carry = hex_value (c)) < radix; c = *input_line_pointer++) { for (pointer = generic_bignum; pointer <= leader; pointer++) { |