This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Removing some "register" declarations
- From: Paul Hilfinger <hilfingr at gnat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 9 Sep 2003 04:15:30 -0400 (EDT)
- Subject: [commit] Removing some "register" declarations
The following patch removes the "register" declarations in some files I am
in the process of modifying. Committed as obvious.
Paul Hilfinger
ACT, Inc.
2003-09-09 Paul N. Hilfinger <hilfingr@gnat.com>
* p-lang.c: Eliminate "register".
* c-lang.c: Ditto.
* expprint.c: Ditto.
* f-lang.c: Ditto.
* jv-lang.c: Ditto.
* language.c: Ditto.
* m2-lang.c: Ditto.
* parse.c: Ditto.
* scm-lang.c: Ditto.
* objc-lang.c: Ditto.
Index: current-public.22/gdb/p-lang.c
--- current-public.22/gdb/p-lang.c Tue, 17 Jun 2003 02:39:19 -0700 hilfingr (GdbPub/e/26_p-lang.c 1.1.1.2 644)
+++ submit-alt.1(w)/gdb/p-lang.c Fri, 05 Sep 2003 01:24:10 -0700 hilfingr (GdbPub/e/26_p-lang.c 1.1.1.2.1.1 644)
@@ -99,7 +99,7 @@ static void pascal_one_char (int, struct
In_quotes is reset to 0 if a char is written with #4 notation */
static void
-pascal_one_char (register int c, struct ui_file *stream, int *in_quotes)
+pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -132,7 +132,7 @@ static void pascal_emit_char (int c, str
characters and strings is language specific. */
static void
-pascal_emit_char (register int c, struct ui_file *stream, int quoter)
+pascal_emit_char (int c, struct ui_file *stream, int quoter)
{
int in_quotes = 0;
pascal_one_char (c, stream, &in_quotes);
@@ -158,7 +158,7 @@ void
pascal_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -274,7 +274,7 @@ pascal_printstr (struct ui_file *stream,
struct type *
pascal_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
Index: current-public.22/gdb/c-lang.c
--- current-public.22/gdb/c-lang.c Tue, 17 Jun 2003 02:39:19 -0700 hilfingr (GdbPub/g/28_c-lang.c 1.1.1.3 644)
+++ submit-alt.1(w)/gdb/c-lang.c Fri, 05 Sep 2003 01:24:11 -0700 hilfingr (GdbPub/g/28_c-lang.c 1.1.1.3.1.1 644)
@@ -42,7 +42,7 @@ static void c_emit_char (int c, struct u
characters and strings is language specific. */
static void
-c_emit_char (register int c, struct ui_file *stream, int quoter)
+c_emit_char (int c, struct ui_file *stream, int quoter)
{
const char *escape;
int host_char;
@@ -88,7 +88,7 @@ void
c_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -207,7 +207,7 @@ c_printstr (struct ui_file *stream, char
struct type *
c_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
Index: current-public.22/gdb/expprint.c
--- current-public.22/gdb/expprint.c Fri, 18 Jul 2003 23:35:25 -0700 hilfingr (GdbPub/h/29_expprint.c 1.1.1.3 644)
+++ submit-alt.1(w)/gdb/expprint.c Fri, 05 Sep 2003 01:24:12 -0700 hilfingr (GdbPub/h/29_expprint.c 1.1.1.3.2.1 644)
@@ -54,14 +54,14 @@ print_expression (struct expression *exp
parentheses are needed here. */
static void
-print_subexp (register struct expression *exp, register int *pos,
+print_subexp (struct expression *exp, int *pos,
struct ui_file *stream, enum precedence prec)
{
- register unsigned tem;
- register const struct op_print *op_print_tab;
- register int pc;
+ unsigned tem;
+ const struct op_print *op_print_tab;
+ int pc;
unsigned nargs;
- register char *op_str;
+ char *op_str;
int assign_modify = 0;
enum exp_opcode opcode;
enum precedence myprec = PREC_NULL;
@@ -535,7 +535,7 @@ char *
op_string (enum exp_opcode op)
{
int tem;
- register const struct op_print *op_print_tab;
+ const struct op_print *op_print_tab;
op_print_tab = current_language->la_op_print_tab;
for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
Index: current-public.22/gdb/f-lang.c
--- current-public.22/gdb/f-lang.c Tue, 17 Jun 2003 02:39:19 -0700 hilfingr (GdbPub/h/32_f-lang.c 1.1.1.2 644)
+++ submit-alt.1(w)/gdb/f-lang.c Fri, 05 Sep 2003 01:24:11 -0700 hilfingr (GdbPub/h/32_f-lang.c 1.1.1.2.1.1 644)
@@ -100,7 +100,7 @@ static void f_emit_char (int c, struct u
be replaced with a true F77 version. */
static void
-f_emit_char (register int c, struct ui_file *stream, int quoter)
+f_emit_char (int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -164,7 +164,7 @@ static void
f_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -250,7 +250,7 @@ f_printstr (struct ui_file *stream, char
static struct type *
f_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
Index: current-public.22/gdb/jv-lang.c
--- current-public.22/gdb/jv-lang.c Tue, 17 Jun 2003 02:41:56 -0700 hilfingr (GdbPub/i/30_jv-lang.c 1.1.1.3 644)
+++ submit-alt.1(w)/gdb/jv-lang.c Fri, 05 Sep 2003 01:24:12 -0700 hilfingr (GdbPub/i/30_jv-lang.c 1.1.1.3.2.1 644)
@@ -850,8 +850,8 @@ java_emit_char (int c, struct ui_file *s
}
static struct value *
-evaluate_subexp_java (struct type *expect_type, register struct expression *exp,
- register int *pos, enum noside noside)
+evaluate_subexp_java (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
{
int pc = *pos;
int i;
Index: current-public.22/gdb/language.c
--- current-public.22/gdb/language.c Fri, 22 Aug 2003 00:46:52 -0700 hilfingr (GdbPub/i/34_language.c 1.1.1.3.1.1 644)
+++ submit-alt.1(w)/gdb/language.c Fri, 05 Sep 2003 01:24:12 -0700 hilfingr (GdbPub/i/34_language.c 1.1.1.3.1.1.2.1 644)
@@ -1192,13 +1192,13 @@ unk_lang_error (char *msg)
}
static void
-unk_lang_emit_char (register int c, struct ui_file *stream, int quoter)
+unk_lang_emit_char (int c, struct ui_file *stream, int quoter)
{
error ("internal error - unimplemented function unk_lang_emit_char called.");
}
static void
-unk_lang_printchar (register int c, struct ui_file *stream)
+unk_lang_printchar (int c, struct ui_file *stream)
{
error ("internal error - unimplemented function unk_lang_printchar called.");
}
Index: current-public.22/gdb/m2-lang.c
--- current-public.22/gdb/m2-lang.c Tue, 17 Jun 2003 02:39:19 -0700 hilfingr (GdbPub/i/38_m2-lang.c 1.1.1.2 644)
+++ submit-alt.1(w)/gdb/m2-lang.c Fri, 05 Sep 2003 01:24:10 -0700 hilfingr (GdbPub/i/38_m2-lang.c 1.1.1.2.1.1 644)
@@ -45,7 +45,7 @@ static void m2_emit_char (int, struct ui
*/
static void
-m2_emit_char (register int c, struct ui_file *stream, int quoter)
+m2_emit_char (int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -112,7 +112,7 @@ static void
m2_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -198,7 +198,7 @@ m2_printstr (struct ui_file *stream, cha
static struct type *
m2_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
Index: current-public.22/gdb/parse.c
--- current-public.22/gdb/parse.c Fri, 18 Jul 2003 23:35:25 -0700 hilfingr (GdbPub/j/29_parse.c 1.1.1.4 644)
+++ submit-alt.1(w)/gdb/parse.c Fri, 05 Sep 2003 01:24:13 -0700 hilfingr (GdbPub/j/29_parse.c 1.1.1.4.2.1 644)
@@ -112,7 +112,7 @@ static struct funcall *funcall_chain;
void
start_arglist (void)
{
- register struct funcall *new;
+ struct funcall *new;
new = (struct funcall *) xmalloc (sizeof (struct funcall));
new->next = funcall_chain;
@@ -127,8 +127,8 @@ start_arglist (void)
int
end_arglist (void)
{
- register int val = arglist_len;
- register struct funcall *call = funcall_chain;
+ int val = arglist_len;
+ struct funcall *call = funcall_chain;
funcall_chain = call->next;
arglist_len = call->arglist_len;
xfree (call);
@@ -141,7 +141,7 @@ end_arglist (void)
static void
free_funcalls (void *ignore)
{
- register struct funcall *call, *next;
+ struct funcall *call, *next;
for (call = funcall_chain; call; call = next)
{
@@ -263,9 +263,9 @@ write_exp_elt_intern (struct internalvar
void
write_exp_string (struct stoken str)
{
- register int len = str.length;
- register int lenelt;
- register char *strdata;
+ int len = str.length;
+ int lenelt;
+ char *strdata;
/* Compute the number of expression elements required to hold the string
(including a null byte terminator), along with one expression element
@@ -312,10 +312,10 @@ write_exp_string (struct stoken str)
void
write_exp_bitstring (struct stoken str)
{
- register int bits = str.length; /* length in bits */
- register int len = (bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
- register int lenelt;
- register char *strdata;
+ int bits = str.length; /* length in bits */
+ int len = (bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+ int lenelt;
+ char *strdata;
/* Compute the number of expression elements required to hold the bitstring,
along with one expression element at each end to record the actual
@@ -564,7 +564,7 @@ parse_nested_classes_for_hpacc (char *na
consider *prefixes* of the string; there is no need to look up
"B::C" separately as a symbol in the previous example. */
- register char *p;
+ char *p;
char *start, *end;
char *prefix = NULL;
char *tmp;
@@ -769,12 +769,12 @@ copy_name (struct stoken token)
to prefix form (in which we can conveniently print or execute it). */
static void
-prefixify_expression (register struct expression *expr)
+prefixify_expression (struct expression *expr)
{
- register int len =
+ int len =
sizeof (struct expression) + EXP_ELEM_TO_BYTES (expr->nelts);
- register struct expression *temp;
- register int inpos = expr->nelts, outpos = 0;
+ struct expression *temp;
+ int inpos = expr->nelts, outpos = 0;
temp = (struct expression *) alloca (len);
@@ -788,11 +788,11 @@ prefixify_expression (register struct ex
whose last exp_element is at index ENDPOS - 1 in EXPR. */
int
-length_of_subexp (register struct expression *expr, register int endpos)
+length_of_subexp (struct expression *expr, int endpos)
{
- register int oplen = 1;
- register int args = 0;
- register int i;
+ int oplen = 1;
+ int args = 0;
+ int i;
if (endpos < 1)
error ("?error in length_of_subexp");
@@ -930,12 +930,12 @@ length_of_subexp (register struct expres
In the process, convert it from suffix to prefix form. */
static void
-prefixify_subexp (register struct expression *inexpr,
- struct expression *outexpr, register int inend, int outbeg)
+prefixify_subexp (struct expression *inexpr,
+ struct expression *outexpr, int inend, int outbeg)
{
- register int oplen = 1;
- register int args = 0;
- register int i;
+ int oplen = 1;
+ int args = 0;
+ int i;
int *arglens;
enum exp_opcode opcode;
@@ -1175,7 +1175,7 @@ parse_exp_1 (char **stringptr, struct bl
struct expression *
parse_expression (char *string)
{
- register struct expression *exp;
+ struct expression *exp;
exp = parse_exp_1 (&string, 0, 0);
if (*string)
error ("Junk after end of expression.");
Index: current-public.22/gdb/scm-lang.c
--- current-public.22/gdb/scm-lang.c Tue, 17 Jun 2003 02:39:19 -0700 hilfingr (GdbPub/k/14_scm-lang.c 1.1.1.3 644)
+++ submit-alt.1(w)/gdb/scm-lang.c Fri, 05 Sep 2003 01:24:10 -0700 hilfingr (GdbPub/k/14_scm-lang.c 1.1.1.3.1.1 644)
@@ -202,8 +202,8 @@ scm_evaluate_string (char *str, int len)
}
static struct value *
-evaluate_subexp_scm (struct type *expect_type, register struct expression *exp,
- register int *pos, enum noside noside)
+evaluate_subexp_scm (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
{
enum exp_opcode op = exp->elts[*pos].opcode;
int len, pc;
Index: current-public.22/gdb/objc-lang.c
--- current-public.22/gdb/objc-lang.c Tue, 17 Jun 2003 02:41:56 -0700 hilfingr (GdbPub/C/b/24_objc-lang. 1.4 644)
+++ submit-alt.1(w)/gdb/objc-lang.c Fri, 05 Sep 2003 01:24:09 -0700 hilfingr (GdbPub/C/b/24_objc-lang. 1.4.2.1 644)
@@ -83,7 +83,7 @@ struct objc_method {
struct symbol *
lookup_struct_typedef (char *name, struct block *block, int noerr)
{
- register struct symbol *sym;
+ struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
@@ -274,7 +274,7 @@ objc_demangle (const char *mangled, int
for printing characters and strings is language specific. */
static void
-objc_emit_char (register int c, struct ui_file *stream, int quoter)
+objc_emit_char (int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies. */
@@ -337,7 +337,7 @@ static void
objc_printstr (struct ui_file *stream, char *string,
unsigned int length, int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -449,7 +449,7 @@ objc_printstr (struct ui_file *stream, c
static struct type *
objc_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
@@ -703,7 +703,7 @@ static char *msglist_sel;
void
start_msglist(void)
{
- register struct selname *new =
+ struct selname *new =
(struct selname *) xmalloc (sizeof (struct selname));
new->next = selname_chain;
@@ -749,9 +749,9 @@ add_msglist(struct stoken *str, int addc
int
end_msglist(void)
{
- register int val = msglist_len;
- register struct selname *sel = selname_chain;
- register char *p = msglist_sel;
+ int val = msglist_len;
+ struct selname *sel = selname_chain;
+ char *p = msglist_sel;
int selid;
selname_chain = sel->next;
@@ -1533,7 +1533,7 @@ print_object_command (char *args, int fr
{
struct expression *expr = parse_expression (args);
- register struct cleanup *old_chain =
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
int pc = 0;