diff options
Diffstat (limited to 'contrib/binutils/gas/sb.c')
-rw-r--r-- | contrib/binutils/gas/sb.c | 61 |
1 files changed, 17 insertions, 44 deletions
diff --git a/contrib/binutils/gas/sb.c b/contrib/binutils/gas/sb.c index 93d2fcf..27b29ee 100644 --- a/contrib/binutils/gas/sb.c +++ b/contrib/binutils/gas/sb.c @@ -52,7 +52,7 @@ #define dsize 5 -static void sb_check PARAMS ((sb *, int)); +static void sb_check (sb *, int); /* Statistics of sb structures. */ @@ -65,9 +65,7 @@ static sb_list_vector free_list; /* initializes an sb. */ void -sb_build (ptr, size) - sb *ptr; - int size; +sb_build (sb *ptr, int size) { /* see if we can find one to allocate */ sb_element *e; @@ -98,8 +96,7 @@ sb_build (ptr, size) } void -sb_new (ptr) - sb *ptr; +sb_new (sb *ptr) { sb_build (ptr, dsize); } @@ -107,8 +104,7 @@ sb_new (ptr) /* deallocate the sb at ptr */ void -sb_kill (ptr) - sb *ptr; +sb_kill (sb *ptr) { /* return item to free list */ ptr->item->next = free_list.size[ptr->pot]; @@ -118,9 +114,7 @@ sb_kill (ptr) /* add the sb at s to the end of the sb at ptr */ void -sb_add_sb (ptr, s) - sb *ptr; - sb *s; +sb_add_sb (sb *ptr, sb *s) { sb_check (ptr, s->len); memcpy (ptr->ptr + ptr->len, s->ptr, s->len); @@ -131,9 +125,7 @@ sb_add_sb (ptr, s) and grow it if it doesn't. */ static void -sb_check (ptr, len) - sb *ptr; - int len; +sb_check (sb *ptr, int len) { if (ptr->len + len >= 1 << ptr->pot) { @@ -151,8 +143,7 @@ sb_check (ptr, len) /* make the sb at ptr point back to the beginning. */ void -sb_reset (ptr) - sb *ptr; +sb_reset (sb *ptr) { ptr->len = 0; } @@ -160,9 +151,7 @@ sb_reset (ptr) /* add character c to the end of the sb at ptr. */ void -sb_add_char (ptr, c) - sb *ptr; - int c; +sb_add_char (sb *ptr, int c) { sb_check (ptr, 1); ptr->ptr[ptr->len++] = c; @@ -171,9 +160,7 @@ sb_add_char (ptr, c) /* add null terminated string s to the end of sb at ptr. */ void -sb_add_string (ptr, s) - sb *ptr; - const char *s; +sb_add_string (sb *ptr, const char *s) { int len = strlen (s); sb_check (ptr, len); @@ -184,10 +171,7 @@ sb_add_string (ptr, s) /* add string at s of length len to sb at ptr */ void -sb_add_buffer (ptr, s, len) - sb *ptr; - const char *s; - int len; +sb_add_buffer (sb *ptr, const char *s, int len) { sb_check (ptr, len); memcpy (ptr->ptr + ptr->len, s, len); @@ -197,9 +181,7 @@ sb_add_buffer (ptr, s, len) /* print the sb at ptr to the output file */ void -sb_print (outfile, ptr) - FILE *outfile; - sb *ptr; +sb_print (FILE *outfile, sb *ptr) { int i; int nc = 0; @@ -216,10 +198,7 @@ sb_print (outfile, ptr) } void -sb_print_at (outfile, idx, ptr) - FILE *outfile; - int idx; - sb *ptr; +sb_print_at (FILE *outfile, int idx, sb *ptr) { int i; for (i = idx; i < ptr->len; i++) @@ -230,8 +209,7 @@ sb_print_at (outfile, idx, ptr) string, so that it can be used as an arg to printf %s. */ char * -sb_name (in) - sb *in; +sb_name (sb *in) { /* stick a null on the end of the string */ sb_add_char (in, 0); @@ -241,8 +219,7 @@ sb_name (in) /* like sb_name, but don't include the null byte in the string. */ char * -sb_terminate (in) - sb *in; +sb_terminate (sb *in) { sb_add_char (in, 0); --in->len; @@ -253,9 +230,7 @@ sb_terminate (in) whitespace. return the index of the first non whitespace character */ int -sb_skip_white (idx, ptr) - int idx; - sb *ptr; +sb_skip_white (int idx, sb *ptr) { while (idx < ptr->len && (ptr->ptr[idx] == ' ' @@ -265,13 +240,11 @@ sb_skip_white (idx, ptr) } /* start at the index idx into the sb at ptr. skips whitespace, - a comma and any following whitespace. returnes the index of the + a comma and any following whitespace. returns the index of the next character. */ int -sb_skip_comma (idx, ptr) - int idx; - sb *ptr; +sb_skip_comma (int idx, sb *ptr) { while (idx < ptr->len && (ptr->ptr[idx] == ' ' |