Changing varargs into stdarg, and updating the sources accordingly.

This commit is contained in:
Frederic Petrot 2003-09-11 13:07:06 +00:00
parent 6510148d21
commit 502b08d578
4 changed files with 26 additions and 26 deletions

View File

@ -15,7 +15,7 @@
/* traitement des erreur elp */ /* traitement des erreur elp */
/****************************************************************************/ /****************************************************************************/
#include <varargs.h> #include <stdarg.h>
#include "elp.h" #include "elp.h"
@ -36,10 +36,8 @@
/* ------------------- */ /* ------------------- */
/* La fonction renvoie le numero de l'erreur. */ /* La fonction renvoie le numero de l'erreur. */
/*****************************************************************************/ /*****************************************************************************/
elperrorFCT short elpError(errnum,va_alist) elperrorFCT short elpError(errnum, ...)
short errnum ; short errnum ;
va_dcl
{ {
va_list arg ; va_list arg ;
@ -48,7 +46,7 @@ fprintf(stderr,"\n!!! elp error: %d !!!\n",errnum) ;
else else
fprintf(stderr,"\n!!! erreur elp : %d !!!\n",errnum) ; fprintf(stderr,"\n!!! erreur elp : %d !!!\n",errnum) ;
va_start(arg) ; va_start(arg, errnum) ;
switch(errnum) switch(errnum)
{ {
@ -111,6 +109,7 @@ switch(errnum)
va_arg(arg,char *)) ; va_arg(arg,char *)) ;
break ; break ;
} }
va_end(arg);
fflush(stderr) ; fflush(stderr) ;
return errnum ; return errnum ;

View File

@ -27,13 +27,13 @@
/* auteurs : RENAUD & VENOT & PITON */ /* auteurs : RENAUD & VENOT & PITON */
/***************************************************************/ /***************************************************************/
#ident "$Id: ARRAY.c,v 1.2 2002/09/30 16:20:24 czo Exp $" #ident "$Id: ARRAY.c,v 1.3 2003/09/11 13:07:05 fred Exp $"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <varargs.h> #include <stdarg.h>
#include "mut.h" #include "mut.h"
#include "pat.h" #include "pat.h"
@ -49,11 +49,9 @@
/* ###--------------------------------------------------------------### */ /* ###--------------------------------------------------------------### */
void d_ARRAY (va_alist) void d_ARRAY (char *param, ...)
va_dcl
{ {
va_list pa; va_list pa;
char *param;
char buffer [80]; char buffer [80];
char buffer_anx [64]; char buffer_anx [64];
char name [64]; char name [64];
@ -77,11 +75,11 @@ struct alpha_num decomp;
if (GNP_TAB_PAIOL_CREE == GNP_ACTIF) if (GNP_TAB_PAIOL_CREE == GNP_ACTIF)
Erreur ("ARRAY already in descriptive part\n"); Erreur ("ARRAY already in descriptive part\n");
va_start(pa);
param = va_arg(pa, char *);
if (param == NULL) if (param == NULL)
Erreur ("ARRAY needs any parameters\n"); Erreur ("ARRAY needs any parameters\n");
va_start(pa, param);
strcpy (buffer,param); strcpy (buffer,param);
KillEsp (buffer); KillEsp (buffer);

View File

@ -30,6 +30,9 @@
* is provided. * * is provided. *
* Updates : AUGUST, 12th 2002, Pierre Nguyen Tuong * * Updates : AUGUST, 12th 2002, Pierre Nguyen Tuong *
* $Log: alc_pars_l6.c,v $ * $Log: alc_pars_l6.c,v $
* Revision 1.8 2003/09/11 13:07:06 fred
* Changing varargs into stdarg, and updating the sources accordingly.
*
* Revision 1.7 2003/03/22 16:35:04 ludo * Revision 1.7 2003/03/22 16:35:04 ludo
* Bug fixing: core dump under Solaris 8 64 bits * Bug fixing: core dump under Solaris 8 64 bits
* *
@ -83,7 +86,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <varargs.h> #include <stdarg.h>
#include <math.h> #include <math.h>
#include <mut.h> #include <mut.h>
@ -108,7 +111,7 @@
#define MAL_LOSELF 0x00000800 #define MAL_LOSELF 0x00000800
/* Tampon de lecture */ /* Tampon de lecture */
#define MALBUFMAX 1024 #define MALBUFMAX 8192
/* ptype sur losig -> verification unicite du signal */ /* ptype sur losig -> verification unicite du signal */
#define MALDEFINED 11223344 #define MALDEFINED 11223344
@ -1283,16 +1286,15 @@ chain_list *head;
/******************************************************************************/ /******************************************************************************/
void mal_error( va_alist ) void mal_error( char *fname, ... )
va_dcl
{ {
va_list index; va_list index;
char *fmt;
char *fname; char *fname;
int line; int line;
char *func; char *func;
char *fmt;
va_start( index ); va_start( fname, index );
fname = va_arg( index, char* ); fname = va_arg( index, char* );
line = va_arg( index, int ); line = va_arg( index, int );
func = va_arg( index, char* ); func = va_arg( index, char* );
@ -1308,6 +1310,8 @@ va_dcl
); );
vfprintf( stderr, fmt, index ); vfprintf( stderr, fmt, index );
va_end( index );
EXIT(1); EXIT(1);
} }

View File

@ -38,7 +38,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <varargs.h> #include <stdarg.h>
#include <time.h> #include <time.h>
#include <ctype.h> #include <ctype.h>
#include <mut.h> #include <mut.h>
@ -906,16 +906,13 @@ lofig_list *ptfig;
} }
} }
void tooutput( va_alist ) void tooutput( FILE *fd, ... )
va_dcl
{ {
va_list index; va_list index;
FILE *fd;
char *fmt; char *fmt;
va_start( index ); va_start( fd, index );
fd = va_arg( index, FILE* );
fmt = va_arg( index, char* ); fmt = va_arg( index, char* );
if( vfprintf( fd, fmt, index ) < 0 ) if( vfprintf( fd, fmt, index ) < 0 )
@ -925,6 +922,8 @@ va_dcl
perror( "System say " ); perror( "System say " );
EXIT( 1 ); EXIT( 1 );
} }
va_end( index );
} }
void spi_vect( s ) void spi_vect( s )