From ae6a924ba494a37307d9e3a7fa6ee996e0a693ae Mon Sep 17 00:00:00 2001 From: khali Date: Sun, 26 Oct 2008 12:50:21 +0000 Subject: Mass coding-style change: add spaces around operators. --- dmiopt.c | 112 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'dmiopt.c') diff --git a/dmiopt.c b/dmiopt.c index 4b35666..a01e5da 100644 --- a/dmiopt.c +++ b/dmiopt.c @@ -45,17 +45,17 @@ struct type_keyword const u8 *type; }; -static const u8 opt_type_bios[]={ 0, 13, 255 }; -static const u8 opt_type_system[]={ 1, 12, 15, 23, 32, 255 }; -static const u8 opt_type_baseboard[]={ 2, 10, 255 }; -static const u8 opt_type_chassis[]={ 3, 255 }; -static const u8 opt_type_processor[]={ 4, 255 }; -static const u8 opt_type_memory[]={ 5, 6, 16, 17, 255 }; -static const u8 opt_type_cache[]={ 7, 255 }; -static const u8 opt_type_connector[]={ 8, 255 }; -static const u8 opt_type_slot[]={ 9, 255 }; - -static const struct type_keyword opt_type_keyword[]={ +static const u8 opt_type_bios[] = { 0, 13, 255 }; +static const u8 opt_type_system[] = { 1, 12, 15, 23, 32, 255 }; +static const u8 opt_type_baseboard[] = { 2, 10, 255 }; +static const u8 opt_type_chassis[] = { 3, 255 }; +static const u8 opt_type_processor[] = { 4, 255 }; +static const u8 opt_type_memory[] = { 5, 6, 16, 17, 255 }; +static const u8 opt_type_cache[] = { 7, 255 }; +static const u8 opt_type_connector[] = { 8, 255 }; +static const u8 opt_type_slot[] = { 9, 255 }; + +static const struct type_keyword opt_type_keyword[] = { { "bios", opt_type_bios }, { "system", opt_type_system }, { "baseboard", opt_type_baseboard }, @@ -72,7 +72,7 @@ static void print_opt_type_list(void) unsigned int i; fprintf(stderr, "Valid type keywords are:\n"); - for(i=0; i0xff) + if (val > 0xff) { fprintf(stderr, "Invalid type number: %lu\n", val); goto exit_free; } - p[val]=1; - arg=next; - while(*arg==',' || *arg==' ') + p[val] = 1; + arg = next; + while (*arg == ',' || *arg == ' ') arg++; } @@ -146,7 +146,7 @@ exit_free: /* This lookup table could admittedly be reworked for improved performance. Due to the low count of items in there at the moment, it did not seem worth the additional code complexity though. */ -static const struct string_keyword opt_string_keyword[]={ +static const struct string_keyword opt_string_keyword[] = { { "bios-vendor", 0, 0x04, NULL, NULL }, { "bios-version", 0, 0x05, NULL, NULL }, { "bios-release-date", 0, 0x08, NULL, NULL }, @@ -176,7 +176,7 @@ static void print_opt_string_list(void) unsigned int i; fprintf(stderr, "Valid string keywords are:\n"); - for(i=0; i1) + if ((opt.string != NULL) + (opt.type != NULL) + + !!(opt.flags & FLAG_DUMP) + !!(opt.flags & FLAG_DUMP_BIN) > 1) { fprintf(stderr, "Options --string, --type, --dump and --dump-bin are mutually exclusive\n"); return -1; } - if(opt.flags & (FLAG_DUMP | FLAG_DUMP_BIN)) - opt.flags&=~FLAG_QUIET; + if (opt.flags & (FLAG_DUMP | FLAG_DUMP_BIN)) + opt.flags &= ~FLAG_QUIET; - if((opt.flags & FLAG_FROM_DUMP) && (opt.flags & FLAG_DUMP_BIN)) + if ((opt.flags & FLAG_FROM_DUMP) && (opt.flags & FLAG_DUMP_BIN)) { fprintf(stderr, "Options --from-dump and --dump-bin are mutually exclusive\n"); return -1; @@ -301,7 +301,7 @@ int parse_command_line(int argc, char * const argv[]) void print_help(void) { - static const char *help= + static const char *help = "Usage: dmidecode [OPTIONS]\n" "Options are:\n" " -d, --dev-mem FILE Read memory from device FILE (default: " DEFAULT_MEM_DEV ")\n" -- cgit v1.2.1