*: style fix

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2022-08-30 16:41:17 +02:00
parent 58598eb709
commit fe73c8d557
13 changed files with 52 additions and 52 deletions

View File

@ -1115,7 +1115,7 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
if (package_edge->type == EDGE_PRE_DEPENDS if (package_edge->type == EDGE_PRE_DEPENDS
|| package_edge->type == EDGE_DEPENDS || package_edge->type == EDGE_DEPENDS
) { ) {
int result=1; int result = 1;
status_num = 0; status_num = 0;
/* If we are inside an alternative then check /* If we are inside an alternative then check

View File

@ -167,7 +167,7 @@ static void cut_file(FILE *file, const char *delim, const char *odelim,
if (!cl_pos && !dcount && !shoe) { if (!cl_pos && !dcount && !shoe) {
if (option_mask32 & CUT_OPT_SUPPRESS_FLGS) if (option_mask32 & CUT_OPT_SUPPRESS_FLGS)
goto next_line; goto next_line;
} else if (dcount<cut_lists[cl_pos].startpos) } else if (dcount < cut_lists[cl_pos].startpos)
start = linelen; start = linelen;
end = linelen; end = linelen;
} else { } else {

View File

@ -859,7 +859,7 @@ static number_t primary(enum token n)
if (check_operator(args[1]) != EOI) { /* if args[1] != NULL */ if (check_operator(args[1]) != EOI) { /* if args[1] != NULL */
if (args[2]) { if (args[2]) {
// coreutils also does this: // coreutils also does this:
// if (args[3] && args[0]="-l" && args[2] is BINOP) // if (args[3] && args[0] = "-l" && args[2] is BINOP)
// return binop(1 /* prepended by -l */); // return binop(1 /* prepended by -l */);
if (last_operator->op_type == BINOP) if (last_operator->op_type == BINOP)
unnest_msg_and_return(binop(), "<primary: binop:%lld\n"); unnest_msg_and_return(binop(), "<primary: binop:%lld\n");

View File

@ -138,9 +138,9 @@ static void do_line(void *data)
{ {
struct double_list *dlist = data; struct double_list *dlist = data;
if (TT.state>1 && *dlist->data != TT.state) if (TT.state > 1 && *dlist->data != TT.state)
fdprintf(TT.state == 2 ? 2 : TT.fileout, fdprintf(TT.state == 2 ? 2 : TT.fileout,
"%s\n", dlist->data+(TT.state>3 ? 1 : 0)); "%s\n", dlist->data + (TT.state > 3 ? 1 : 0));
if (PATCH_DEBUG) fdprintf(2, "DO %d: %s\n", TT.state, dlist->data); if (PATCH_DEBUG) fdprintf(2, "DO %d: %s\n", TT.state, dlist->data);
@ -221,7 +221,7 @@ static int apply_one_hunk(void)
// Match EOF if there aren't as many ending context lines as beginning // Match EOF if there aren't as many ending context lines as beginning
for (plist = TT.current_hunk; plist; plist = plist->next) { for (plist = TT.current_hunk; plist; plist = plist->next) {
if (plist->data[0]==' ') matcheof++; if (plist->data[0] == ' ') matcheof++;
else matcheof = 0; else matcheof = 0;
if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data); if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data);
} }
@ -433,15 +433,15 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// Are we assembling a hunk? // Are we assembling a hunk?
if (state >= 2) { if (state >= 2) {
if (*patchline==' ' || *patchline=='+' || *patchline=='-') { if (*patchline == ' ' || *patchline == '+' || *patchline == '-') {
dlist_add(&TT.current_hunk, patchline); dlist_add(&TT.current_hunk, patchline);
if (*patchline != '+') oldlen--; if (*patchline != '+') oldlen--;
if (*patchline != '-') newlen--; if (*patchline != '-') newlen--;
// Context line? // Context line?
if (*patchline==' ' && state==2) TT.context++; if (*patchline == ' ' && state == 2) TT.context++;
else state=3; else state = 3;
// If we've consumed all expected hunk lines, apply the hunk. // If we've consumed all expected hunk lines, apply the hunk.
@ -469,9 +469,9 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
free(*name); free(*name);
// Trim date from end of filename (if any). We don't care. // Trim date from end of filename (if any). We don't care.
for (s = patchline+4; *s && *s!='\t'; s++) for (s = patchline+4; *s && *s!='\t'; s++)
if (*s=='\\' && s[1]) s++; if (*s == '\\' && s[1]) s++;
i = atoi(s); i = atoi(s);
if (i>1900 && i<=1970) if (i > 1900 && i <= 1970)
*name = xstrdup("/dev/null"); *name = xstrdup("/dev/null");
else { else {
*s = 0; *s = 0;

View File

@ -79,7 +79,7 @@ void TOY_llist_free(void *list, void (*freeit)(void *data))
else free(pop); else free(pop);
// End doubly linked list too. // End doubly linked list too.
if (list==pop) break; if (list == pop) break;
} }
} }
@ -137,11 +137,11 @@ char *get_rawline(int fd, long *plen, char end)
long len = 0; long len = 0;
for (;;) { for (;;) {
if (1>read(fd, &c, 1)) break; if (1 > read(fd, &c, 1)) break;
if (!(len & 63)) buf=xrealloc(buf, len+65); if (!(len & 63)) buf=xrealloc(buf, len+65);
if ((buf[len++]=c) == end) break; if ((buf[len++] = c) == end) break;
} }
if (buf) buf[len]=0; if (buf) buf[len] = 0;
if (plen) *plen = len; if (plen) *plen = len;
return buf; return buf;
@ -153,7 +153,7 @@ char *get_line(int fd)
long len; long len;
char *buf = get_rawline(fd, &len, '\n'); char *buf = get_rawline(fd, &len, '\n');
if (buf && buf[--len]=='\n') buf[len]=0; if (buf && buf[--len] == '\n') buf[len] = 0;
return buf; return buf;
} }
@ -165,10 +165,10 @@ void xsendfile(int in, int out)
long len; long len;
char buf[4096]; char buf[4096];
if (in<0) return; if (in < 0) return;
for (;;) { for (;;) {
len = safe_read(in, buf, 4096); len = safe_read(in, buf, 4096);
if (len<1) break; if (len < 1) break;
xwrite(out, buf, len); xwrite(out, buf, len);
} }
} }
@ -179,7 +179,7 @@ void replace_tempfile(int fdin, int fdout, char **tempname)
{ {
char *temp = xstrdup(*tempname); char *temp = xstrdup(*tempname);
temp[strlen(temp)-6]=0; temp[strlen(temp)-6] = 0;
if (fdin != -1) { if (fdin != -1) {
xsendfile(fdin, fdout); xsendfile(fdin, fdout);
xclose(fdin); xclose(fdin);
@ -263,9 +263,9 @@ static void do_line(void *data)
{ {
struct double_list *dlist = (struct double_list *)data; struct double_list *dlist = (struct double_list *)data;
if (TT.state>1 && *dlist->data != TT.state) if (TT.state > 1 && *dlist->data != TT.state)
fdprintf(TT.state == 2 ? 2 : TT.fileout, fdprintf(TT.state == 2 ? 2 : TT.fileout,
"%s\n", dlist->data+(TT.state>3 ? 1 : 0)); "%s\n", dlist->data + (TT.state > 3 ? 1 : 0));
if (PATCH_DEBUG) fdprintf(2, "DO %d: %s\n", TT.state, dlist->data); if (PATCH_DEBUG) fdprintf(2, "DO %d: %s\n", TT.state, dlist->data);
@ -314,7 +314,7 @@ static int apply_one_hunk(void)
// Match EOF if there aren't as many ending context lines as beginning // Match EOF if there aren't as many ending context lines as beginning
for (plist = TT.current_hunk; plist; plist = plist->next) { for (plist = TT.current_hunk; plist; plist = plist->next) {
if (plist->data[0]==' ') matcheof++; if (plist->data[0] == ' ') matcheof++;
else matcheof = 0; else matcheof = 0;
if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data); if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data);
} }
@ -385,7 +385,7 @@ static int apply_one_hunk(void)
// If we've reached the end of the buffer without confirming a // If we've reached the end of the buffer without confirming a
// match, read more lines. // match, read more lines.
if (check==buf) { if (check == buf) {
buf = 0; buf = 0;
break; break;
} }
@ -456,15 +456,15 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// Are we assembling a hunk? // Are we assembling a hunk?
if (state >= 2) { if (state >= 2) {
if (*patchline==' ' || *patchline=='+' || *patchline=='-') { if (*patchline == ' ' || *patchline == '+' || *patchline == '-') {
dlist_add(&TT.current_hunk, patchline); dlist_add(&TT.current_hunk, patchline);
if (*patchline != '+') TT.oldlen--; if (*patchline != '+') TT.oldlen--;
if (*patchline != '-') TT.newlen--; if (*patchline != '-') TT.newlen--;
// Context line? // Context line?
if (*patchline==' ' && state==2) TT.context++; if (*patchline == ' ' && state == 2) TT.context++;
else state=3; else state = 3;
// If we've consumed all expected hunk lines, apply the hunk. // If we've consumed all expected hunk lines, apply the hunk.
@ -491,9 +491,9 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// Trim date from end of filename (if any). We don't care. // Trim date from end of filename (if any). We don't care.
for (s = patchline+4; *s && *s!='\t'; s++) for (s = patchline+4; *s && *s!='\t'; s++)
if (*s=='\\' && s[1]) s++; if (*s == '\\' && s[1]) s++;
i = atoi(s); i = atoi(s);
if (i>1900 && i<=1970) if (i > 1900 && i <= 1970)
*name = xstrdup("/dev/null"); *name = xstrdup("/dev/null");
else { else {
*s = 0; *s = 0;
@ -537,7 +537,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
// handle -p path truncation. // handle -p path truncation.
for (i=0, s = name; *s;) { for (i=0, s = name; *s;) {
if ((option_mask32 & FLAG_PATHLEN) && TT.prefix == i) break; if ((option_mask32 & FLAG_PATHLEN) && TT.prefix == i) break;
if (*(s++)=='/') { if (*(s++) == '/') {
name = s; name = s;
i++; i++;
} }

View File

@ -4327,7 +4327,7 @@ static void do_cmd(int c)
c1 = get_one_char(); c1 = get_one_char();
// ZQ means to exit without saving // ZQ means to exit without saving
if (c1 == 'Q') { if (c1 == 'Q') {
editing=0; editing = 0;
optind = cmdline_filecnt; optind = cmdline_filecnt;
break; break;
} }

View File

@ -115,7 +115,7 @@ int main(int argc, char **argv)
if (ptr) if (ptr)
prog = ptr+1; prog = ptr+1;
for (c=1; c < argc; c++) { for (c = 1; c < argc; c++) {
if (argv[c][0] >= '0' && argv[c][0] <= '9') { if (argv[c][0] >= '0' && argv[c][0] <= '9') {
t.tv_sec = strtol(argv[c], NULL, 10); t.tv_sec = strtol(argv[c], NULL, 10);
continue; continue;
@ -124,7 +124,7 @@ int main(int argc, char **argv)
usage(); usage();
return 1; return 1;
} }
for (i=1; argv[c][i]; i++) { for (i = 1; argv[c][i]; i++) {
switch (argv[c][i]) { switch (argv[c][i]) {
case 'h': case 'h':
action = HALT; action = HALT;

View File

@ -3105,7 +3105,7 @@ static BC_STATUS zbc_lex_identifier(void)
continue; continue;
match: match:
// buf starts with keyword bc_lex_kws[i] // buf starts with keyword bc_lex_kws[i]
if (isalnum(buf[j]) || buf[j]=='_') if (isalnum(buf[j]) || buf[j] == '_')
continue; // "ifz" does not match "if" keyword, "if." does continue; // "ifz" does not match "if" keyword, "if." does
p->lex = BC_LEX_KEY_1st_keyword + i; p->lex = BC_LEX_KEY_1st_keyword + i;
if (!keyword_is_POSIX(i)) { if (!keyword_is_POSIX(i)) {

View File

@ -976,7 +976,7 @@ static void action_compat(const struct devfsd_notify_struct *info, unsigned int
rewind_ = info->devname[info->namelen - 1]; rewind_ = info->devname[info->namelen - 1];
if (rewind_ != 'n') if (rewind_ != 'n')
rewind_ = '\0'; rewind_ = '\0';
mode=0; mode = 0;
if (ptr[2] == 'l' /*108*/ || ptr[2] == 'm'/*109*/) if (ptr[2] == 'l' /*108*/ || ptr[2] == 'm'/*109*/)
mode = ptr[2] - 107; /* 1 or 2 */ mode = ptr[2] - 107; /* 1 or 2 */
if (ptr[2] == 'a') if (ptr[2] == 'a')
@ -1595,11 +1595,11 @@ static char *write_old_sd_name(char *buffer,
return buffer; return buffer;
} }
if ((major > 64) && (major < 72)) { if ((major > 64) && (major < 72)) {
disc_index = ((major - 64) << 4) +(minor >> 4); disc_index = ((major - 64) << 4) + (minor >> 4);
if (disc_index < 26) if (disc_index < 26)
sprintf(buffer, "sd%c%s", 'a' + disc_index, part); sprintf(buffer, "sd%c%s", 'a' + disc_index, part);
else else
sprintf(buffer, "sd%c%c%s", 'a' +(disc_index / 26) - 1, 'a' + disc_index % 26, part); sprintf(buffer, "sd%c%c%s", 'a' + (disc_index / 26) - 1, 'a' + disc_index % 26, part);
return buffer; return buffer;
} }
return NULL; return NULL;

View File

@ -798,7 +798,7 @@ static void identify(uint16_t *val)
if (!(val[GEN_CONFIG] & NOT_ATA)) { if (!(val[GEN_CONFIG] & NOT_ATA)) {
dev = ATA_DEV; dev = ATA_DEV;
printf("ATA device, with "); printf("ATA device, with ");
} else if (val[GEN_CONFIG]==CFA_SUPPORT_VAL) { } else if (val[GEN_CONFIG] == CFA_SUPPORT_VAL) {
dev = ATA_DEV; dev = ATA_DEV;
like_std = 4; like_std = 4;
printf("CompactFlash ATA device, with "); printf("CompactFlash ATA device, with ");
@ -819,13 +819,13 @@ static void identify(uint16_t *val)
* specific, it should be safe to check it now, even though we don't * specific, it should be safe to check it now, even though we don't
* know yet what standard this device is using. * know yet what standard this device is using.
*/ */
if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL) if ((val[CONFIG] == STBY_NID_VAL) || (val[CONFIG] == STBY_ID_VAL)
|| (val[CONFIG]==PWRD_NID_VAL) || (val[CONFIG]==PWRD_ID_VAL) || (val[CONFIG] == PWRD_NID_VAL) || (val[CONFIG] == PWRD_ID_VAL)
) { ) {
like_std = 5; like_std = 5;
if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL)) if ((val[CONFIG] == STBY_NID_VAL) || (val[CONFIG] == STBY_ID_VAL))
puts("powers-up in standby; SET FEATURES subcmd spins-up."); puts("powers-up in standby; SET FEATURES subcmd spins-up.");
if (((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE)) if (((val[CONFIG] == STBY_NID_VAL) || (val[CONFIG] == PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE))
puts("\n\tWARNING: ID response incomplete.\n\tFollowing data may be incorrect.\n"); puts("\n\tWARNING: ID response incomplete.\n\tFollowing data may be incorrect.\n");
} }
@ -853,7 +853,7 @@ static void identify(uint16_t *val)
printf("\n\tSupported: "); printf("\n\tSupported: ");
jj = val[MAJOR] << 1; jj = val[MAJOR] << 1;
kk = like_std >4 ? like_std-4: 0; kk = like_std >4 ? like_std-4: 0;
for (ii = 14; (ii >0)&&(ii>kk); ii--) { for (ii = 14; (ii > 0) && (ii > kk); ii--) {
if (jj & 0x8000) { if (jj & 0x8000) {
printf("%u ", ii); printf("%u ", ii);
if (like_std < ii) { if (like_std < ii) {
@ -943,7 +943,7 @@ static void identify(uint16_t *val)
for (ii = 1; ii < 15; ii++) { for (ii = 1; ii < 15; ii++) {
if (jj & 0x0001) if (jj & 0x0001)
printf("\t%s\n", nth_string(ata1_cfg_str, ii)); printf("\t%s\n", nth_string(ata1_cfg_str, ii));
jj >>=1; jj >>= 1;
} }
} }
if (dev == ATAPI_DEV) { if (dev == ATAPI_DEV) {
@ -952,7 +952,7 @@ static void identify(uint16_t *val)
else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_INTR_VAL) else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_INTR_VAL)
strng = "<=10ms with INTRQ"; strng = "<=10ms with INTRQ";
else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_50US_VAL) else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_50US_VAL)
strng ="50us"; strng = "50us";
else else
strng = "unknown"; strng = "unknown";
printf("\tDRQ response: %s\n\tPacket size: ", strng); /* Data Request (DRQ) */ printf("\tDRQ response: %s\n\tPacket size: ", strng); /* Data Request (DRQ) */
@ -1014,7 +1014,7 @@ static void identify(uint16_t *val)
} }
if (!bbbig) if (!bbbig)
bbbig = (uint64_t)(ll>mm ? ll : mm); /* # 512 byte blocks */ bbbig = (uint64_t)(ll > mm ? ll : mm); /* # 512 byte blocks */
printf("\tdevice size with M = 1024*1024: %11"PRIu64" MBytes\n", bbbig>>11); printf("\tdevice size with M = 1024*1024: %11"PRIu64" MBytes\n", bbbig>>11);
bbbig = (bbbig << 9) / 1000000; bbbig = (bbbig << 9) / 1000000;
printf("\tdevice size with M = 1000*1000: %11"PRIu64" MBytes ", bbbig); printf("\tdevice size with M = 1000*1000: %11"PRIu64" MBytes ", bbbig);
@ -1160,7 +1160,7 @@ static void identify(uint16_t *val)
jj = ((val[ADV_PIO_MODES] & PIO_SUP) << 3) | 0x0007; jj = ((val[ADV_PIO_MODES] & PIO_SUP) << 3) | 0x0007;
for (ii = 0; ii <= PIO_MODE_MAX; ii++) { for (ii = 0; ii <= PIO_MODE_MAX; ii++) {
if (jj & 0x0001) printf("pio%d ", ii); if (jj & 0x0001) printf("pio%d ", ii);
jj >>=1; jj >>= 1;
} }
bb_putchar('\n'); bb_putchar('\n');
} else if (((min_std < 5) || (eqpt == CDROM)) && (val[PIO_MODE] & MODE)) { } else if (((min_std < 5) || (eqpt == CDROM)) && (val[PIO_MODE] & MODE)) {
@ -1199,7 +1199,7 @@ static void identify(uint16_t *val)
} }
if (ii == 31) { if (ii == 31) {
if ((val[CMDS_SUPP_2] & VALID) != VALID_VAL) if ((val[CMDS_SUPP_2] & VALID) != VALID_VAL)
ii +=16; ii += 16;
} }
} }
} }
@ -1220,7 +1220,7 @@ static void identify(uint16_t *val)
printf("\t%s\t%s\n", printf("\t%s\t%s\n",
(!(jj & 0x0001)) ? "not" : "", (!(jj & 0x0001)) ? "not" : "",
nth_string(secu_str, ii)); nth_string(secu_str, ii));
jj >>=1; jj >>= 1;
} }
if (val[SECU_STATUS] & SECU_ENABLED) { if (val[SECU_STATUS] & SECU_ENABLED) {
printf("\tSecurity level %s\n", printf("\tSecurity level %s\n",

View File

@ -981,7 +981,7 @@ arch_apply_relocation(struct obj_file *f,
(loc[1] & 0xFFFF); (loc[1] & 0xFFFF);
/* Add reloc offset */ /* Add reloc offset */
temp1+=v; temp1 += v;
/* Store back into code */ /* Store back into code */
loc[0] = (loc[0] & 0xFFFF0000) | temp1 >> 16; loc[0] = (loc[0] & 0xFFFF0000) | temp1 >> 16;

View File

@ -214,7 +214,7 @@ static int prio_print_opt(struct rtattr *opt)
return 0; return 0;
parse_rtattr_nested_compat(tb, TCA_PRIO_MAX, opt, qopt, sizeof(*qopt)); parse_rtattr_nested_compat(tb, TCA_PRIO_MAX, opt, qopt, sizeof(*qopt));
printf("bands %u priomap ", qopt->bands); printf("bands %u priomap ", qopt->bands);
for (i=0; i<=TC_PRIO_MAX; i++) for (i = 0; i <= TC_PRIO_MAX; i++)
printf(" %d", qopt->priomap[i]); printf(" %d", qopt->priomap[i]);
if (tb[TCA_PRIO_MQ]) if (tb[TCA_PRIO_MQ])

View File

@ -515,7 +515,7 @@ static void FAST_FUNC collect_blk(blk_stat *s)
return; return;
} }
for (i=0; i<2; i++) { for (i = 0; i < 2; i++) {
ullong old = s->old[i]; ullong old = s->old[i];
if (data[i] < old) old = data[i]; //sanitize if (data[i] < old) old = data[i]; //sanitize
s->old[i] = data[i]; s->old[i] = data[i];
@ -597,7 +597,7 @@ static void FAST_FUNC collect_if(if_stat *s)
return; return;
} }
for (i=0; i<4; i++) { for (i = 0; i < 4; i++) {
ullong old = s->old[i]; ullong old = s->old[i];
if (data[i] < old) old = data[i]; //sanitize if (data[i] < old) old = data[i]; //sanitize
s->old[i] = data[i]; s->old[i] = data[i];