Skip to content

Commit

Permalink
constify strings with logging helper funcs
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Frysinger <vapier@gmail.com>
  • Loading branch information
vapier committed Dec 2, 2018
1 parent afcf2f4 commit c99935d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions hocdecl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/

extern int yylex( void) ;
extern void execerror( char *, char *) ;
extern void execerror(const char *, const char *);
extern void fpecatch( int ) ;
extern void yyerror( char *) ;
extern void warning( char *, char *) ;
extern void yyerror(const char *);
extern void warning(const char *, const char *);

/*
** function in INIT.C
Expand All @@ -30,7 +30,7 @@ extern double Exp(double x);
extern double Pow(double x,double y);
extern double integer(double x);
extern double Sqrt(double x);
extern double errcheck( double, char *) ;
extern double errcheck(double, const char *);
extern double f2c(double d);
extern double c2f(double d);
extern double in2mm(double d);
Expand Down
2 changes: 1 addition & 1 deletion math.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ double Sqrt( double x)
return errcheck( sqrt(x), "sqrt") ;
}

double errcheck( double d, char *s)
double errcheck(double d, const char *s)
{
if (errno == EDOM) {
errno = 0 ;
Expand Down
8 changes: 4 additions & 4 deletions pcalc.y
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int main(int argc, char *argv[])
/*-------------------------------------------------------------------------
** EXECERROR
*/
void execerror( char *s, char *t)
void execerror(const char *s, const char *t)
{
warning( s, t) ;
longjmp( begin, 0) ;
Expand All @@ -269,17 +269,17 @@ void fpecatch( int aa)
/*-------------------------------------------------------------------------
** YYERROR
*/
void yyerror( char *s) /* called by yacc syntax error */
void yyerror(const char *s) /* called by yacc syntax error */
{
warning( s, (char *) 0) ;
warning(s, NULL);
exit(0);
}

/*-------------------------------------------------------------------------
** WARNING
*/

void warning( char *s, char *t)
void warning(const char *s, const char *t)
{
fprintf( stderr, "%s: %s", progname, s) ;

Expand Down

0 comments on commit c99935d

Please sign in to comment.