From 110bdc6b3e807bd672bf3b1113d01d71744a797a Mon Sep 17 00:00:00 2001 From: zoulasc Date: Thu, 6 Feb 2020 14:25:36 -0500 Subject: misc fixes (#69) * Add a test for german case folding. * Add a function to copy a string with a string with a larger allocation (to be used by the case folding routines) * Add printf attributes to the printf-like functions and fix one format warning * Cleanup the tempfree macro * make more functions static * rename fp to frp (FRame Pointer) to avoid shadowing with fp (File Pointer). * add more const * fix indent in UPLUS case * add locale-aware case folding * make nfiles size_t * fix bugs in file closing: - compare fclose to EOF and pclose to -1 - use nfiles instead of FOPEN_MAX in closeall - don't close files we did not open (0,1,2) fpurge/fflush instead * - use NUL instead of 0 for char comparisons - add ISWS() macro - use continue; instead of ; * Check for existance of the german locale before using it. * Add missing parentheses, thanks Arnold. --- proto.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'proto.h') diff --git a/proto.h b/proto.h index 6918e1f..aac2547 100644 --- a/proto.h +++ b/proto.h @@ -111,6 +111,7 @@ extern double getfval(Cell *); extern char *getsval(Cell *); extern char *getpssval(Cell *); /* for print */ extern char *tostring(const char *); +extern char *tostringN(const char *, size_t); extern char *qstring(const char *, int); extern Cell *catstr(Cell *, Cell *); @@ -135,9 +136,12 @@ extern void yyerror(const char *); extern void fpecatch(int); extern void bracecheck(void); extern void bcheck2(int, int, int); -extern void SYNTAX(const char *, ...); -extern void FATAL(const char *, ...) __attribute__((__noreturn__)); -extern void WARNING(const char *, ...); +extern void SYNTAX(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); +extern void FATAL(const char *, ...) + __attribute__((__format__(__printf__, 1, 2), __noreturn__)); +extern void WARNING(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); extern void error(void); extern void eprint(void); extern void bclass(int); -- cgit v1.2.3