diff --git a/src/calendar.c b/src/calendar.c index 5e9483d2..c28341bb 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -279,6 +279,7 @@ static int DidAMonth; static int DidAWeek; static int DidADay; +static char const *CalendarTime(int tim, int duration); static void ColorizeEntry(CalEntry const *e, int clamp); static void SortCol (CalEntry **col); static void DoCalendarOneWeek (int nleft); @@ -380,7 +381,7 @@ despace(char const *s) return buf; } -void PrintJSONChar(char c) { +static void PrintJSONChar(char c) { switch(c) { case '\b': printf("\\b"); break; case '\f': printf("\\f"); break; @@ -422,7 +423,7 @@ void PrintJSONString(char const *s) } } -void PrintJSONStringLC(char const *s) +static void PrintJSONStringLC(char const *s) { while (*s) { switch(*s) { @@ -466,7 +467,7 @@ void PrintJSONKeyPairString(char const *name, char const *val) printf("\","); } -void PrintJSONKeyPairDate(char const *name, int dse) +static void PrintJSONKeyPairDate(char const *name, int dse) { int y, m, d; if (dse == NO_DATE) { @@ -480,7 +481,7 @@ void PrintJSONKeyPairDate(char const *name, int dse) } -void PrintJSONKeyPairDateTime(char const *name, int dt) +static void PrintJSONKeyPairDateTime(char const *name, int dt) { int y, m, d, h, i, k; if (dt == NO_TIME) { @@ -498,7 +499,7 @@ void PrintJSONKeyPairDateTime(char const *name, int dt) } -void PrintJSONKeyPairTime(char const *name, int t) +static void PrintJSONKeyPairTime(char const *name, int t) { int h, i; if (t == NO_TIME) { @@ -2782,7 +2783,7 @@ static void WriteCalDays(void) /* This takes into account duration */ /* */ /***************************************************************/ -char const * +static char const * CalendarTime(int tim, int duration) { static char buf[128]; diff --git a/src/expr.c b/src/expr.c index 23157b90..74fe2a63 100644 --- a/src/expr.c +++ b/src/expr.c @@ -191,6 +191,7 @@ static int ExprNodesUsed = 0; /* Forward references */ static expr_node * parse_expression_aux(char const **e, int *r, Var *locals, int level); static char const *get_operator_name(expr_node *node); +static void print_expr_tree(expr_node *node, FILE *fp); /* This is super-skanky... we keep track of the currently-executing user-defined function in a global var */ @@ -2712,7 +2713,7 @@ static void print_kids(expr_node *node, FILE *fp) /* file. Used for debugging (the "-ds" flag.) */ /* */ /***************************************************************/ -void print_expr_tree(expr_node *node, FILE *fp) +static void print_expr_tree(expr_node *node, FILE *fp) { if (!node) { return; @@ -2961,7 +2962,7 @@ int CopyValue(Value *dest, const Value *src) /* 4:00PM */ /* */ /***************************************************************/ -int ParseLiteralTime(char const **s, int *tim) +static int ParseLiteralTime(char const **s, int *tim) { int h=0; int m=0; diff --git a/src/files.c b/src/files.c index 91a7b6d4..f0e504af 100644 --- a/src/files.c +++ b/src/files.c @@ -179,7 +179,7 @@ got_a_fresh_line(void) WarnedAboutImplicit = 0; } -void set_cloexec(FILE *fp) +static void set_cloexec(FILE *fp) { int flags; int fd; @@ -381,7 +381,7 @@ static int ReadLineFromFile(int use_pclose) /* ShouldCache is 1, cache the file */ /* */ /***************************************************************/ -int OpenFile(char const *fname) +static int OpenFile(char const *fname) { CachedFile *h = CachedFiles; int r; diff --git a/src/hashtab.c b/src/hashtab.c index 3a96b3fb..e2dc9796 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -321,7 +321,7 @@ hash_table_find(hash_table *t, void *candidate) * * \return 0 on success, -1 on failure */ -int +static int hash_table_delete_helper(hash_table *t, void *item, int resize_ok) { if (!item) { diff --git a/src/hashtab.h b/src/hashtab.h index 61a661e2..927eafc4 100644 --- a/src/hashtab.h +++ b/src/hashtab.h @@ -68,7 +68,6 @@ int hash_table_delete(hash_table *t, void *item); int hash_table_delete_no_resize(hash_table *t, void *item); void *hash_table_next(hash_table *t, void *cur); void hash_table_dump_stats(hash_table *t, FILE *fp); -void hash_table_get_stats(hash_table *t, struct hash_table_stats *stat); /** * \brief Iterate over all items in a hash table diff --git a/src/hashtab_stats.c b/src/hashtab_stats.c index 54e1dc91..aef143ab 100644 --- a/src/hashtab_stats.c +++ b/src/hashtab_stats.c @@ -22,6 +22,8 @@ #include #include +static void hash_table_get_stats(hash_table *t, struct hash_table_stats *stat); + /** * \brief Dump hash table statistics to a stdio FILE * @@ -53,7 +55,7 @@ hash_table_dump_stats(hash_table *t, FILE *fp) * \param t A pointer to a hash_table object * \param stat A pointer to a hash_table_stats object that will be filled in */ -void +static void hash_table_get_stats(hash_table *t, struct hash_table_stats *stat) { size_t n = hash_table_num_buckets(t); diff --git a/src/hbcal.c b/src/hbcal.c index 8c2f7b76..6d1c0ebb 100644 --- a/src/hbcal.c +++ b/src/hbcal.c @@ -70,6 +70,8 @@ static char MaxMonLen[] = { static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1}; +static long DaysToHebYear(int y); + /***************************************************************/ /* */ /* RoshHashana */ @@ -78,7 +80,7 @@ static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1}; /* Hebrew year. (ie, 5751, not 1990) */ /* */ /***************************************************************/ -int RoshHashana(int i) +static int RoshHashana(int i) { long j; j = DaysToHebYear(i-3744) - CORRECTION; @@ -93,7 +95,7 @@ int RoshHashana(int i) /* from new moon before Tishrey 1 5701. */ /* */ /***************************************************************/ -long DaysToHebYear(int y) +static long DaysToHebYear(int y) { long m, nm, dw, s, l; @@ -126,7 +128,7 @@ long DaysToHebYear(int y) /* */ /* */ /***************************************************************/ -int DaysInHebYear(int y) +static int DaysInHebYear(int y) { long thisyear, nextyear; @@ -143,7 +145,7 @@ int DaysInHebYear(int y) /* given the LENGTH of the Hebrew year. */ /* */ /***************************************************************/ -char const *DaysInHebMonths(int ylen) +static char const *DaysInHebMonths(int ylen) { static char monlen[14] = {30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29, 29}; diff --git a/src/json.c b/src/json.c index 7953fbeb..8fed35b1 100644 --- a/src/json.c +++ b/src/json.c @@ -58,6 +58,8 @@ typedef unsigned int json_uchar; const struct _json_value json_value_none; +static void json_value_free_ex (json_settings * settings, json_value * value); + static unsigned char hex_value (json_char c) { if (isdigit((unsigned char)c)) @@ -241,10 +243,10 @@ static const long flag_block_comment = 1 << 14, flag_num_got_decimal = 1 << 15; -json_value * json_parse_ex (json_settings const * settings, - const json_char * json, - size_t length, - char * error_buf) +static json_value * json_parse_ex (json_settings const * settings, + const json_char * json, + size_t length, + char * error_buf) { char error [json_error_max]; const json_char * end; @@ -988,7 +990,7 @@ json_value * json_parse (const json_char * json, size_t length) return json_parse_ex (&settings, json, length, 0); } -void json_value_free_ex (json_settings * settings, json_value * value) +static void json_value_free_ex (json_settings * settings, json_value * value) { json_value * cur_value; diff --git a/src/json.h b/src/json.h index f4a2c37a..f1581635 100644 --- a/src/json.h +++ b/src/json.h @@ -266,21 +266,9 @@ json_value * json_parse (const json_char * json, size_t length); #define json_error_max 128 -json_value * json_parse_ex (json_settings const * settings, - const json_char * json, - size_t length, - char * error); - void json_value_free (json_value *); -/* Not usually necessary, unless you used a custom mem_alloc and now want to - * use a custom mem_free. - */ -void json_value_free_ex (json_settings * settings, - json_value *); - - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/main.c b/src/main.c index 0ef7c34b..4e88b2a3 100644 --- a/src/main.c +++ b/src/main.c @@ -50,11 +50,15 @@ #include "err.h" static void DoReminders(void); +static int DoDebug(ParsePtr p); +static void ClearLastTriggers(void); +static int DoBanner(ParsePtr p); +static void SaveLastTimeTrig(TimeTrig const *t); /* Macro for simplifying common block so as not to litter code */ #define OUTPUT(c) do { if (output) { DBufPutc(output, c); } else { putchar(c); } } while(0) -void +static void exitfunc(void) { /* Kill any execution-time-limiter process */ @@ -1281,7 +1285,7 @@ int VerifyEoln(ParsePtr p) /* Set the debug options under program control. */ /* */ /***************************************************************/ -int DoDebug(ParsePtr p) +static int DoDebug(ParsePtr p) { int err; int ch; @@ -1387,7 +1391,7 @@ int DoDebug(ParsePtr p) /* reminder is issued. */ /* */ /***************************************************************/ -int DoBanner(ParsePtr p) +static int DoBanner(ParsePtr p) { int err; int c; @@ -1966,7 +1970,7 @@ FreeTrig(Trigger *t) t->infos = NULL; } -void +static void ClearLastTriggers(void) { LastTrigger.expired = 0; @@ -2026,7 +2030,7 @@ SaveLastTrigger(Trigger const *t) } } -void +static void SaveLastTimeTrig(TimeTrig const *t) { memcpy(&LastTimeTrig, t, sizeof(LastTimeTrig)); diff --git a/src/md5.c b/src/md5.c index 0f11a57e..a2627ccf 100644 --- a/src/md5.c +++ b/src/md5.c @@ -20,6 +20,7 @@ #include "md5.h" static void byteReverse(unsigned char *buf, unsigned longs); +static void MD5Transform(uint32 buf[4], uint32 const in[16]); /* * Note: this code is harmless on little-endian machines. @@ -163,7 +164,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ -void MD5Transform(uint32 buf[4], uint32 const in[16]) +static void MD5Transform(uint32 buf[4], uint32 const in[16]) { register uint32 a, b, c, d; diff --git a/src/md5.h b/src/md5.h index 993a58d4..fa5150f0 100644 --- a/src/md5.h +++ b/src/md5.h @@ -29,6 +29,5 @@ void MD5Init(struct MD5Context *context); void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len); void MD5Final(unsigned char digest[16], struct MD5Context *context); -void MD5Transform(uint32 buf[4], uint32 const in[16]); #endif /* !MD5_H */ diff --git a/src/moon.c b/src/moon.c index 95e2981c..1b5ec8fa 100644 --- a/src/moon.c +++ b/src/moon.c @@ -665,7 +665,7 @@ static double interpolate(double f0, double f1, double f2, double p) /* Moon position using fundamental arguments Van Flandern & Pulkkinen, 1979) */ -void moon_position(double dayOffset, double *ra, double *declination, double *distance) +static void moon_position(double dayOffset, double *ra, double *declination, double *distance) { double l = 0.606434 + 0.03660110129 * dayOffset; double m = 0.374897 + 0.03629164709 * dayOffset; diff --git a/src/protos.h b/src/protos.h index d2aba9a9..7967c2d9 100644 --- a/src/protos.h +++ b/src/protos.h @@ -47,7 +47,6 @@ int DoFrename (ParsePtr p); void UnsetAllUserFuncs(void); void ProduceCalendar (void); char const *SimpleTime (int tim); -char const *CalendarTime (int tim, int duration); int DoRem (ParsePtr p); int DoFlush (ParsePtr p); void DoExit (ParsePtr p); @@ -57,14 +56,12 @@ int ShouldTriggerReminder (Trigger const *t, TimeTrig const *tim, int dse, int * int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int dse, int mode); int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int dse, int tim); int ParseLiteralDateOrTime (char const **s, int *dse, int *tim); -int ParseLiteralTime (char const **s, int *tim); expr_node *parse_expression(char const **e, int *r, Var *locals); int evaluate_expression(expr_node *node, Value *locals, Value *ans, int *nonconst); int evaluate_expr_node(expr_node *node, Value *locals, Value *ans, int *nonconst); int truthy(Value const *v); -void print_expr_tree(expr_node *node, FILE *fp); void unlimit_execution_time(void); expr_node *free_expr_tree(expr_node *node); int EvalExpr (char const **e, Value *v, ParsePtr p); @@ -72,7 +69,6 @@ int DoCoerce (char type, Value *v); char const *PrintValue (Value *v, FILE *fp); int CopyValue (Value *dest, const Value *src); int ReadLine (void); -int OpenFile (char const *fname); int DoInclude (ParsePtr p, enum TokTypes tok); int DoIncludeCmd (ParsePtr p); int IncludeFile (char const *fname); @@ -109,8 +105,6 @@ int DoEndif (ParsePtr p); int DoIfTrig (ParsePtr p); int ShouldIgnoreLine (void); int VerifyEoln (ParsePtr p); -int DoDebug (ParsePtr p); -int DoBanner (ParsePtr p); int DoRun (ParsePtr p); int DoExpr (ParsePtr p); int DoTranslate (ParsePtr p); @@ -128,7 +122,6 @@ int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig const *tim, char const *s void HandleQueuedReminders (void); char const *FindInitialToken (Token *tok, char const *s); void FindToken (char const *s, Token *tok); -void FindNumericToken (char const *s, Token *t); int ComputeTrigger (int today, Trigger *trig, TimeTrig *tim, int *err, int save_in_globals); int ComputeTriggerNoAdjustDuration (int today, Trigger *trig, TimeTrig const *tim, int *err, int save_in_globals, int duration_days); int AdjustTriggerForDuration(int today, int r, Trigger *trig, TimeTrig *tim, int save_in_globals); @@ -150,9 +143,7 @@ void strtolower(char *s); Var *FindVar (char const *str, int create); SysVar *FindSysVar (char const *name); -int DeleteVar (char const *str); int SetVar (char const *str, Value const *val, int nonconst_expr); -int GetVarValue (char const *str, Value *val); int DoSet (Parser *p); int DoUnset (Parser *p); int DoDump (ParsePtr p); @@ -164,7 +155,6 @@ int DoPreserve (Parser *p); int DoSatRemind (Trigger *trig, TimeTrig *tt, ParsePtr p); int DoMsgCommand (char const *cmd, char const *msg, int is_queued); int ParseNonSpaceChar (ParsePtr p, int *err, int peek); -unsigned int HashVal_ignorecase(char const *str); unsigned int HashVal_preservecase(char const *str); int DateOK (int y, int m, int d); BuiltinFunc *FindBuiltinFunc (char const *name); @@ -175,10 +165,6 @@ int UserFuncExists (char const *fn); void DSEToHeb (int dse, int *hy, int *hm, int *hd); int HebNameToNum (char const *mname); char const *HebMonthName (int m, int y); -int RoshHashana (int i); -long DaysToHebYear (int y); -int DaysInHebYear (int y); -char const *DaysInHebMonths (int ylen); int HebToDSE (int hy, int hm, int hd); int GetValidHebDate (int yin, int min, int din, int adarbehave, int *mout, int *dout, int yahr); int GetNextHebrewDate (int dsestart, int hm, int hd, int yahr, int adarbehave, int *ans); @@ -199,9 +185,7 @@ void PurgeEchoLine(char const *fmt, ...); void FreeTrig(Trigger *t); void AppendTag(DynamicBuffer *buf, char const *s); char const *SynthesizeTag(void); -void ClearLastTriggers(void); void SaveLastTrigger(Trigger const *t); -void SaveLastTimeTrig(TimeTrig const *t); void SaveAllTriggerInfo(Trigger const *t, TimeTrig const *tt, int trigdate, int trigtime, int valid); void PerIterationInit(void); @@ -210,13 +194,9 @@ char const *Colorize(int r, int g, int b, int bg, int clamp); void PrintJSONString(char const *s); void PrintJSONKeyPairInt(char const *name, int val); void PrintJSONKeyPairString(char const *name, char const *val); -void PrintJSONKeyPairDate(char const *name, int dse); -void PrintJSONKeyPairDateTime(char const *name, int dt); -void PrintJSONKeyPairTime(char const *name, int t); void System(char const *cmd, int queued); int ShellEscape(char const *in, DynamicBuffer *out); int AddGlobalOmit(int dse); -void set_lat_and_long_from_components(void); void set_components_from_lat_and_long(void); void DebugExitFunc(void); @@ -226,7 +206,6 @@ int GetTerminalBackground(void); char const *get_day_name(int wkday); char const *get_month_name(int mon); -void set_cloexec(FILE *fp); int push_call(char const *filename, char const *func, int lineno, int lineno_start); void clear_callstack(void); int print_callstack(FILE *fp); @@ -279,12 +258,8 @@ void print_escaped_string(FILE *fp, char const *s); void print_escaped_string_helper(FILE *fp, char const *s, int esc_for_remind, int json); void GenerateSysvarTranslationTemplates(void); void TranslationTemplate(char const *msg); -TrigInfo *NewTrigInfo(char const *i); -void FreeTrigInfo(TrigInfo *ti); void FreeTrigInfoChain(TrigInfo *ti); int AppendTrigInfo(Trigger *t, char const *info); -int TrigInfoHeadersAreTheSame(char const *i1, char const *i2); -int TrigInfoIsValid(char const *info); char const *FindTrigInfo(Trigger *t, char const *header); void WriteJSONInfoChain(TrigInfo *ti); char const *line_range(int lineno_start, int lineno); diff --git a/src/queue.c b/src/queue.c index efc9e434..78bf83ec 100644 --- a/src/queue.c +++ b/src/queue.c @@ -85,7 +85,7 @@ static void chomp(DynamicBuffer *buf) } } -char const *SimpleTimeNoSpace(int tim) +static char const *SimpleTimeNoSpace(int tim) { char *s = (char *) SimpleTime(tim); if (s && *s) { @@ -209,7 +209,7 @@ maybe_close(int fd) (void) close(new_fd); } -void +static void SigContHandler(int d) { UNUSED(d); diff --git a/src/rem2ps.c b/src/rem2ps.c index 40f0061c..41d81f82 100644 --- a/src/rem2ps.c +++ b/src/rem2ps.c @@ -131,16 +131,16 @@ int LeftMarg, RightMarg, TopMarg, BotMarg; int FillPage; int Verbose = 0; -void Init (int argc, char const *argv[]); -void Usage (char const *s); -void DoPsCal (void); -int DoQueuedPs (void); -void DoSmallCal (char const *m, int days, int first, int col, int which); -void WriteProlog (void); -void WriteCalEntry (void); -void WriteOneEntry (CalEntry const *c); -void GetSmallLocations (void); -char const *EatToken(char const *in, char *out, int maxlen); +static void Init (int argc, char const *argv[]); +static void Usage (char const *s); +static void DoPsCal (void); +static int DoQueuedPs (void); +static void DoSmallCal (char const *m, int days, int first, int col, int which); +static void WriteProlog (void); +static void WriteCalEntry (void); +static void WriteOneEntry (CalEntry const *c); +static void GetSmallLocations (void); +static char const *EatToken(char const *in, char *out, int maxlen); static void put_escaped_string(char const *s) @@ -161,7 +161,7 @@ put_escaped_string(char const *s) /* Compare strings, case insensitive. */ /* */ /***************************************************************/ -int StrCmpi(char const *s1, char const *s2) +static int StrCmpi(char const *s1, char const *s2) { int r; while (*s1 && *s2) { @@ -375,7 +375,7 @@ int main(int argc, char const *argv[]) /* DoPsCal - emit PostScript for the calendar. */ /* */ /***************************************************************/ -void DoPsCal(void) +static void DoPsCal(void) { char month[40], year[40]; char prevm[40], nextm[40]; @@ -595,7 +595,7 @@ void DoPsCal(void) /* WriteProlog - write the PostScript prologue */ /* */ /***************************************************************/ -void WriteProlog(void) +static void WriteProlog(void) { int i; int x = CurPage->xsize; @@ -702,7 +702,7 @@ void WriteProlog(void) /* WriteCalEntry - write all entries for one day */ /* */ /***************************************************************/ -void WriteCalEntry(void) +static void WriteCalEntry(void) { CalEntry *c = CurEntries; CalEntry *d; @@ -789,7 +789,7 @@ void WriteCalEntry(void) /* WriteOneEntry - write an entry for one day */ /* */ /***************************************************************/ -void WriteOneEntry(CalEntry const *c) +static void WriteOneEntry(CalEntry const *c) { int ch, i; char const *s = c->entry; @@ -851,7 +851,7 @@ void WriteOneEntry(CalEntry const *c) /* Init - set up parameters */ /* */ /***************************************************************/ -void Init(int argc, char const *argv[]) +static void Init(int argc, char const *argv[]) { char const *s; char const *t; @@ -1043,7 +1043,7 @@ void Usage(char const *s) /* month. */ /* */ /***************************************************************/ -void DoSmallCal(char const *m, int days, int first, int col, int which) +static void DoSmallCal(char const *m, int days, int first, int col, int which) { /* Do the small calendar */ int i, j; @@ -1097,7 +1097,7 @@ void DoSmallCal(char const *m, int days, int first, int col, int which) /* DoQueuedPs - do the queued PS and PSFILE reminders. */ /* */ /***************************************************************/ -int DoQueuedPs(void) +static int DoQueuedPs(void) { int i; int HadPS = 0; @@ -1305,7 +1305,7 @@ int DoQueuedPs(void) /* Set up the locations for the small calendars. */ /* */ /***************************************************************/ -void GetSmallLocations(void) +static void GetSmallLocations(void) { char c; char const *s = SmallLocation; @@ -1370,7 +1370,7 @@ void GetSmallLocations(void) /* Read a space-delimited token into an output buffer. */ /* */ /***************************************************************/ -char const *EatToken(char const *in, char *out, int maxlen) +static char const *EatToken(char const *in, char *out, int maxlen) { int i = 0; diff --git a/src/token.c b/src/token.c index 4676be75..ea2a5d4f 100644 --- a/src/token.c +++ b/src/token.c @@ -122,6 +122,7 @@ Token TokArray[] = { }; static int TokStrCmp (Token const *t, char const *s); +static void FindNumericToken(char const *s, Token *t); static void init_token(Token *t) @@ -247,7 +248,7 @@ void FindToken(char const *s, Token *tok) /* Rep - *n */ /* */ /***************************************************************/ -void FindNumericToken(char const *s, Token *t) +static void FindNumericToken(char const *s, Token *t) { int mult = 1, hour, min; char const *s_orig = s; diff --git a/src/trigger.c b/src/trigger.c index 6e6f7d13..e61d098a 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -31,6 +31,8 @@ static int DSEYear(int dse); static int DSEMonth(int dse); static int NextSimpleTrig(int startdate, Trigger const *trig, int *err); static int GetNextTriggerDate(Trigger *trig, int start, int *err, int *nextstart); +static int TrigInfoIsValid(char const *info); +static int TrigInfoHeadersAreTheSame(char const *i1, char const *i2); /***************************************************************/ /* */ @@ -683,7 +685,7 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig const *tim /* Returns NULL if memory allocation fails. */ /* */ /***************************************************************/ -TrigInfo * +static TrigInfo * NewTrigInfo(char const *i) { TrigInfo *ti = malloc(sizeof(TrigInfo)); @@ -707,7 +709,7 @@ NewTrigInfo(char const *i) /* Free a TrigInfo objects. */ /* */ /***************************************************************/ -void +static void FreeTrigInfo(TrigInfo *ti) { if (ti->info) { @@ -774,7 +776,7 @@ AppendTrigInfo(Trigger *t, char const *info) return OK; } -int +static int TrigInfoHeadersAreTheSame(char const *i1, char const *i2) { char const *c1 = strchr(i1, ':'); @@ -785,7 +787,7 @@ TrigInfoHeadersAreTheSame(char const *i1, char const *i2) return 0; } -int +static int TrigInfoIsValid(char const *info) { char const *t; diff --git a/src/var.c b/src/var.c index 363157ab..0cce10bc 100644 --- a/src/var.c +++ b/src/var.c @@ -37,6 +37,8 @@ static int IntMax = INT_MAX; static hash_table VHashTbl; static int SetSysVarHelper(SysVar *v, Value *value); +static unsigned int HashVal_ignorecase(char const *str); +static void set_lat_and_long_from_components(void); static unsigned int VarHashFunc(void const *x) { @@ -523,7 +525,7 @@ static int time_sep_func(int do_set, Value *val) /* Given a string, compute the hash value case-insensitively */ /* */ /***************************************************************/ -unsigned int HashVal_ignorecase(char const *str) +static unsigned int HashVal_ignorecase(char const *str) { unsigned int h = 0, high; while(*str) { @@ -576,7 +578,7 @@ Var *FindVar(char const *str, int create) /* string and delete it. */ /* */ /***************************************************************/ -int DeleteVar(char const *str) +static int DeleteVar(char const *str) { Var *v; @@ -622,27 +624,6 @@ int SetVar(char const *str, Value const *val, int nonconst_expr) return OK; } -/***************************************************************/ -/* */ -/* GetVarValue */ -/* */ -/* Get a copy of the value of the variable. */ -/* */ -/***************************************************************/ -int GetVarValue(char const *str, Value *val) -{ - Var *v; - - v=FindVar(str, 0); - - if (!v) { - Eprint("%s: `%s'", GetErr(E_NOSUCH_VAR), str); - return E_NOSUCH_VAR; - } - v->used_since_set = 1; - return CopyValue(val, &v->v); -} - /***************************************************************/ /* */ /* DoSet - set a variable. */ @@ -1333,7 +1314,7 @@ static void DumpSysVar(char const *name, const SysVar *v) return; } -void +static void set_lat_and_long_from_components(void) { Latitude = (double) LatDeg + ((double) LatMin) / 60.0 + ((double) LatSec) / 3600.0;