diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-05-26 20:17:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-05-26 20:17:04 +0200 |
commit | 6d9427420bab4ef756444fc8800dbf56d7dacf7d (patch) | |
tree | 29e4cd2a8812999000a5b324daf308adee83ce25 /coreutils/od.c | |
parent | 5dcc443dba039b305a510c01883e9f34e42656ae (diff) | |
download | busybox-w32-6d9427420bab4ef756444fc8800dbf56d7dacf7d.tar.gz busybox-w32-6d9427420bab4ef756444fc8800dbf56d7dacf7d.tar.bz2 busybox-w32-6d9427420bab4ef756444fc8800dbf56d7dacf7d.zip |
od: -l,I,L indeed depend on sizeof(long), fix this
function old new delta
.rodata 105255 105252 -3
od_main 1917 1901 -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-19) Total: -19 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/od.c')
-rw-r--r-- | coreutils/od.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/coreutils/od.c b/coreutils/od.c index 3684e4ed3..a7b1ba444 100644 --- a/coreutils/od.c +++ b/coreutils/od.c | |||
@@ -170,12 +170,17 @@ static const char *const add_strings[] ALIGN_PTR = { | |||
170 | "4/4 \" %15.7e\"" "\"\n\"", /* 7: f */ | 170 | "4/4 \" %15.7e\"" "\"\n\"", /* 7: f */ |
171 | "4/4 \" %08x\"" "\"\n\"", /* 8: H, X */ | 171 | "4/4 \" %08x\"" "\"\n\"", /* 8: H, X */ |
172 | "8/2 \" %04x\"" "\"\n\"", /* 9: h, x */ | 172 | "8/2 \" %04x\"" "\"\n\"", /* 9: h, x */ |
173 | /* This probably also depends on word width of the arch (what is "long"?) */ | 173 | "4/4 \" %11d\"" "\"\n\"", /* 10: i */ |
174 | /* should be "2/8" or "4/4" depending on sizeof(long)? */ | 174 | "4/4 \" %011o\"" "\"\n\"", /* 11: O */ |
175 | "2/8 \" %20lld\"" "\"\n\"", /* 10: I, L, l */ | 175 | "8/2 \" %6d\"" "\"\n\"", /* 12: s */ |
176 | "4/4 \" %11d\"" "\"\n\"", /* 11: i */ | 176 | /* -I,L,l: depend on word width of the arch (what is "long"?) */ |
177 | "4/4 \" %011o\"" "\"\n\"", /* 12: O */ | 177 | #if ULONG_MAX > 0xffffffff |
178 | "8/2 \" %6d\"" "\"\n\"", /* 13: s */ | 178 | "2/8 \" %20lld\"" "\"\n\"", /* 13: I, L, l */ |
179 | #define L_ 13 | ||
180 | #else | ||
181 | /* 32-bit arch: -I,L,l are the same as -i */ | ||
182 | #define L_ 10 | ||
183 | #endif | ||
179 | }; | 184 | }; |
180 | 185 | ||
181 | static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxsv"; | 186 | static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxsv"; |
@@ -183,8 +188,8 @@ static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxsv"; | |||
183 | static const char od_o2si[] ALIGN1 = { | 188 | static const char od_o2si[] ALIGN1 = { |
184 | 0, 1, 2, 3, 5, /* aBbcD */ | 189 | 0, 1, 2, 3, 5, /* aBbcD */ |
185 | 4, 6, 6, 7, 8, /* deFfH */ | 190 | 4, 6, 6, 7, 8, /* deFfH */ |
186 | 9, 10, 11, 10, 10, /* hIiLl */ | 191 | 9, L_, 10, L_, L_, /* hIiLl */ |
187 | 12, 1, 8, 9, 13 /* OoXxs */ | 192 | 11, 1, 8, 9, 12 /* OoXxs */ |
188 | }; | 193 | }; |
189 | 194 | ||
190 | int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 195 | int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |