Browse Source

modifications to avoid warnings when compiling yacc code

Roberto Ierusalimschy 31 years ago
parent
commit
e901e0feae
1 changed files with 11 additions and 3 deletions
  1. 11 3
      lua.stx

+ 11 - 3
lua.stx

@@ -1,6 +1,6 @@
 %{
 
-char *rcs_luastx = "$Id: lua.stx,v 3.9 1994/11/17 21:11:37 roberto Exp roberto $";
+char *rcs_luastx = "$Id: lua.stx,v 3.10 1994/11/22 15:50:46 roberto Exp roberto $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -14,6 +14,14 @@ char *rcs_luastx = "$Id: lua.stx,v 3.9 1994/11/17 21:11:37 roberto Exp roberto $
 #include "table.h"
 #include "lua.h"
 
+
+/* to avoid warnings generated by yacc */
+int yyparse (void);
+#define malloc luaI_malloc
+#define realloc luaI_realloc
+#define free luaI_free
+
+
 #ifndef LISTING
 #define LISTING 0
 #endif
@@ -701,7 +709,7 @@ static void codeIf (Long thenAdd, Long elseAdd)
   code_word_at(basepc+thenAdd+1,elseinit-(thenAdd+sizeof(Word)+1));
 }
 
-void yyerror (char *s)
+static void yyerror (char *s)
 {
  static char msg[256];
  sprintf (msg,"%s near \"%s\" at line %d in file \"%s\"",
@@ -709,7 +717,7 @@ void yyerror (char *s)
  lua_error (msg);
 }
 
-int yywrap (void)
+static int yywrap (void)
 {
  return 1;
 }