-
Notifications
You must be signed in to change notification settings - Fork 17
Convert fcode-utils to Linux kernel indentation #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,7 +126,7 @@ static void pretty_print_string(void) | |
| static void decode_lines(void) | ||
| { | ||
| if (show_linenumbers) { | ||
| printf("%6d: ",show_offsets ? token_streampos : linenum++); | ||
| printf("%6d: ", show_offsets ? token_streampos : linenum++); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -195,7 +195,6 @@ static void output_token_name(void) | |
| return; | ||
| } | ||
|
|
||
|
|
||
| tname = lookup_token(fcode); | ||
| printf("%s ", tname); | ||
|
|
||
|
|
@@ -239,7 +238,6 @@ static void output_token(void) | |
| output_token_name(); | ||
| } | ||
|
|
||
|
|
||
| /* ************************************************************************** | ||
| * | ||
| * Function name: decode_offset | ||
|
|
@@ -330,8 +328,7 @@ static s16 decode_offset(void) | |
| if (offs == 0) { | ||
| printremark("Error: Unresolved offset."); | ||
| } else { | ||
| printremark | ||
| ("Error: Invalid offset. Ignoring..."); | ||
| printremark("Error: Invalid offset. Ignoring..."); | ||
| set_streampos(streampos); | ||
| } | ||
| } | ||
|
|
@@ -446,7 +443,6 @@ static void decode_start(void) | |
| fcformat = get_num8(); | ||
| printf(" format: 0x%02x\n", fcformat); | ||
|
|
||
|
|
||
| /* Check for checksum correctness. */ | ||
|
|
||
| token_streampos = get_streampos(); | ||
|
|
@@ -467,7 +463,6 @@ static void decode_start(void) | |
| printf(" len: 0x%04x ( %d bytes)\n", fclen, fclen); | ||
| } | ||
|
|
||
|
|
||
| /* ************************************************************************** | ||
| * | ||
| * Function name: decode_token | ||
|
|
@@ -549,28 +544,26 @@ static void decode_token(u16 token) | |
| decode_default(); | ||
| break; | ||
|
|
||
| #if 0 /* Fooey on C's petty limitations! */ | ||
| /* I'd like to be able to do this: */ | ||
| /* Special Functions */ | ||
| #if 0 /* Fooey on C's petty limitations! */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe start the comment on the next line so that the indenter knows what to do about it? |
||
| /* I'd like to be able to do this: */ | ||
| /* Special Functions */ | ||
| case *double_lit_code: | ||
| double_length_literal(); | ||
| break; | ||
| #endif /* Fooey on C's petty limitations! */ | ||
| #endif /* Fooey on C's petty limitations! */ | ||
|
|
||
| default: | ||
| { | ||
| /* Have to do this clumsy thing instead */ | ||
| if ( token == *double_lit_code ) | ||
| { | ||
| double_length_literal(); | ||
| break; | ||
| } | ||
| { | ||
| /* Have to do this clumsy thing instead */ | ||
| if (token == *double_lit_code) { | ||
| double_length_literal(); | ||
| break; | ||
| } | ||
|
|
||
| decode_default(); | ||
| decode_default(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| /* ************************************************************************** | ||
| * | ||
|
|
@@ -763,8 +756,7 @@ static bool another_fcode_block(void) | |
| case 0x0f2: /* start2 */ | ||
| case 0x0f3: /* start4 */ | ||
| retval = TRUE; | ||
| printremark | ||
| ("Subsequent FCode Block detected. Detokenizing."); | ||
| printremark("Subsequent FCode Block detected. Detokenizing."); | ||
| break; | ||
| case 0: /* Start of a zero-fill field */ | ||
| /* retval already = FALSE . Nothing else to be done. */ | ||
|
|
@@ -816,5 +808,4 @@ void detokenize(void) | |
| } | ||
| } | ||
|
|
||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,9 +75,9 @@ char *lookup_token(u16 number) | |
| * | ||
| **************************************************************************** */ | ||
|
|
||
| void link_token( token_t *curr_token) | ||
| void link_token(token_t * curr_token) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the indenter mixed up multiplication and pointer type here |
||
| { | ||
| curr_token->prev = dictionary; | ||
| curr_token->prev = dictionary; | ||
|
|
||
| dictionary = curr_token; | ||
| } | ||
|
|
@@ -134,9 +134,9 @@ void add_token(u16 number, char *name) | |
| } | ||
|
|
||
| curr->name = name; | ||
| curr->fcode=number; | ||
| curr->fcode = number; | ||
|
|
||
| link_token( curr); | ||
| link_token(curr); | ||
|
|
||
| if (check_tok_seq) { | ||
| /* Error-check, but not for first time. */ | ||
|
|
@@ -145,11 +145,13 @@ void add_token(u16 number, char *name) | |
| last_defined_token = number; | ||
| } else { | ||
| if (number <= last_defined_token) { | ||
| printremark("Warning: New token # might overlap " | ||
| "previously assigned token #(s)."); | ||
| printremark | ||
| ("Warning: New token # might overlap " | ||
| "previously assigned token #(s)."); | ||
| } else { | ||
| printremark("Warning: New token # out of sequence with " | ||
| "previously assigned token #(s)."); | ||
| printremark | ||
| ("Warning: New token # out of sequence with " | ||
| "previously assigned token #(s)."); | ||
| /* It's increasing; update it. */ | ||
| last_defined_token = number; | ||
| } | ||
|
|
@@ -546,8 +548,7 @@ token_t detok_table[] = { | |
| TOKEN_ENTRY(0x254, "xwsplit"), | ||
| }; | ||
|
|
||
| static const int dictionary_indx_max = | ||
| (sizeof(detok_table) / sizeof(token_t)); | ||
| static const int dictionary_indx_max = (sizeof(detok_table) / sizeof(token_t)); | ||
|
|
||
| static token_t *dictionary_reset_position; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this (parens on the next line) really Linux style? And even if, is this something to emulate?