← Commit list

f868963c6

Denis Vlasenko
Denis Vlasenko
2007-07-27
FAILED Duration: 13s

Subject

multiplier suffixes are short, store them directly in struct suffix_mult

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/dd.c+1 -1
@@ -25,7 +25,7 @@ static const struct suffix_mult dd_suffixes[] = {
{ "M", 1048576 },
{ "GD", 1000000000 },
{ "G", 1073741824 },
- { NULL, 0 }
+ { }
};
struct globals {
coreutils/head.c+1 -1
@@ -25,7 +25,7 @@ static const struct suffix_mult head_suffixes[] = {
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { NULL, 0 }
+ { }
};
#endif
coreutils/od_bloaty.c+2 -2
@@ -981,7 +981,7 @@ parse_old_offset(const char *s, off_t *offset)
static const struct suffix_mult Bb[] = {
{ "B", 1024 },
{ "b", 512 },
- { NULL, 0 }
+ { }
};
char *p;
int radix;
@@ -1204,7 +1204,7 @@ int od_main(int argc, char **argv)
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { NULL, 0 }
+ { }
};
unsigned opt;
int l_c_m;
coreutils/sleep.c+1 -1
@@ -29,7 +29,7 @@ static const struct suffix_mult sfx[] = {
{ "m", 60 },
{ "h", 60*60 },
{ "d", 24*60*60 },
- { NULL, 0 }
+ { }
};
#endif
coreutils/split.c+1 -1
@@ -20,7 +20,7 @@ static const struct suffix_mult split_suffices[] = {
#if ENABLE_FEATURE_SPLIT_FANCY
{ "g", 1024*1024*1024 },
#endif
- { NULL, 0 }
+ { }
};
/* Increment the suffix part of the filename.
coreutils/stty.c+4 -4
@@ -524,10 +524,10 @@ static void display_window_size(const int fancy)
}
static const struct suffix_mult stty_suffixes[] = {
- {"b", 512 },
- {"k", 1024},
- {"B", 1024},
- {NULL, 0 }
+ { "b", 512 },
+ { "k", 1024 },
+ { "B", 1024 },
+ { }
};
static const struct mode_info *find_mode(const char *name)
coreutils/tail.c+1 -1
@@ -30,7 +30,7 @@ static const struct suffix_mult tail_suffixes[] = {
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { NULL, 0 }
+ { }
};
struct globals {
findutils/find.c+2 -2
@@ -760,10 +760,10 @@ static action*** parse_params(char **argv)
static const struct suffix_mult find_suffixes[] = {
{ "c", 1 },
{ "w", 2 },
- { "b"+1, 512 },
+ { "", 512 },
{ "b", 512 },
{ "k", 1024 },
- { NULL, 0 }
+ { }
};
action_size *ap;
ap = ALLOC_ACTION(size);
include/libbb.h+1 -1
@@ -451,7 +451,7 @@ const char *make_human_readable_str(unsigned long long size,
char *bin2hex(char *buf, const char *cp, int count);
struct suffix_mult {
- const char *suffix;
+ char suffix[4];
unsigned mult;
};
#include "xatonum.h"
runit/svlogd.c+7 -7
@@ -488,9 +488,9 @@ static unsigned logdir_open(struct logdir *ld, const char *fn)
break;
case 's': {
static const struct suffix_mult km_suffixes[] = {
- { "k", 1024 },
- { "m", 1024*1024 },
- { NULL, 0 }
+ { "k", 1024 },
+ { "m", 1024*1024 },
+ { }
};
ld->sizemax = xatou_sfx(&s[1], km_suffixes);
break;
@@ -503,10 +503,10 @@ static unsigned logdir_open(struct logdir *ld, const char *fn)
break;
case 't': {
static const struct suffix_mult mh_suffixes[] = {
- { "m", 60 },
- { "h", 60*60 },
- /*{ "d", 24*60*60 },*/
- { NULL, 0 }
+ { "m", 60 },
+ { "h", 60*60 },
+ /*{ "d", 24*60*60 },*/
+ { }
};
ld->tmax = xatou_sfx(&s[1], mh_suffixes);
if (ld->tmax) {
util-linux/hexdump.c+4 -4
@@ -48,10 +48,10 @@ static const char add_first[] = "\"%07.7_Ax\n\"";
static const char hexdump_opts[] = "bcdoxCe:f:n:s:v";
static const struct suffix_mult suffixes[] = {
- { "b", 512 },
- { "k", 1024 },
- { "m", 1024*1024 },
- { NULL, 0 }
+ { "b", 512 },
+ { "k", 1024 },
+ { "m", 1024*1024 },
+ { }
};
int hexdump_main(int argc, char **argv);