diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-02 16:30:24 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-02 16:30:24 +0100 |
commit | ae6c44ea15f4b73e8e5532f6392d1e6ce8c087e7 (patch) | |
tree | 518b6679bef48bc384ea8c2db71f44bac86b1f25 /miscutils/bc.c | |
parent | cb7c955aeb593abdde67fd919864185be2eb335d (diff) | |
download | busybox-w32-ae6c44ea15f4b73e8e5532f6392d1e6ce8c087e7.tar.gz busybox-w32-ae6c44ea15f4b73e8e5532f6392d1e6ce8c087e7.tar.bz2 busybox-w32-ae6c44ea15f4b73e8e5532f6392d1e6ce8c087e7.zip |
bc: make error line number also size_t, like everything else
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r-- | miscutils/bc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index bb91216c2..e5726ca40 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c | |||
@@ -753,7 +753,7 @@ struct globals { | |||
753 | 753 | ||
754 | // For error messages. Can be set to current parsed line, | 754 | // For error messages. Can be set to current parsed line, |
755 | // or [TODO] to current executing line (can be before last parsed one) | 755 | // or [TODO] to current executing line (can be before last parsed one) |
756 | unsigned err_line; | 756 | size_t err_line; |
757 | 757 | ||
758 | BcVec input_buffer; | 758 | BcVec input_buffer; |
759 | 759 | ||
@@ -916,7 +916,9 @@ static void bc_verror_msg(const char *fmt, va_list p) | |||
916 | const char *sv = sv; // for compiler | 916 | const char *sv = sv; // for compiler |
917 | if (G.prs.lex_filename) { | 917 | if (G.prs.lex_filename) { |
918 | sv = applet_name; | 918 | sv = applet_name; |
919 | applet_name = xasprintf("%s: %s:%u", applet_name, G.prs.lex_filename, G.err_line); | 919 | applet_name = xasprintf("%s: %s:%lu", applet_name, |
920 | G.prs.lex_filename, (unsigned long)G.err_line | ||
921 | ); | ||
920 | } | 922 | } |
921 | bb_verror_msg(fmt, p, NULL); | 923 | bb_verror_msg(fmt, p, NULL); |
922 | if (G.prs.lex_filename) { | 924 | if (G.prs.lex_filename) { |
@@ -3532,7 +3534,8 @@ static void xc_parse_pushIndex(size_t idx) | |||
3532 | 3534 | ||
3533 | dbg_lex("%s:%d pushing index %zd", __func__, __LINE__, idx); | 3535 | dbg_lex("%s:%d pushing index %zd", __func__, __LINE__, idx); |
3534 | if (idx < SMALL_INDEX_LIMIT) { | 3536 | if (idx < SMALL_INDEX_LIMIT) { |
3535 | goto push_idx; | 3537 | xc_parse_push(idx); |
3538 | return; | ||
3536 | } | 3539 | } |
3537 | 3540 | ||
3538 | mask = ((size_t)0xff) << (sizeof(idx) * 8 - 8); | 3541 | mask = ((size_t)0xff) << (sizeof(idx) * 8 - 8); |
@@ -3546,11 +3549,10 @@ static void xc_parse_pushIndex(size_t idx) | |||
3546 | 3549 | ||
3547 | xc_parse_push((SMALL_INDEX_LIMIT - 1) + amt); | 3550 | xc_parse_push((SMALL_INDEX_LIMIT - 1) + amt); |
3548 | 3551 | ||
3549 | while (idx != 0) { | 3552 | do { |
3550 | push_idx: | ||
3551 | xc_parse_push((unsigned char)idx); | 3553 | xc_parse_push((unsigned char)idx); |
3552 | idx >>= 8; | 3554 | idx >>= 8; |
3553 | } | 3555 | } while (idx != 0); |
3554 | } | 3556 | } |
3555 | 3557 | ||
3556 | #if ENABLE_BC | 3558 | #if ENABLE_BC |