summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-04-19 22:20:24 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-04-19 22:20:24 +0000
commitdf519d1acbd0b279e6c972ad53eee63dd9d4d5c3 (patch)
tree7b15e162a819900fc8c58005d5250a1a64d18a3e
parentffd33bd186d7f1f1f6d786aad9dd036ffda4469a (diff)
Applied 'const' to a few more char*, where appropriate.
-rw-r--r--flexdef.h2
-rw-r--r--misc.c4
-rw-r--r--parse.y18
-rw-r--r--sym.c14
4 files changed, 19 insertions, 19 deletions
diff --git a/flexdef.h b/flexdef.h
index 113523a..8b82bb3 100644
--- a/flexdef.h
+++ b/flexdef.h
@@ -795,7 +795,7 @@ extern void usage PROTO((void));
/* from file misc.c */
/* Add a #define to the action file. */
-extern void action_define PROTO(( char *defname, int value ));
+extern void action_define PROTO(( const char *defname, int value ));
/* Add the given text to the stored actions. */
extern void add_action PROTO(( char *new_text ));
diff --git a/misc.c b/misc.c
index 35bca5f..55fd07d 100644
--- a/misc.c
+++ b/misc.c
@@ -36,7 +36,7 @@
/* Append "#define defname value\n" to the running buffer. */
void action_define( defname, value )
-char *defname;
+const char *defname;
int value;
{
char buf[MAXLINE];
@@ -523,7 +523,7 @@ int value;
/* myctoi - return the integer represented by a string of digits */
int myctoi( array )
-char *array;
+const char *array;
{
int val = 0;
diff --git a/parse.y b/parse.y
index 26b646b..0645b7a 100644
--- a/parse.y
+++ b/parse.y
@@ -819,7 +819,7 @@ void build_eof_action()
/* format_synerr - write out formatted syntax error */
void format_synerr( msg, arg )
-char msg[], arg[];
+const char *msg, arg[];
{
char errmsg[MAXLINE];
@@ -831,7 +831,7 @@ char msg[], arg[];
/* synerr - report a syntax error */
void synerr( str )
-char str[];
+const char *str;
{
syntaxerror = true;
pinpoint_message( str );
@@ -841,7 +841,7 @@ char str[];
/* format_warn - write out formatted warning */
void format_warn( msg, arg )
-char msg[], arg[];
+const char *msg, arg[];
{
char warn_msg[MAXLINE];
@@ -853,7 +853,7 @@ char msg[], arg[];
/* warn - report a warning, unless -w was given */
void warn( str )
-char str[];
+const char *str;
{
line_warning( str, linenum );
}
@@ -863,7 +863,7 @@ char str[];
*/
void format_pinpoint_message( msg, arg )
-char msg[], arg[];
+const char *msg, arg[];
{
char errmsg[MAXLINE];
@@ -875,7 +875,7 @@ char msg[], arg[];
/* pinpoint_message - write out a message, pinpointing its location */
void pinpoint_message( str )
-char str[];
+const char *str;
{
line_pinpoint( str, linenum );
}
@@ -884,7 +884,7 @@ char str[];
/* line_warning - report a warning at a given line, unless -w was given */
void line_warning( str, line )
-char str[];
+const char *str;
int line;
{
char warning[MAXLINE];
@@ -900,7 +900,7 @@ int line;
/* line_pinpoint - write out a message, pinpointing it at the given line */
void line_pinpoint( str, line )
-char str[];
+const char *str;
int line;
{
fprintf( stderr, "%s: %d: %s\n", infilename, line, str );
@@ -912,6 +912,6 @@ int line;
*/
void yyerror( msg )
-char msg[];
+const char *msg;
{
}
diff --git a/sym.c b/sym.c
index 29c1b6d..4532250 100644
--- a/sym.c
+++ b/sym.c
@@ -62,7 +62,7 @@ static struct hash_entry *ccltab[CCL_HASH_SIZE];
static int addsym PROTO((register char[], char*, int, hash_table, int));
static struct hash_entry *findsym();
-static int hashfunct PROTO((register char[], int));
+static int hashfunct PROTO((register const char*, int));
/* addsym - add symbol and definitions to symbol table
@@ -150,7 +150,7 @@ Char ccltxt[];
/* findsym - find symbol in symbol table */
static struct hash_entry *findsym( sym, table, table_size )
-register char sym[];
+register const char *sym;
hash_table table;
int table_size;
{
@@ -176,7 +176,7 @@ int table_size;
/* hashfunct - compute the hash value for "str" and hash size "hash_size" */
static int hashfunct( str, hash_size )
-register char str[];
+register const char *str;
int hash_size;
{
register int hashval;
@@ -198,7 +198,7 @@ int hash_size;
/* ndinstal - install a name definition */
void ndinstal( name, definition )
-char name[];
+const char *name;
Char definition[];
{
char *copy_string();
@@ -217,7 +217,7 @@ Char definition[];
*/
Char *ndlookup( nd )
-char nd[];
+const char *nd;
{
return (Char *) findsym( nd, ndtbl, NAME_TABLE_HASH_SIZE )->str_val;
}
@@ -246,7 +246,7 @@ void scextend()
*/
void scinstal( str, xcluflg )
-char str[];
+const char *str;
int xcluflg;
{
char *copy_string();
@@ -278,7 +278,7 @@ int xcluflg;
*/
int sclookup( str )
-char str[];
+const char *str;
{
return findsym( str, sctbl, START_COND_HASH_SIZE )->int_val;
}