diff --git a/src/calendar.c b/src/calendar.c index 4a5e625e..6c7a3d5d 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -588,7 +588,7 @@ static int DoCalRem(ParsePtr p, int col) int jul; CalEntry *CurCol = CalColumn[col]; CalEntry *e; - char *s, *s2; + char const *s, *s2; DynamicBuffer buf, obuf, pre_buf; Token tok; diff --git a/src/dorem.c b/src/dorem.c index 3941360c..52f05b77 100644 --- a/src/dorem.c +++ b/src/dorem.c @@ -555,7 +555,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul) char tmpBuf[64]; DynamicBuffer buf, calRow; DynamicBuffer pre_buf; - char *s; + char const *s; Value v; DBufInit(&buf); @@ -812,7 +812,8 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p) { int iter, jul, r; Value v; - char *s, *t; + char const *s; + char const *t; t = p->pos; iter = 0; @@ -951,7 +952,7 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul) { char buffer[VAR_NAME_LEN+32]; int i; - char *s; + char const *s; int r; Value v; int lastReturnVal = 0; /* Silence compiler warning */ diff --git a/src/dosubst.c b/src/dosubst.c index 8b781268..57b804b3 100644 --- a/src/dosubst.c +++ b/src/dosubst.c @@ -649,7 +649,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, /* default triggers and a mode of NORMAL_MODE. */ /* */ /***************************************************************/ -int DoSubstFromString(char *source, DynamicBuffer *dbuf, +int DoSubstFromString(char const *source, DynamicBuffer *dbuf, int jul, int tim) { Trigger tempTrig; diff --git a/src/dynbuf.c b/src/dynbuf.c index 38ec33c4..16f9ea46 100644 --- a/src/dynbuf.c +++ b/src/dynbuf.c @@ -102,7 +102,7 @@ int DBufPutcFN(DynamicBuffer *dbuf, char c) %DESCRIPTION: Appends a string to the buffer. **********************************************************************/ -int DBufPuts(DynamicBuffer *dbuf, char *str) +int DBufPuts(DynamicBuffer *dbuf, char const *str) { int l = strlen(str); if (!l) return OK; diff --git a/src/dynbuf.h b/src/dynbuf.h index 5c1701cd..0bee3a7e 100644 --- a/src/dynbuf.h +++ b/src/dynbuf.h @@ -25,7 +25,7 @@ typedef struct { void DBufInit(DynamicBuffer *dbuf); int DBufPutcFN(DynamicBuffer *dbuf, char c); -int DBufPuts(DynamicBuffer *dbuf, char *str); +int DBufPuts(DynamicBuffer *dbuf, char const *str); void DBufFree(DynamicBuffer *dbuf); int DBufGets(DynamicBuffer *dbuf, FILE *fp); diff --git a/src/expr.c b/src/expr.c index 248f98c8..33cd17fb 100644 --- a/src/expr.c +++ b/src/expr.c @@ -41,8 +41,8 @@ static int Multiply(void), Divide(void), Mod(void), Add(void), UnMinus(void), LogNot(void), Compare(int); -static int MakeValue (char *s, Value *v, Var *locals); -static int ParseLiteralDate (char **s, int *jul, int *tim); +static int MakeValue (char const *s, Value *v, Var *locals); +static int ParseLiteralDate (char const **s, int *jul, int *tim); /* Binary operators - all left-associative */ @@ -132,9 +132,9 @@ static void CleanStack(void) /* PeekChar - peek ahead to next char. */ /* */ /***************************************************************/ -static char PeekChar(char **s) +static char PeekChar(char const **s) { - char *t = *s; + char const *t = *s; while (*t && isspace(*t)) t++; return *t; } @@ -146,7 +146,7 @@ static char PeekChar(char **s) /* Read a token. */ /* */ /***************************************************************/ -static int ParseExprToken(DynamicBuffer *buf, char **in) +static int ParseExprToken(DynamicBuffer *buf, char const **in) { char c; @@ -266,7 +266,7 @@ static int ParseExprToken(DynamicBuffer *buf, char **in) /* Put the result into value pointed to by v. */ /* */ /***************************************************************/ -int EvalExpr(char **e, Value *v) +int EvalExpr(char const **e, Value *v) { int r; @@ -289,7 +289,7 @@ int EvalExpr(char **e, Value *v) } /* Evaluate - do the actual work of evaluation. */ -int Evaluate(char **s, Var *locals) +int Evaluate(char const **s, Var *locals) { int OpBase, ValBase; int r; @@ -448,7 +448,7 @@ int Evaluate(char **s, Var *locals) /* a date or the value of a symbol. */ /* */ /***************************************************************/ -static int MakeValue(char *s, Value *v, Var *locals) +static int MakeValue(char const *s, Value *v, Var *locals) { int len; int h, m, r; @@ -533,7 +533,7 @@ static int MakeValue(char *s, Value *v, Var *locals) int DoCoerce(char type, Value *v) { int h, d, m, y, i, k; - char *s; + char const *s; /* Do nothing if value is already the right type */ if (type == v->type) return OK; @@ -1154,7 +1154,7 @@ int CopyValue(Value *dest, const Value *src) /* and tim; update s. */ /* */ /***************************************************************/ -static int ParseLiteralDate(char **s, int *jul, int *tim) +static int ParseLiteralDate(char const **s, int *jul, int *tim) { int y, m, d; int hour, min; diff --git a/src/init.c b/src/init.c index 899c3a9f..fab4af41 100644 --- a/src/init.c +++ b/src/init.c @@ -618,7 +618,8 @@ static void ChgUser(char *user) /***************************************************************/ static void InitializeVar(char *str) { - char *varname, *expr; + char const *varname; + char const *expr; Value val; diff --git a/src/main.c b/src/main.c index 1dd3fa09..403eafb1 100644 --- a/src/main.c +++ b/src/main.c @@ -330,7 +330,7 @@ int ParseChar(ParsePtr p, int *err, int peek) return *(p->epos++); } } - free(p->etext); /* End of substituted expression */ + free((void *) p->etext); /* End of substituted expression */ p->etext = NULL; p->epos = NULL; p->isnested = 0; @@ -554,7 +554,7 @@ void OutputLine(FILE *fp) /* Create a parser given a string buffer */ /* */ /***************************************************************/ -void CreateParser(char *s, ParsePtr p) +void CreateParser(char const *s, ParsePtr p) { p->text = s; p->pos = s; @@ -576,7 +576,7 @@ void CreateParser(char *s, ParsePtr p) void DestroyParser(ParsePtr p) { if (p->isnested && p->etext) { - free(p->etext); + free((void *) p->etext); p->etext = NULL; p->isnested = 0; } diff --git a/src/protos.h b/src/protos.h index cdd35f1d..b1f34bce 100644 --- a/src/protos.h +++ b/src/protos.h @@ -18,7 +18,7 @@ #include "dynbuf.h" -int CallUserFunc (char *name, int nargs); +int CallUserFunc (char const *name, int nargs); int DoFset (ParsePtr p); void ProduceCalendar (void); char *SimpleTime (int tim); @@ -30,8 +30,8 @@ int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim); int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul); int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int jul); int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode); -int DoSubstFromString (char *source, DynamicBuffer *dbuf, int jul, int tim); -int EvalExpr (char **e, Value *v); +int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int jul, int tim); +int EvalExpr (char const **e, Value *v); int DoCoerce (char type, Value *v); void PrintValue (Value *v, FILE *fp); int CopyValue (Value *dest, const Value *src); @@ -53,11 +53,11 @@ int ParseChar (ParsePtr p, int *err, int peek); int ParseToken (ParsePtr p, DynamicBuffer *dbuf); int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf); int EvaluateExpr (ParsePtr p, Value *v); -int Evaluate (char **s, Var *locals); +int Evaluate (char const **s, Var *locals); int FnPopValStack (Value *val); void Eprint (const char *fmt, ...); void OutputLine (FILE *fp); -void CreateParser (char *s, ParsePtr p); +void CreateParser (char const *s, ParsePtr p); void DestroyParser (ParsePtr p); int PushToken (const char *tok, ParsePtr p); long SystemTime (int realtime); @@ -99,7 +99,7 @@ int DoUnset (Parser *p); int DoDump (ParsePtr p); void DumpVarTable (void); void DestroyVars (int all); -int PreserveVar (char *name); +int PreserveVar (char const *name); int DoPreserve (Parser *p); int DoSatRemind (Trigger *trig, TimeTrig *tim, ParsePtr p); int DoMsgCommand (char *cmd, char *msg); diff --git a/src/queue.c b/src/queue.c index ece3d3b8..0ad0ed75 100644 --- a/src/queue.c +++ b/src/queue.c @@ -396,7 +396,7 @@ static int CalculateNextTimeUsingSched(QueuedRem *q) /* Use LineBuffer for temp. string storage. */ int r; Value v; - char *s; + char const *s; int LastTime = -1; int ThisTime; diff --git a/src/sort.c b/src/sort.c index 32f7d8fc..6e4fbe9a 100644 --- a/src/sort.c +++ b/src/sort.c @@ -173,7 +173,7 @@ static void IssueSortBanner(int jul) char BanExpr[64]; int y, m, d; Value v; - char *s = BanExpr; + char const *s = BanExpr; DynamicBuffer buf; if (UserFuncExists("sortbanner") != 1) return; diff --git a/src/types.h b/src/types.h index 2215397e..a3345ee1 100644 --- a/src/types.h +++ b/src/types.h @@ -73,12 +73,12 @@ typedef struct { typedef struct { char isnested; /* Is it a nested expression? */ char allownested; - char *text; /* Start of text */ - char *pos; /* Current position */ - char *etext; /* Substituted text */ - char *epos; /* Position in substituted text */ + char const *text; /* Start of text */ + char const *pos; /* Current position */ + char const *etext; /* Substituted text */ + char const *epos; /* Position in substituted text */ DynamicBuffer pushedToken; /* Pushed-back token */ - char *tokenPushed; /* NULL if no pushed-back token */ + char const *tokenPushed; /* NULL if no pushed-back token */ } Parser; typedef Parser *ParsePtr; /* Pointer to parser structure */ diff --git a/src/userfns.c b/src/userfns.c index 572f203c..5242a85b 100644 --- a/src/userfns.c +++ b/src/userfns.c @@ -238,12 +238,12 @@ static void FSet(UserFunc *f) /* Call a user-defined function. */ /* */ /***************************************************************/ -int CallUserFunc(char *name, int nargs) +int CallUserFunc(char const *name, int nargs) { UserFunc *f; int h = HashVal(name) % FUNC_HASH_SIZE; int i; - char *s; + char const *s; /* Search for the function */ f = FuncHash[h]; diff --git a/src/var.c b/src/var.c index 2a1cd88d..c6dc9629 100644 --- a/src/var.c +++ b/src/var.c @@ -383,7 +383,7 @@ void DestroyVars(int all) /* Given the name of a variable, "preserve" it. */ /* */ /***************************************************************/ -int PreserveVar(char *name) +int PreserveVar(char const *name) { Var *v; diff --git a/unconfigure b/unconfigure index e185c312..5685250a 100755 --- a/unconfigure +++ b/unconfigure @@ -1,6 +1,6 @@ #!/bin/sh echo "Unconfiguring Remind..." -echo rm -f config.cache config.log config.status src/Makefile src/config.h -rm -f config.cache config.log config.status src/Makefile src/config.h +echo rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h +rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h exit 0