[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: [Main] Delete warnings.
From: |
Pascal Bart |
Subject: |
FYI: [Main] Delete warnings. |
Date: |
Thu, 30 Aug 2001 20:53:19 +0000 (GMT) |
Hello,
This patch deletes any warnings.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.196
diff -u -r1.196 ChangeLog
--- ChangeLog 2001/08/30 00:44:14 1.196
+++ ChangeLog 2001/08/30 18:49:58
@@ -1,3 +1,16 @@
+2001-08-30 Pascal Bart <address@hidden>
+
+ * src/main.c: Include macrotab.h.
+ * src/macrotab.h (macro_entry_s): Constify fields.
+ Adjust functions prototypes.
+ * src/macrotab.c (macro_insert): Constify key and value.
+ (macro_find): Constify key.
+ (macro_insert): Include 'xalloc.h'
+ (macro_insert): Use XMALLOC.
+ (macro_find): Constify return value.
+ * src/output.c (output_table_data): Rename table to table_data.
+ (output_parser): Constify macro_key, macro_value.
+
2001-08-30 Marc Autret <address@hidden>
* src/reader.c (parse_skel_decl): New.
Index: src/macrotab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/macrotab.c,v
retrieving revision 1.3
diff -u -r1.3 macrotab.c
--- src/macrotab.c 2001/08/25 14:21:46 1.3
+++ src/macrotab.c 2001/08/30 18:49:59
@@ -20,6 +20,7 @@
#include <string.h>
+#include "xalloc.h"
#include "system.h"
#include "hash.h"
#include "files.h"
@@ -110,16 +111,16 @@
}
void
-macro_insert (char* key, char* value)
+macro_insert (const char *key, const char *value)
{
- macro_entry_t* pair = (macro_entry_t*) xmalloc (sizeof (macro_entry_t));
+ macro_entry_t* pair = XMALLOC (macro_entry_t, 1);
pair->key = key;
pair->value = value;
hash_insert (¯o_table, pair);
}
-char*
-macro_find (char* key)
+const char*
+macro_find (const char *key)
{
macro_entry_t pair = { key, 0 };
macro_entry_t* result = hash_find_item (¯o_table, &pair);
Index: src/macrotab.h
===================================================================
RCS file: /cvsroot/bison/bison/src/macrotab.h,v
retrieving revision 1.3
diff -u -r1.3 macrotab.h
--- src/macrotab.h 2001/08/25 14:21:46 1.3
+++ src/macrotab.h 2001/08/30 18:49:59
@@ -25,12 +25,12 @@
typedef struct macro_entry_s
{
- char* key;
- char* value;
+ const char* key;
+ const char* value;
} macro_entry_t;
void macro_init PARAMS ((void));
-void macro_insert PARAMS ((char* key, char* value));
-char* macro_find PARAMS ((char* key));
+void macro_insert PARAMS ((const char *key, const char *value));
+const char* macro_find PARAMS ((const char *key));
#endif /* not MACROTAB_H_ */
Index: src/main.c
===================================================================
RCS file: /cvsroot/bison/bison/src/main.c,v
retrieving revision 1.33
diff -u -r1.33 main.c
--- src/main.c 2001/08/25 14:34:41 1.33
+++ src/main.c 2001/08/30 18:49:59
@@ -34,6 +34,7 @@
#include "LR0.h"
#include "conflicts.h"
#include "print_graph.h"
+#include "macrotab.h"
/* The name this program was run with, for messages. */
char *program_name;
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.47
diff -u -r1.47 output.c
--- src/output.c 2001/08/29 14:17:00 1.47
+++ src/output.c 2001/08/30 18:49:59
@@ -130,7 +130,7 @@
static inline void
output_table_data (struct obstack* oout,
- short* table,
+ short* table_data,
short first,
short begin,
short end)
@@ -149,7 +149,7 @@
}
else
++j;
- obstack_fgrow1 (oout, "%6d", table[i]);
+ obstack_fgrow1 (oout, "%6d", table_data[i]);
}
obstack_1grow (oout, 0);
}
@@ -984,8 +984,8 @@
else if ((c = getc (fskel)) == '%')
{
/* Read the macro. */
- char* macro_key = 0;
- char* macro_value = 0;
+ const char* macro_key = 0;
+ const char* macro_value = 0;
while (isalnum (c = getc (fskel)) || c == '_')
obstack_1grow (¯o_obstack, c);
obstack_1grow (¯o_obstack, 0);
Pascal Bart (address@hidden)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: [Main] Delete warnings.,
Pascal Bart <=