diff options
Diffstat (limited to 'usr/src/cmd/tic')
-rw-r--r-- | usr/src/cmd/tic/tic_error.c | 49 | ||||
-rw-r--r-- | usr/src/cmd/tic/tic_hash.c | 19 | ||||
-rw-r--r-- | usr/src/cmd/tic/tic_main.c | 5 | ||||
-rw-r--r-- | usr/src/cmd/tic/tic_parse.c | 61 | ||||
-rw-r--r-- | usr/src/cmd/tic/tic_scan.c | 19 |
5 files changed, 63 insertions, 90 deletions
diff --git a/usr/src/cmd/tic/tic_error.c b/usr/src/cmd/tic/tic_error.c index 13bf098848..e9aeeb3f9b 100644 --- a/usr/src/cmd/tic/tic_error.c +++ b/usr/src/cmd/tic/tic_error.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -87,38 +87,22 @@ */ #include <unistd.h> +#include <stdarg.h> +#include <stdlib.h> #include "compiler.h" -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif extern char *string_table; extern short term_names; extern char *progname; /* VARARGS1 */ -#ifdef __STDC__ void warning(char *fmt, ...) -#else -warning(va_alist) -va_dcl -#endif { -#ifndef __STDC__ - register char *fmt; -#endif va_list args; -#ifdef __STDC__ va_start(args, fmt); -#else - va_start(args); - fmt = va_arg(args, char *); -#endif fprintf(stderr, "%s: Warning: near line %d: ", progname, curr_line); if (string_table != NULL) { fprintf(stderr, "terminal '%s', ", string_table+term_names); @@ -130,24 +114,12 @@ va_dcl /* VARARGS1 */ -#ifdef __STDC__ +void err_abort(char *fmt, ...) -#else -err_abort(va_alist) -va_dcl -#endif { -#ifndef __STDC__ - register char *fmt; -#endif va_list args; -#ifdef __STDC__ va_start(args, fmt); -#else - va_start(args); - fmt = va_arg(args, char *); -#endif fprintf(stderr, "%s: Line %d: ", progname, curr_line); if (string_table != NULL) { fprintf(stderr, "terminal '%s', ", string_table+term_names); @@ -160,25 +132,12 @@ va_dcl /* VARARGS1 */ -#ifdef __STDC__ void syserr_abort(char *fmt, ...) -#else -syserr_abort(va_alist) -va_dcl -#endif { -#ifndef __STDC__ - register char *fmt; -#endif va_list args; -#ifdef __STDC__ va_start(args, fmt); -#else - va_start(args); - fmt = va_arg(args, char *); -#endif fprintf(stderr, "PROGRAM ERROR: Line %d: ", curr_line); if (string_table != NULL) { fprintf(stderr, "terminal '%s', ", string_table+term_names); diff --git a/usr/src/cmd/tic/tic_hash.c b/usr/src/cmd/tic/tic_hash.c index 093d2a036b..aa965a437f 100644 --- a/usr/src/cmd/tic/tic_hash.c +++ b/usr/src/cmd/tic/tic_hash.c @@ -19,11 +19,14 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ - -/* +/* * University Copyright- Copyright (c) 1982, 1986, 1988 * The Regents of the University of California * All Rights Reserved @@ -83,10 +86,12 @@ * */ +#include <strings.h> #include "curses_inc.h" #include "compiler.h" - +static void make_nte(void); +static int hash_function(char *); /* * make_hash_table() @@ -124,9 +129,10 @@ make_hash_table() /* * Make the name_table_entry from the capnames.c set of tables. */ -make_nte() +static void +make_nte(void) { - register int i, n; + int i, n; extern char *boolnames[], *numnames[], *strnames[]; n = 0; @@ -172,8 +178,7 @@ make_nte() * */ -static -int +static int hash_function(char *string) { long sum = 0; diff --git a/usr/src/cmd/tic/tic_main.c b/usr/src/cmd/tic/tic_main.c index c5ddc9b6e7..eac11a7e4a 100644 --- a/usr/src/cmd/tic/tic_main.c +++ b/usr/src/cmd/tic/tic_main.c @@ -20,8 +20,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1996, by Sun Microsystems, Inc. - * All Rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ @@ -105,6 +105,7 @@ extern void compile(); /* should be in a header file :-( */ extern void syserr_abort(); /* should be in a header file :-( */ static void init(); +int main(int argc, char *argv[]) { int i; diff --git a/usr/src/cmd/tic/tic_parse.c b/usr/src/cmd/tic/tic_parse.c index ebbc88dd50..d46ed50520 100644 --- a/usr/src/cmd/tic/tic_parse.c +++ b/usr/src/cmd/tic/tic_parse.c @@ -20,8 +20,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1996-1999 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ @@ -94,6 +94,8 @@ #include <stdio.h> #include <ctype.h> #include <stdlib.h> +#include <strings.h> +#include <unistd.h> #include "curses_inc.h" #include "compiler.h" #include "object.h" @@ -120,6 +122,10 @@ struct use_header { struct use_header use_list = {NULL, NULL}; int use_count = 0; +void dequeue(struct use_item *); +void init_structure(short Booleans[], short Numbers[], short Strings[]); +void dump_structure(short Booleans[], short Numbers[], short Strings[]); + /* * The use_list is a doubly-linked list with NULLs terminating the lists: * @@ -228,8 +234,8 @@ compile() } } -dump_list(str) -char *str; +void +dump_list(char *str) { struct use_item *ptr; char line[512]; @@ -277,8 +283,8 @@ do_entry(item_ptr) struct use_item *item_ptr; { long entry_offset; - register int token_type; - register struct name_table_entry *entry_ptr; + int token_type; + struct name_table_entry *entry_ptr; int found_forward_use = FALSE; short Booleans[MAXBOOLS], Numbers[MAXNUMS], @@ -375,12 +381,10 @@ struct use_item *item_ptr; have to be compatible with the pre-Vr3 format. */ #ifndef NOCANCELCOMPAT -elim_cancellations(Booleans, Numbers, Strings) -short Booleans[]; -short Numbers[]; -short Strings[]; +void +elim_cancellations(short Booleans[], short Numbers[], short Strings[]) { - register int i; + int i; for (i = 0; i < BoolCount; i++) { if (Booleans[i] == -2) Booleans[i] = FALSE; @@ -401,10 +405,10 @@ short Strings[]; Change the cancellation signal from the -2 used internally to the 2 used within the binary. */ -change_cancellations(Booleans) -short Booleans[]; +void +change_cancellations(short Booleans[]) { - register int i; + int i; for (i = 0; i < BoolCount; i++) { if (Booleans[i] == -2) Booleans[i] = 2; @@ -419,8 +423,8 @@ short Booleans[]; * */ -enqueue(offset) -long offset; +void +enqueue(long offset) { struct use_item *item; @@ -451,8 +455,8 @@ long offset; * */ -dequeue(ptr) -struct use_item *ptr; +void +dequeue(struct use_item *ptr) { if (ptr->fptr == NULL) use_list.tail = ptr->bptr; @@ -480,8 +484,8 @@ struct use_item *ptr; * */ -static int invalid_term_name(name) -register char *name; +static int +invalid_term_name(char *name) { int error = 0; if (! isdigit(*name) && ! islower(*name) && ! isupper(*name)) @@ -519,15 +523,13 @@ register char *name; * */ -dump_structure(Booleans, Numbers, Strings) -short Booleans[]; -short Numbers[]; -short Strings[]; +void +dump_structure(short Booleans[], short Numbers[], short Strings[]) { struct stat64 statbuf; FILE *fp; char name_list[1024]; - register char *first_name, *other_names, *cur_name; + char *first_name, *other_names, *cur_name; char filename[128 + 2 + 1]; char linkname[128 + 2 + 1]; int len; @@ -689,9 +691,9 @@ short Strings[]; char *namelist; short namelen; char zero = '\0'; - register int i; + int i; char cBooleans[MAXBOOLS]; - register int l_next_free; + int l_next_free; namelist = term_names + string_table; namelen = strlen(namelist) + 1; @@ -800,9 +802,8 @@ char *string; * */ -init_structure(Booleans, Numbers, Strings) -short Booleans[]; -short Numbers[], Strings[]; +void +init_structure(short Booleans[], short Numbers[], short Strings[]) { int i; diff --git a/usr/src/cmd/tic/tic_scan.c b/usr/src/cmd/tic/tic_scan.c index d669d91ac4..7e8339328d 100644 --- a/usr/src/cmd/tic/tic_scan.c +++ b/usr/src/cmd/tic/tic_scan.c @@ -20,8 +20,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1999 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ @@ -95,6 +95,10 @@ static int first_column; /* See 'next_char()' below */ +static void backspace(void); +void reset_input(void); +void panic_mode(int); + /* @@ -343,12 +347,13 @@ next_char() } -backspace() +static void +backspace(void) { curr_column--; if (curr_column < 0) - syserr_abort("Backspaced off beginning of line"); + syserr_abort("Backspaced off beginning of line"); } @@ -360,7 +365,8 @@ backspace() * */ -reset_input() +void +reset_input(void) { curr_column = -1; } @@ -496,9 +502,10 @@ trans_string(char *ptr) /* * Panic mode error recovery - skip everything until a "ch" is found. */ +void panic_mode(int ch) { - register int c; + int c; for (;;) { c = next_char(); |