Description: Fix build error
Author: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Origin: vendor
Forwarded: no
Last-Update: 2012-05-11
--- a/src/mwrap.y
+++ b/src/mwrap.y
@@ -15,7 +15,7 @@
 extern "C" {
     int yylex();
     int yywrap();
-    int yyerror(char* s);
+    int yyerror(const char* s);
 }
 
 using std::string;
@@ -33,7 +33,7 @@
 static int    func_id = 0;              // Assign stub numbers
 static Func*  funcs   = 0;              // AST - linked list of functions
 static Func*  lastfunc = 0;             // Last link in funcs list
-static char*  mexfunc = "mexfunction";  // Name of mex function
+static const char*  mexfunc = "mexfunction";  // Name of mex function
 static string current_ifname;           // Current input file name
 
 
@@ -230,7 +230,7 @@
     return 1;
 }
 
-int yyerror(char* s)
+int yyerror(const char* s)
 {
     fprintf(stderr, "Parse error (%s:%d): %s\n", current_ifname.c_str(),
             linenum, s);
@@ -265,7 +266,7 @@
     init_scalar_types();
 
     if (argc == 1) {
-        fprintf(stderr, help_string);
+        fputs(help_string, stderr);
         return 0;
     } else {
         for (j = 1; j < argc; ++j) {
--- a/src/mwrap-cgen.cc
+++ b/src/mwrap-cgen.cc
@@ -1329,8 +1329,8 @@
 
 void print_mex_file(FILE* fp, Func* f)
 {
-    fprintf(fp, mwrap_banner);
-    fprintf(fp, mex_header);
+    fputs(mwrap_banner, fp);
+    fputs(mex_header, fp);
 
     if (mw_use_c99_complex)
         mex_c99_complex(fp);
@@ -1346,7 +1346,7 @@
     }
 
     print_mex_stubs(fp, f);
-    fprintf(fp, mexBase);
+    fputs(mexBase, fp);
     print_mex_else_cases(fp, f);
     fprintf(fp, "}\n\n");
 }
