summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/Makefile.in18
-rw-r--r--lib-src/etags.c74
-rw-r--r--lib-src/movemail.c7
-rwxr-xr-xlib-src/rcs2log8
4 files changed, 77 insertions, 30 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index a175967156a..2b65cb2e1a9 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -24,7 +24,7 @@ SHELL = @SHELL@
EMACS = ../src/emacs${EXEEXT}
EMACSOPT = -batch --no-site-file --no-site-lisp
-# ==================== Things `configure' will edit ====================
+# ==================== Things 'configure' will edit ====================
CC=@CC@
CFLAGS=@CFLAGS@
@@ -83,31 +83,31 @@ ns_appbindir=@ns_appbindir@
# subdirectories of this directory. The default values for many of
# the variables below are expressed in terms of this one, so you may
# not need to change them. This is set with the --prefix option to
-# `../configure'.
+# '../configure'.
prefix=@prefix@
-# Like `prefix', but used for architecture-specific files. This is
-# set with the --exec-prefix option to `../configure'.
+# Like 'prefix', but used for architecture-specific files. This is
+# set with the --exec-prefix option to '../configure'.
exec_prefix=@exec_prefix@
# Where to install Emacs and other binaries that people will want to
# run directly (like etags). This is set with the --bindir option
-# to `../configure'.
+# to '../configure'.
bindir=@bindir@
# Where to install and expect executable files to be run by Emacs
# rather than directly by users, and other architecture-dependent
# data. ${archlibdir} is usually below this. This is set with the
-# --libexecdir option to `../configure'.
+# --libexecdir option to '../configure'.
libexecdir=@libexecdir@
# Directory for local state files for all programs.
localstatedir=@localstatedir@
# Where to find the source code. This is set by the configure
-# script's `--srcdir' option. However, the value of ${srcdir} in
+# script's '--srcdir' option. However, the value of ${srcdir} in
# this makefile is not identical to what was specified with --srcdir,
-# since the variable here has `/lib-src' added at the end.
+# since the variable here has '/lib-src' added at the end.
# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
srcdir=@srcdir@
@@ -127,7 +127,7 @@ abs_top_srcdir=@abs_top_srcdir@
# This path usually includes the Emacs version and configuration name,
# so that multiple configurations for multiple versions of Emacs may
# be installed at once. This can be set with the --archlibdir option
-# to `../configure'.
+# to '../configure'.
archlibdir=@archlibdir@
gamedir=@gamedir@
diff --git a/lib-src/etags.c b/lib-src/etags.c
index f34c985109d..791722d4b66 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -361,8 +361,9 @@ static void analyze_regex (char *);
static void free_regexps (void);
static void regex_tag_multiline (void);
static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
+static void verror (char const *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0);
static _Noreturn void suggest_asking_for_help (void);
-_Noreturn void fatal (const char *, const char *);
+static _Noreturn void fatal (char const *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
static _Noreturn void pfatal (const char *);
static void add_node (node *, node **);
@@ -1091,7 +1092,7 @@ main (int argc, char **argv)
++current_arg;
++file_count;
if (parsing_stdin)
- fatal ("cannot parse standard input more than once", (char *)NULL);
+ fatal ("cannot parse standard input more than once");
parsing_stdin = true;
break;
@@ -1255,8 +1256,8 @@ main (int argc, char **argv)
if (streq (this_file, "-"))
{
if (parsing_stdin)
- fatal ("cannot parse standard input AND read file names from it",
- (char *)NULL);
+ fatal ("cannot parse standard input "
+ "AND read file names from it");
while (readline_internal (&filename_lb, stdin, "-") > 0)
process_file_name (filename_lb.buffer, lang);
}
@@ -1267,6 +1268,8 @@ main (int argc, char **argv)
this_file = argbuffer[i].what;
process_file (stdin, this_file, lang);
break;
+ default:
+ error ("internal error: arg_type");
}
}
@@ -1324,7 +1327,7 @@ main (int argc, char **argv)
z = stpcpy (z, tagfile);
strcpy (z, ";rm OTAGS");
if (system (cmd) != EXIT_SUCCESS)
- fatal ("failed to execute shell command", (char *)NULL);
+ fatal ("failed to execute shell command");
}
free (cmd);
append_to_tagfile = true;
@@ -2753,6 +2756,9 @@ consider_token (char *str, int len, int c, int *c_extp,
case st_C_struct:
case st_C_enum:
typdef = ttypeseen;
+ break;
+ default:
+ break;
}
break;
case ttypeseen:
@@ -2769,8 +2775,11 @@ consider_token (char *str, int len, int c, int *c_extp,
case st_C_struct:
case st_C_enum:
return false;
+ default:
+ return true;
}
- return true;
+ default:
+ break;
}
switch (toktype)
@@ -2803,6 +2812,8 @@ consider_token (char *str, int len, int c, int *c_extp,
fvdef = fvnone;
}
return false;
+ default:
+ break;
}
if (structdef == skeyseen)
@@ -2826,6 +2837,8 @@ consider_token (char *str, int len, int c, int *c_extp,
case st_C_objimpl:
objdef = oimplementation;
return false;
+ default:
+ break;
}
break;
case oimplementation:
@@ -2887,6 +2900,8 @@ consider_token (char *str, int len, int c, int *c_extp,
objdef = onone;
}
return false;
+ default:
+ break;
}
/* A function, variable or enum constant? */
@@ -2942,6 +2957,8 @@ consider_token (char *str, int len, int c, int *c_extp,
return false;
}
break;
+ default:
+ break;
}
/* FALLTHRU */
case fvnameseen:
@@ -2958,8 +2975,12 @@ consider_token (char *str, int len, int c, int *c_extp,
fvdef = fvnameseen; /* function or variable */
*is_func_or_var = true;
return true;
+ default:
+ break;
}
break;
+ default:
+ break;
}
return false;
@@ -3469,6 +3490,8 @@ C_entries (int c_ext, FILE *inf)
fvdef = fignore;
}
break;
+ default:
+ break;
}
if (structdef == stagseen && !cjava)
{
@@ -3479,6 +3502,8 @@ C_entries (int c_ext, FILE *inf)
case dsharpseen:
savetoken = token;
break;
+ default:
+ break;
}
if (!yacc_rules || lp == newlb.buffer + 1)
{
@@ -3507,7 +3532,7 @@ C_entries (int c_ext, FILE *inf)
break;
switch (objdef)
{
- case otagseen:
+ case otagseen:
objdef = oignore;
make_C_tag (true); /* an Objective C class */
break;
@@ -3521,6 +3546,8 @@ C_entries (int c_ext, FILE *inf)
strcpy (token_name.buffer + toklen, ":");
}
break;
+ default:
+ break;
}
if (structdef == stagseen)
{
@@ -3598,6 +3625,8 @@ C_entries (int c_ext, FILE *inf)
make_C_tag (true); /* an Objective C method */
objdef = oinbody;
break;
+ default:
+ break;
}
switch (fvdef)
{
@@ -3671,6 +3700,8 @@ C_entries (int c_ext, FILE *inf)
fvdef = fvnone;
}
break;
+ default:
+ break;
}
break;
case '(':
@@ -3704,6 +3735,8 @@ C_entries (int c_ext, FILE *inf)
case flistseen:
fvdef = finlist;
break;
+ default:
+ break;
}
parlev++;
break;
@@ -3729,6 +3762,8 @@ C_entries (int c_ext, FILE *inf)
case finlist:
fvdef = flistseen;
break;
+ default:
+ break;
}
if (!instruct
&& (typdef == tend
@@ -3800,6 +3835,8 @@ C_entries (int c_ext, FILE *inf)
bracelev = -1;
}
break;
+ default:
+ break;
}
switch (structdef)
{
@@ -3813,6 +3850,8 @@ C_entries (int c_ext, FILE *inf)
structdef = snone;
make_C_tag (false); /* a struct or enum */
break;
+ default:
+ break;
}
bracelev += 1;
break;
@@ -6351,10 +6390,13 @@ skip_name (char *cp)
}
/* Print error message and exit. */
-void
-fatal (const char *s1, const char *s2)
+static void
+fatal (char const *format, ...)
{
- error (s1, s2);
+ va_list ap;
+ va_start (ap, format);
+ verror (format, ap);
+ va_end (ap);
exit (EXIT_FAILURE);
}
@@ -6379,10 +6421,16 @@ error (const char *format, ...)
{
va_list ap;
va_start (ap, format);
+ verror (format, ap);
+ va_end (ap);
+}
+
+static void
+verror (char const *format, va_list ap)
+{
fprintf (stderr, "%s: ", progname);
vfprintf (stderr, format, ap);
fprintf (stderr, "\n");
- va_end (ap);
}
/* Return a newly-allocated string whose contents
@@ -6673,7 +6721,7 @@ xmalloc (size_t size)
{
void *result = malloc (size);
if (result == NULL)
- fatal ("virtual memory exhausted", (char *)NULL);
+ fatal ("virtual memory exhausted");
return result;
}
@@ -6682,7 +6730,7 @@ xrealloc (void *ptr, size_t size)
{
void *result = realloc (ptr, size);
if (result == NULL)
- fatal ("virtual memory exhausted", (char *)NULL);
+ fatal ("virtual memory exhausted");
return result;
}
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 231bc22fa89..84c8ce24286 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -174,8 +174,6 @@ main (int argc, char **argv)
int desc;
#endif /* not MAIL_USE_SYSTEM_LOCK */
- char *spool_name = 0;
-
#ifdef MAIL_USE_POP
bool pop_reverse_order = false;
# define ARGSTR "pr"
@@ -246,13 +244,14 @@ main (int argc, char **argv)
#ifndef DISABLE_DIRECT_ACCESS
char *lockname = 0;
+ char *spool_name = 0;
-#ifndef MAIL_USE_SYSTEM_LOCK
#ifdef MAIL_USE_MAILLOCK
spool_name = mail_spool_name (inname);
#endif
if (! spool_name)
{
+#ifndef MAIL_USE_SYSTEM_LOCK
/* Use a lock file named after our first argument with .lock appended:
If it exists, the mail file is locked. */
/* Note: this locking mechanism is *required* by the mailer
@@ -323,8 +322,8 @@ main (int argc, char **argv)
}
delete_lockname = lockname;
- }
#endif /* not MAIL_USE_SYSTEM_LOCK */
+ }
#ifdef SIGCHLD
signal (SIGCHLD, SIG_DFL);
diff --git a/lib-src/rcs2log b/lib-src/rcs2log
index 242760362e8..d1bd3693183 100755
--- a/lib-src/rcs2log
+++ b/lib-src/rcs2log
@@ -414,7 +414,7 @@ sort $SORT_K_OPTIONS </dev/null 2>/dev/null || SORT_K_OPTIONS='+2 -4r +4 +0'
# Get the full name of each author the logs mention, and set initialize_fullname
-# to awk code that initializes the `fullname' awk associative array.
+# to awk code that initializes the 'fullname' awk associative array.
# Warning: foreign authors (i.e. not known in the passwd file) are mishandled;
# you have to fix the resulting output by hand.
@@ -546,8 +546,8 @@ esac
# Function to print a single log line.
# We don't use awk functions, to stay compatible with old awk versions.
-# `Log' is the log message.
-# `files' contains the affected files.
+# 'Log' is the log message.
+# 'files' contains the affected files.
printlogline='{
# Following the GNU coding standards, rewrite
@@ -587,7 +587,7 @@ printlogline='{
}
}'
-# Pattern to match the `revision' line of rlog output.
+# Pattern to match the 'revision' line of rlog output.
rlog_revision_pattern='^revision [0-9]+\.[0-9]+(\.[0-9]+\.[0-9]+)*(['"$tab"' ]+locked by: [^'"$tab"' $,.0-9:;@]*[^'"$tab"' $,:;@][^'"$tab"' $,.0-9:;@]*;)?['"$tab"' ]*$'
case $hostname in