Browse Source

replace varargs with stdarg

Michael van Elst 22 years ago
parent
commit
64b654d4da
2 changed files with 51 additions and 3 deletions
  1. 46 0
      lemon/lemon.patch
  2. 5 3
      lemon/lemon.spec

+ 46 - 0
lemon/lemon.patch

@@ -0,0 +1,46 @@
+--- lemon.c.dist	2003-07-18 14:52:02.000000000 +0200
++++ lemon.c	2003-07-18 14:56:02.000000000 +0200
+@@ -26,7 +26,7 @@
+ **   http://www.hwaci.com/drh/
+ */
+ #include <stdio.h>
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <string.h>
+ #include <ctype.h>
+ 
+@@ -89,7 +89,7 @@
+ void Configlist_reset(/* void */);
+ 
+ /********* From the file "error.h" ***************************************/
+-void ErrorMsg( /* char *, int, char *, ... */ );
++void ErrorMsg(char *, int, char *, ... );
+ 
+ /****** From the file "option.h" ******************************************/
+ struct s_options {
+@@ -1108,12 +1108,8 @@
+ #define ERRMSGSIZE  10000 /* Hope this is big enough.  No way to error check */
+ #define LINEWIDTH      79 /* Max width of any output line */
+ #define PREFIXLIMIT    30 /* Max width of the prefix on each line */
+-void ErrorMsg(va_alist)
+-va_dcl
++void ErrorMsg(char *filename, int lineno, char *format, ...)
+ {
+-  char *filename;
+-  int lineno;
+-  char *format;
+   char errmsg[ERRMSGSIZE];
+   char prefix[PREFIXLIMIT+10];
+   int errmsgsize;
+@@ -1122,10 +1118,7 @@
+   va_list ap;
+   int end, restart, base;
+ 
+-  va_start(ap);
+-  filename = va_arg(ap,char*);
+-  lineno = va_arg(ap,int);
+-  format = va_arg(ap,char*);
++  va_start(ap, format);
+   /* Prepare a prefix to be prepended to every output line */
+   if( lineno>0 ){
+     sprintf(prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno);

+ 5 - 3
lemon/lemon.spec

@@ -33,18 +33,19 @@ Distribution: OpenPKG [PLUS]
 Group:        Language
 License:      GPL
 Version:      1.0
-Release:      20020821
+Release:      20030718
 
 #   list of sources
 Source0:      http://www.hwaci.com/sw/lemon/lemon.c
 Source1:      http://www.hwaci.com/sw/lemon/lempar.c
 Source2:      http://www.hwaci.com/sw/lemon/lemon.html
+Patch0:       lemon.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206
-PreReq:       OpenPKG, openpkg >= 20020206
+BuildPreReq:  OpenPKG, openpkg >= 20030717
+PreReq:       OpenPKG, openpkg >= 20030717
 AutoReq:      no
 AutoReqProv:  no
 
@@ -56,6 +57,7 @@ AutoReqProv:  no
 %prep
     %setup -T -c -n lemon-%{version}
     cp %{SOURCE lemon.c} lemon.c
+    %patch -p0
     %{l_shtool} subst \
         -e 's;"lempar.c";"%{l_prefix}/share/lemon/lempar.c";g' \
         lemon.c