X-Git-Url: https://git.jankratochvil.net/?p=mdsms.git;a=blobdiff_plain;f=mdsms.c;h=e2b173fc4115a49477051495051ef254ae8a6853;hp=711aee3cec2ad444371915f76e1f577589d2bb19;hb=5a2446d9cb2d2af3be2de8aa5cf791dd503d69fe;hpb=9a4df5c3cec7a35cc8e22efb86c212a75a90c395 diff --git a/mdsms.c b/mdsms.c index 711aee3..e2b173f 100644 --- a/mdsms.c +++ b/mdsms.c @@ -69,6 +69,13 @@ static char rcsid[] ATTR_UNUSED = "$Id$"; #include "getopt.h" #endif + +/* Always override possible system defintions as it is safe (used by glib) */ +#undef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#undef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) + #define NELEM(x) (sizeof((x))/sizeof(*(x))) #ifndef DEBUG @@ -866,7 +873,7 @@ static const char *record,*recordend; static char *catchdata; static size_t catchdatal,catchdatasiz; -static char *reform(const char *s,int slot); +static const char *reform(const char *s,int slot); static void catched(const char *end,char edata) { size_t len; @@ -896,7 +903,7 @@ static void retrying(void) if (verbose>=2) error(_(".Retrying phase, %d out of %ld.."),retrycnt,maxretryn); } -static char *reform(const char *s,int slot) +static const char *reform(const char *s,int slot) { static struct formslot { char *s; @@ -1514,8 +1521,8 @@ retry: static char *check_format(const char *fmt,const char *string) { static char err[LINE_MAX],sub[50]; -char *subp,cf,cs; -const char *sf,*ss; +char cf,cs; +const char *sf,*ss,*subp; for (sf=fmt,ss=string;(cf=*sf) && (cs=*ss);sf++,ss++) { subp=NULL;