diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-07-10 17:28:17 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-07-10 17:28:17 +0000 |
commit | b440e6f31f70cf106237e6ba3e0aeb7044a684e6 (patch) | |
tree | bde0ed3c37a4afc5379aadda8f120efd72c4a3d2 | |
parent | e1381c06b8d23a558a761f3359b203f264df0b9d (diff) |
First of some clean-up commits. This one only removes use of
register variables. clean-up concept ok deraadt@
-rw-r--r-- | gnu/usr.bin/ld/ld.c | 146 | ||||
-rw-r--r-- | gnu/usr.bin/ld/ld.h | 6 | ||||
-rw-r--r-- | gnu/usr.bin/ld/ldconfig/ldconfig.c | 6 | ||||
-rw-r--r-- | gnu/usr.bin/ld/lib.c | 47 | ||||
-rw-r--r-- | gnu/usr.bin/ld/rtld/malloc.c | 30 | ||||
-rw-r--r-- | gnu/usr.bin/ld/rtld/md-prologue.c | 6 | ||||
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 26 | ||||
-rw-r--r-- | gnu/usr.bin/ld/shlib.c | 8 | ||||
-rw-r--r-- | gnu/usr.bin/ld/sparc/md-static-funcs.c | 6 | ||||
-rw-r--r-- | gnu/usr.bin/ld/sparc/md.c | 4 | ||||
-rw-r--r-- | gnu/usr.bin/ld/symbol.c | 14 | ||||
-rw-r--r-- | gnu/usr.bin/ld/warnings.c | 17 |
12 files changed, 157 insertions, 159 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index 2cb5b50240a..bb2495a7bca 100644 --- a/gnu/usr.bin/ld/ld.c +++ b/gnu/usr.bin/ld/ld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ld.c,v 1.23 2002/06/04 00:10:58 deraadt Exp $ */ +/* $OpenBSD: ld.c,v 1.24 2002/07/10 17:28:15 marc Exp $ */ /* $NetBSD: ld.c,v 1.52 1998/02/20 03:12:51 jonathan Exp $ */ /*- @@ -432,7 +432,7 @@ main(argc, argv) static int classify_arg(arg) - register char *arg; + char *arg; { if (*arg != '-') return 0; @@ -498,8 +498,8 @@ decode_command(argc, argv) int argc; char **argv; { - register int i; - register struct file_entry *p; + int i; + struct file_entry *p; number_of_files = 0; output_filename = "a.out"; @@ -511,7 +511,7 @@ decode_command(argc, argv) */ for (i = 1; i < argc; i++) { - register int code = classify_arg(argv[i]); + int code = classify_arg(argv[i]); if (code) { if (i + code > argc) errx(1, "no argument following %s", argv[i]); @@ -537,8 +537,8 @@ decode_command(argc, argv) /* All options except -A, -B and -l are ignored here. */ for (i = 1; i < argc; i++) { - char *string; - register int code = classify_arg(argv[i]); + char *string; + int code = classify_arg(argv[i]); if (code == 0) { p->filename = argv[i]; @@ -650,7 +650,7 @@ set_element_prefixed_p(name) static void decode_option(swt, arg) - register char *swt, *arg; + char *swt, *arg; { if (!strcmp(swt + 1, "Bstatic")) return; @@ -816,7 +816,7 @@ do_rpath: case 'u': { - register symbol *sp = getsym(arg); + symbol *sp = getsym(arg); if (!sp->defined && !(sp->flags & GS_REFERENCED)) undefined_global_sym_count++; @@ -841,7 +841,7 @@ do_rpath: case 'y': { - register symbol *sp = getsym(&swt[2]); + symbol *sp = getsym(&swt[2]); sp->flags |= GS_TRACE; } return; @@ -878,14 +878,14 @@ do_rpath: void each_file(function, arg) - register void (*function)(); - register void *arg; + void (*function)(); + void *arg; { - register int i; + int i; for (i = 0; i < number_of_files; i++) { - register struct file_entry *entry = &file_table[i]; - register struct file_entry *subentry; + struct file_entry *entry = &file_table[i]; + struct file_entry *subentry; if (entry->flags & E_SCRAPPED) continue; @@ -931,18 +931,18 @@ each_file(function, arg) unsigned long check_each_file(function, arg) - register unsigned long (*function)(); - register void *arg; + unsigned long (*function)(); + void *arg; { - register int i; - register unsigned long return_val; + int i; + unsigned long return_val; for (i = 0; i < number_of_files; i++) { - register struct file_entry *entry = &file_table[i]; + struct file_entry *entry = &file_table[i]; if (entry->flags & E_SCRAPPED) continue; if (entry->flags & E_IS_LIBRARY) { - register struct file_entry *subentry = entry->subfiles; + struct file_entry *subentry = entry->subfiles; for (; subentry; subentry = subentry->chain) { if (subentry->flags & E_SCRAPPED) continue; @@ -959,14 +959,14 @@ check_each_file(function, arg) void each_full_file(function, arg) - register void (*function)(); - register void *arg; + void (*function)(); + void *arg; { - register int i; + int i; for (i = 0; i < number_of_files; i++) { - register struct file_entry *entry = &file_table[i]; - register struct file_entry *subentry; + struct file_entry *entry = &file_table[i]; + struct file_entry *subentry; if (entry->flags & (E_SCRAPPED | E_JUST_SYMS)) continue; @@ -1021,9 +1021,9 @@ file_close() */ int file_open(entry) - register struct file_entry *entry; + struct file_entry *entry; { - register int fd; + int fd; if (entry->superfile && (entry->superfile->flags & E_IS_LIBRARY)) return file_open(entry->superfile); @@ -1070,7 +1070,7 @@ read_header(fd, entry) int fd; struct file_entry *entry; { - register int len; + int len; if (lseek(fd, entry->starting_offset, L_SET) != entry->starting_offset) @@ -1185,7 +1185,7 @@ read_entry_relocation(fd, entry) int fd; struct file_entry *entry; { - register struct relocation_info *reloc; + struct relocation_info *reloc; off_t pos; if (!entry->textrel) { @@ -1281,10 +1281,10 @@ load_symbols() void read_file_symbols(entry) - register struct file_entry *entry; + struct file_entry *entry; { - register int fd; - register int len; + int fd; + int len; struct exec hdr; fd = file_open(entry); @@ -1357,7 +1357,7 @@ enter_file_symbols(entry) lspend = entry->symbols + entry->nsymbols; for (lsp = entry->symbols; lsp < lspend; lsp++) { - register struct nlist *p = &lsp->nzlist.nlist; + struct nlist *p = &lsp->nzlist.nlist; if (p->n_type == (N_SETV | N_EXT)) continue; @@ -1436,9 +1436,9 @@ enter_global_ref(lsp, name, entry) char *name; struct file_entry *entry; { - register struct nzlist *nzp = &lsp->nzlist; - register symbol *sp = getsym(name); - register int type = nzp->nz_type; + struct nzlist *nzp = &lsp->nzlist; + symbol *sp = getsym(name); + int type = nzp->nz_type; int oldref = (sp->flags & GS_REFERENCED); int olddef = sp->defined; int com = sp->defined && sp->common_size; @@ -1647,7 +1647,7 @@ enter_global_ref(lsp, name, entry) text_start = nzp->nz_value; if (sp->flags & GS_TRACE) { - register char *reftype; + char *reftype; switch (type & N_TYPE) { case N_UNDF: reftype = nzp->nz_value @@ -1699,7 +1699,7 @@ enter_global_ref(lsp, name, entry) unsigned long contains_symbol(entry, np) struct file_entry *entry; - register struct nlist *np; + struct nlist *np; { if (np >= &entry->symbols->nzlist.nlist && np < &(entry->symbols + entry->nsymbols)->nzlist.nlist) @@ -1933,8 +1933,8 @@ digest_pass1() continue; for (lsp = sp->refs; lsp; lsp = lsp->next) { - register struct nlist *p = &lsp->nzlist.nlist; - register int type = p->n_type; + struct nlist *p = &lsp->nzlist.nlist; + int type = p->n_type; if (SET_ELEMENT_P(type)) { if (relocatable_output) @@ -2028,8 +2028,8 @@ digest_pass1() spsave=sp; /*XXX*/ again: for (lsp = sp->sorefs; lsp; lsp = lsp->next) { - register struct nlist *p = &lsp->nzlist.nlist; - register int type = p->n_type; + struct nlist *p = &lsp->nzlist.nlist; + int type = p->n_type; if ((type & N_EXT) && type != (N_UNDF | N_EXT) && (type & N_TYPE) != N_FN) { @@ -2308,9 +2308,9 @@ consider_relocation(entry, dataseg) */ static void consider_local_symbols(entry) - register struct file_entry *entry; + struct file_entry *entry; { - register struct localsymbol *lsp, *lspend; + struct localsymbol *lsp, *lspend; if (entry->flags & E_DYNAMIC) return; @@ -2323,8 +2323,8 @@ consider_local_symbols(entry) */ for (lsp = entry->symbols; lsp < lspend; lsp++) { - register struct nlist *p = &lsp->nzlist.nlist; - register int type = p->n_type; + struct nlist *p = &lsp->nzlist.nlist; + int type = p->n_type; if (type == N_WARNING) continue; @@ -2379,7 +2379,7 @@ consider_local_symbols(entry) */ static void consider_file_section_lengths(entry) - register struct file_entry *entry; + struct file_entry *entry; { entry->text_start_address = text_size; @@ -2401,9 +2401,9 @@ consider_file_section_lengths(entry) */ static void relocate_file_addresses(entry) - register struct file_entry *entry; + struct file_entry *entry; { - register struct localsymbol *lsp, *lspend; + struct localsymbol *lsp, *lspend; entry->text_start_address += text_start; /* @@ -2421,8 +2421,8 @@ printf("%s: datastart: %#x, bss %#x\n", get_file_name(entry), lspend = entry->symbols + entry->nsymbols; for (lsp = entry->symbols; lsp < lspend; lsp++) { - register struct nlist *p = &lsp->nzlist.nlist; - register int type = p->n_type; + struct nlist *p = &lsp->nzlist.nlist; + int type = p->n_type; /* * If this belongs to a section, update it @@ -2788,8 +2788,8 @@ void copy_text(entry) struct file_entry *entry; { - register char *bytes; - register int fd; + char *bytes; + int fd; if (trace_files) prline_file_name(entry, stderr); @@ -2863,8 +2863,8 @@ void copy_data(entry) struct file_entry *entry; { - register char *bytes; - register int fd; + char *bytes; + int fd; if (trace_files) prline_file_name (entry, stderr); @@ -2908,8 +2908,8 @@ perform_relocation(data, data_size, reloc, nreloc, entry, dataseg) int dataseg; { - register struct relocation_info *r = reloc; - struct relocation_info *end = reloc + nreloc; + struct relocation_info *r = reloc; + struct relocation_info *end = reloc + nreloc; int text_relocation = entry->text_start_address; int data_relocation = entry->data_start_address - entry->header.a_text; @@ -3231,14 +3231,14 @@ static void coptxtrel(entry) struct file_entry *entry; { - register struct relocation_info *r, *end; - register int reloc = entry->text_start_address; + struct relocation_info *r, *end; + int reloc = entry->text_start_address; r = entry->textrel; end = r + entry->ntextrel; for (; r < end; r++) { - register int symindex; + int symindex; struct localsymbol *lsp; symbol *sp; @@ -3296,21 +3296,21 @@ static void copdatrel(entry) struct file_entry *entry; { - register struct relocation_info *r, *end; + struct relocation_info *r, *end; /* * Relocate the address of the relocation. Old address is relative to * start of the input file's data section. New address is relative to * start of the output file's data section. */ - register int reloc = entry->data_start_address - text_size; + int reloc = entry->data_start_address - text_size; r = entry->datarel; end = r + entry->ndatarel; for (; r < end; r++) { - register int symindex; - symbol *sp; - int symtype; + int symindex; + symbol *sp; + int symtype; RELOC_ADDRESS(r) += reloc; @@ -3395,8 +3395,8 @@ static int assign_string_table_index(name) char *name; { - register int index = strtab_size; - register int len = strlen(name) + 1; + int index = strtab_size; + int len = strlen(name) + 1; strtab_size += len; strtab_vector[strtab_index] = name; @@ -3413,7 +3413,7 @@ assign_string_table_index(name) void write_string_table() { - register int i; + int i; if (fseek(outstream, strtab_offset + strtab_len, SEEK_SET) != 0) err(1, "write_string_table: %s: fseek", output_filename); @@ -3440,7 +3440,7 @@ write_syms() struct nlist *buf = (struct nlist *) alloca(global_sym_count * sizeof(struct nlist)); /* Pointer for storing into BUF. */ - register struct nlist *bufp = buf; + struct nlist *bufp = buf; /* Size of string table includes the bytes that store the size. */ strtab_size = sizeof strtab_size; @@ -3714,7 +3714,7 @@ write_file_syms(entry, syms_written_addr) struct nlist *buf = (struct nlist *) alloca(max_syms * sizeof(struct nlist)); - register struct nlist *bufp = buf; + struct nlist *bufp = buf; if (entry->flags & E_DYNAMIC) return; @@ -3750,7 +3750,7 @@ write_file_syms(entry, syms_written_addr) lspend = entry->symbols + entry->nsymbols; for (lsp = entry->symbols; lsp < lspend; lsp++) { - register struct nlist *p = &lsp->nzlist.nlist; + struct nlist *p = &lsp->nzlist.nlist; char *name; if (!(lsp->flags & LS_WRITE)) @@ -3856,7 +3856,7 @@ padfile(padding, fd) int padding; FILE *fd; { - register char *buf; + char *buf; if (padding <= 0) return; diff --git a/gnu/usr.bin/ld/ld.h b/gnu/usr.bin/ld/ld.h index eba9d5f96b5..97aafb54f81 100644 --- a/gnu/usr.bin/ld/ld.h +++ b/gnu/usr.bin/ld/ld.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ld.h,v 1.8 2002/05/24 06:08:52 ericj Exp $ */ +/* $OpenBSD: ld.h,v 1.9 2002/07/10 17:28:16 marc Exp $ */ /*- * This code is derived from software copyrighted by the Free Software @@ -424,8 +424,8 @@ typedef struct glosym { extern symbol *symtab[]; #define FOR_EACH_SYMBOL(i,sp) { \ int i; \ - for (i = 0; i < SYMTABSIZE; i++) { \ - register symbol *sp; \ + for (i = 0; i < SYMTABSIZE; i++) { \ + symbol *sp; \ for (sp = symtab[i]; sp; sp = sp->link) #define END_EACH_SYMBOL }} diff --git a/gnu/usr.bin/ld/ldconfig/ldconfig.c b/gnu/usr.bin/ld/ldconfig/ldconfig.c index 8887f06fb9f..0c40b823e6c 100644 --- a/gnu/usr.bin/ld/ldconfig/ldconfig.c +++ b/gnu/usr.bin/ld/ldconfig/ldconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldconfig.c,v 1.9 2000/06/28 15:32:40 form Exp $ */ +/* $OpenBSD: ldconfig.c,v 1.10 2002/07/10 17:28:16 marc Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -187,8 +187,8 @@ int silent; } while ((dp = readdir(dd)) != NULL) { - register int n; - register char *cp; + int n; + char *cp; /* Check for `lib' prefix */ if (dp->d_name[0] != 'l' || diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c index 1b06a17cd65..ae505d4ed41 100644 --- a/gnu/usr.bin/ld/lib.c +++ b/gnu/usr.bin/ld/lib.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: lib.c,v 1.5 2002/04/17 15:33:16 espie Exp $ - library routines*/ +/* * $OpenBSD: lib.c,v 1.6 2002/07/10 17:28:16 marc Exp $ - library routines*/ /* */ @@ -40,9 +40,9 @@ search_library(fd, entry) int fd; struct file_entry *entry; { - int member_length; - register char *name; - register struct file_entry *subentry; + int member_length; + char *name; + struct file_entry *subentry; if (!(link_mode & FORCEARCHIVE) && !undefined_global_sym_count) return; @@ -78,12 +78,12 @@ decode_library_subfile(fd, library_entry, subfile_offset, length_loc) int *length_loc; { int bytes_read; - register int namelen; + int namelen; int member_length, content_length; int starting_offset; - register char *name; + char *name; struct ar_hdr hdr1; - register struct file_entry *subentry; + struct file_entry *subentry; lseek(fd, subfile_offset, 0); @@ -172,13 +172,13 @@ symdef_library(fd, entry, member_length) int member_length; { int *symdef_data = (int *) xmalloc(member_length); - register struct ranlib *symdef_base; + struct ranlib *symdef_base; char *sym_name_base; int nsymdefs; int length_of_strings; int not_finished; int bytes_read; - register int i; + int i; struct file_entry *prev = 0; int prev_offset = 0; @@ -207,7 +207,7 @@ symdef_library(fd, entry, member_length) /* Check all the string indexes for validity. */ md_swapin_ranlib_hdr(symdef_base, nsymdefs); for (i = 0; i < nsymdefs; i++) { - register int index = symdef_base[i].ran_un.ran_strx; + int index = symdef_base[i].ran_un.ran_strx; if (index < 0 || index >= length_of_strings || (index && *(sym_name_base + index - 1))) errx(1, "%s: malformatted __.SYMDEF", @@ -235,10 +235,10 @@ symdef_library(fd, entry, member_length) undefined_global_sym_count || common_defined_global_count)); i++) { - register symbol *sp; - int junk; - register int j; - register int offset = symdef_base[i].ran_off; + symbol *sp; + int junk; + int j; + int offset = symdef_base[i].ran_off; struct file_entry *subentry; @@ -362,14 +362,14 @@ linear_library(fd, entry) int fd; struct file_entry *entry; { - register struct file_entry *prev = 0; - register int this_subfile_offset = SARMAG; + struct file_entry *prev = 0; + int this_subfile_offset = SARMAG; while ((link_mode & FORCEARCHIVE) || undefined_global_sym_count || common_defined_global_count) { int member_length; - register struct file_entry *subentry; + struct file_entry *subentry; subentry = decode_library_subfile(fd, entry, this_subfile_offset, &member_length); @@ -416,16 +416,16 @@ subfile_wanted_p(entry) { struct localsymbol *lsp, *lspend; #ifdef DOLLAR_KLUDGE - register int dollar_cond = 0; + int dollar_cond = 0; #endif lspend = entry->symbols + entry->nsymbols; for (lsp = entry->symbols; lsp < lspend; lsp++) { - register struct nlist *p = &lsp->nzlist.nlist; - register int type = p->n_type; - register char *name = p->n_un.n_strx + entry->strings; - register symbol *sp = getsym_soft(name); + struct nlist *p = &lsp->nzlist.nlist; + int type = p->n_type; + char *name = p->n_un.n_strx + entry->strings; + symbol *sp = getsym_soft(name); /* * If the symbol has an interesting definition, we could @@ -845,8 +845,7 @@ dot_a: fname = concat("lib", p->filename, ".a"); for (i = 0; i < n_search_dirs; i++) { - register char *path - = concat(search_dirs[i], "/", fname); + char *path = concat(search_dirs[i], "/", fname); fd = open(path, O_RDONLY, 0); if (fd >= 0) { p->filename = path; diff --git a/gnu/usr.bin/ld/rtld/malloc.c b/gnu/usr.bin/ld/rtld/malloc.c index cb0ff48e0e8..4e09f9cb48e 100644 --- a/gnu/usr.bin/ld/rtld/malloc.c +++ b/gnu/usr.bin/ld/rtld/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.2 1998/03/26 19:47:22 niklas Exp $ */ +/* $OpenBSD: malloc.c,v 1.3 2002/07/10 17:28:16 marc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/ -static char *rcsid = "$OpenBSD: malloc.c,v 1.2 1998/03/26 19:47:22 niklas Exp $"; +static char *rcsid = "$OpenBSD: malloc.c,v 1.3 2002/07/10 17:28:16 marc Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -153,9 +153,9 @@ void * malloc(nbytes) size_t nbytes; { - register union overhead *op; - register int bucket, n; - register unsigned amt; + union overhead *op; + int bucket, n; + unsigned amt; /* * First time malloc is called, setup page size and @@ -239,8 +239,8 @@ static void morecore(bucket) int bucket; { - register union overhead *op; - register int sz; /* size of desired block */ + union overhead *op; + int sz; /* size of desired block */ int amt; /* amount to allocate */ int nblks; /* how many blocks we get */ @@ -283,8 +283,8 @@ void free(cp) void *cp; { - register int size; - register union overhead *op; + int size; + union overhead *op; if (cp == NULL) return; @@ -326,8 +326,8 @@ realloc(cp, nbytes) void *cp; size_t nbytes; { - register u_int onb; - register int i; + u_int onb; + int i; union overhead *op; char *res; int was_alloced = 0; @@ -397,8 +397,8 @@ findbucket(freep, srchlen) union overhead *freep; int srchlen; { - register union overhead *p; - register int i, j; + union overhead *p; + int i, j; for (i = 0; i < NBUCKETS; i++) { j = 0; @@ -422,8 +422,8 @@ findbucket(freep, srchlen) mstats(s) char *s; { - register int i, j; - register union overhead *p; + int i, j; + union overhead *p; int totfree = 0, totused = 0; diff --git a/gnu/usr.bin/ld/rtld/md-prologue.c b/gnu/usr.bin/ld/rtld/md-prologue.c index 8b8159f7b17..1422bec291d 100644 --- a/gnu/usr.bin/ld/rtld/md-prologue.c +++ b/gnu/usr.bin/ld/rtld/md-prologue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md-prologue.c,v 1.2 1998/03/26 19:47:25 niklas Exp $ */ +/* $OpenBSD: md-prologue.c,v 1.3 2002/07/10 17:28:16 marc Exp $ */ /* * rtld entry pseudo code - turn into assembler and tweak it @@ -19,8 +19,8 @@ rtld_entry(version, crtp) int version; struct crt *crtp; { - register struct link_dynamic *dp; - register void (*f)(); + struct link_dynamic *dp; + void (*f)(); /* __DYNAMIC is first entry in GOT */ dp = (struct link_dynamic *) (_GOT_[0]+crtp->crt_ba); diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index 054dd20eb86..c0b59ffdb1e 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld.c,v 1.23 2002/06/03 09:28:07 deraadt Exp $ */ +/* $OpenBSD: rtld.c,v 1.24 2002/07/10 17:28:16 marc Exp $ */ /* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -202,7 +202,7 @@ static void preload __P((char *)); static void ld_trace __P((struct so_map *)); static inline int -strcmp (register const char *s1, register const char *s2) +strcmp (const char *s1, const char *s2) { while (*s1 == *s2++) if (*s1++ == 0) @@ -247,7 +247,7 @@ rtld(version, crtp, dp) /* Relocate ourselves */ for (reloc = (struct relocation_info *)(LD_REL(dp) + crtp->crt_ba); nreloc; nreloc--, reloc++) { - register long addr = reloc->r_address + crtp->crt_ba; + long addr = reloc->r_address + crtp->crt_ba; md_relocate_simple(reloc, crtp->crt_ba, addr); } @@ -881,8 +881,8 @@ static inline int hash_string(key) const char *key; { - register const char *cp; - register int k; + const char *cp; + int k; cp = key; k = 0; @@ -900,8 +900,8 @@ static inline struct rt_symbol * lookup_rts(key) const char *key; { - register int hashval; - register struct rt_symbol *rtsp; + int hashval; + struct rt_symbol *rtsp; /* Determine which bucket. */ @@ -925,8 +925,8 @@ enter_rts(name, value, type, srcaddr, size, smp) long size; struct so_map *smp; { - register int hashval; - register struct rt_symbol *rtsp, **rpp; + int hashval; + struct rt_symbol *rtsp, **rpp; /* Determine which bucket */ hashval = hash_string(name) % RTC_TABSIZE; @@ -1302,8 +1302,8 @@ rtfindlib(name, major, minor, usehints, ipath) int *usehints; char *ipath; { - register char *cp; - int realminor; + char *cp; + int realminor; if (hheader == NULL) maphints(); @@ -1315,8 +1315,8 @@ rtfindlib(name, major, minor, usehints, ipath) if (ld_library_path || ipath) { /* Prefer paths from some explicit LD_LIBRARY_PATH */ - register char *lpath; - char *dp; + char *lpath; + char *dp; dp = lpath = concat(ld_library_path ? ld_library_path : "", (ld_library_path && ipath) ? ":" : "", diff --git a/gnu/usr.bin/ld/shlib.c b/gnu/usr.bin/ld/shlib.c index be5105d0395..721bc2fbc36 100644 --- a/gnu/usr.bin/ld/shlib.c +++ b/gnu/usr.bin/ld/shlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shlib.c,v 1.10 2000/06/28 15:32:40 form Exp $ */ +/* $OpenBSD: shlib.c,v 1.11 2002/07/10 17:28:16 marc Exp $ */ /* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */ /* @@ -125,7 +125,7 @@ void add_search_path(path) char *path; { - register char *cp, *dup; + char *cp, *dup; if (path == NULL) return; @@ -141,7 +141,7 @@ void remove_search_path(path) char *path; { - register char *cp, *dup; + char *cp, *dup; if (path == NULL) return; @@ -206,7 +206,7 @@ cmpndewey(d1, n1, d2, n2) int d1[], d2[]; int n1, n2; { - register int i; + int i; for (i = 0; i < n1 && i < n2; i++) { if (d1[i] < d2[i]) diff --git a/gnu/usr.bin/ld/sparc/md-static-funcs.c b/gnu/usr.bin/ld/sparc/md-static-funcs.c index 8ef9ac40874..be591b3f9e5 100644 --- a/gnu/usr.bin/ld/sparc/md-static-funcs.c +++ b/gnu/usr.bin/ld/sparc/md-static-funcs.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md-static-funcs.c,v 1.2 1998/03/26 19:47:32 niklas Exp $*/ +/* * $OpenBSD: md-static-funcs.c,v 1.3 2002/07/10 17:28:16 marc Exp $*/ /* * @@ -14,8 +14,8 @@ struct relocation_info *r; long relocation; char *addr; { - register unsigned long mask; - register unsigned long shift; + unsigned long mask; + unsigned long shift; switch (r->r_type) { case RELOC_32: diff --git a/gnu/usr.bin/ld/sparc/md.c b/gnu/usr.bin/ld/sparc/md.c index 38acf60d5d2..1114f7cb6cb 100644 --- a/gnu/usr.bin/ld/sparc/md.c +++ b/gnu/usr.bin/ld/sparc/md.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md.c,v 1.7 1999/05/10 16:20:47 espie Exp $*/ +/* * $OpenBSD: md.c,v 1.8 2002/07/10 17:28:16 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -119,7 +119,7 @@ md_relocate(r, relocation, addr, relocatable_output) unsigned char *addr; int relocatable_output; { - register unsigned long mask; + unsigned long mask; if (relocatable_output) { /* diff --git a/gnu/usr.bin/ld/symbol.c b/gnu/usr.bin/ld/symbol.c index 216d8fe6b3b..70c9ba83f06 100644 --- a/gnu/usr.bin/ld/symbol.c +++ b/gnu/usr.bin/ld/symbol.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: symbol.c,v 1.4 1999/08/24 19:05:16 niklas Exp $ - symbol table routines*/ +/* * $OpenBSD: symbol.c,v 1.5 2002/07/10 17:28:16 marc Exp $ - symbol table routines*/ /* */ @@ -77,8 +77,8 @@ int hash_string (key) char *key; { - register char *cp; - register int k; + char *cp; + int k; cp = key; k = 0; @@ -97,8 +97,8 @@ symbol * getsym(key) char *key; { - register int hashval; - register symbol *bp; + int hashval; + symbol *bp; if (strcmp(key, OTHER_SYM) == 0) key = GOT_SYM; @@ -150,8 +150,8 @@ symbol * getsym_soft (key) char *key; { - register int hashval; - register symbol *bp; + int hashval; + symbol *bp; if (strcmp(key, OTHER_SYM) == 0) key = GOT_SYM; diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c index 6dfb5fafd17..73c5eae4e2d 100644 --- a/gnu/usr.bin/ld/warnings.c +++ b/gnu/usr.bin/ld/warnings.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: warnings.c,v 1.4 2000/01/23 14:57:29 espie Exp $*/ +/* * $OpenBSD: warnings.c,v 1.5 2002/07/10 17:28:16 marc Exp $*/ /* */ @@ -155,7 +155,7 @@ list_file_locals (entry, outfile) lspend = entry->symbols + entry->nsymbols; for (lsp = entry->symbols; lsp < lspend; lsp++) { - register struct nlist *p = &lsp->nzlist.nlist; + struct nlist *p = &lsp->nzlist.nlist; /* * If this is a definition, * update it if necessary by this file's start address. @@ -215,12 +215,11 @@ reloc_cmp(rel1, rel2) static int next_debug_entry(use_data_symbols, state_pointer) - register int use_data_symbols; + int use_data_symbols; /* Next must be passed by reference! */ struct line_debug_entry state_pointer[3]; { - register struct line_debug_entry - *current = state_pointer, + struct line_debug_entry *current = state_pointer, *next = state_pointer + 1, /* Used to store source file */ *source = state_pointer + 2; @@ -284,7 +283,7 @@ init_debug_scan(use_data_symbols, entry) int use_data_symbols; struct file_entry *entry; { - register struct localsymbol *lsp, *lspend; + struct localsymbol *lsp, *lspend; struct line_debug_entry *state_pointer, *current, *next, *source; state_pointer = (struct line_debug_entry *) @@ -432,8 +431,8 @@ do_relocation_warnings(entry, data_segment, outfile, nlist_bitvector) qsort(rp, erp - rp, sizeof(rp[0]), reloc_cmp); for (; rp < erp; rp++) { - register struct localsymbol *lsp; - register symbol *g; + struct localsymbol *lsp; + symbol *g; /* * If the relocation isn't resolved through a symbol, continue. @@ -590,7 +589,7 @@ do_file_warnings (entry, outfile) #if 0 /* Check for undefined shobj symbols */ struct localsymbol *lsp; - register int type; + int type; for (lsp = g->sorefs; lsp; lsp = lsp->next) { type = lsp->nzlist.nz_type; |