gbranden pushed a commit to branch master
in repository groff.
commit 7d5115b8aa4f438bfe922f831621d3d32bd82cbd
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Dec 8 14:34:14 2023 -0600
Fix code style nits.
* src/libs/libbib/map.c: Tweak format of copyright notice to ease
grepping.
* src/libs/libgroff/ptable.cpp:
* src/libs/libgroff/strtol.c: Kill off trailing whitespace.
* src/libs/libxutil/xmalloc.c: Fix inconsistent indentation; the code we
copied from X11 uses a different style, so maintain mutual
consistentcy among its files. (This also will help with merging
post-X11R5 changes thereto, which I have a mind to do.)
* src/utils/indxbib/signal.c: Annotate a potential future direction.
* src/include/stringclass.h:
* src/libs/libbib/map.c:
* src/libs/libgroff/assert.cpp:
* src/libs/libgroff/change_lf.cpp:
* src/libs/libgroff/cmap.cpp:
* src/libs/libgroff/cset.cpp:
* src/libs/libgroff/device.cpp:
* src/libs/libgroff/fatal.cpp:
* src/libs/libgroff/fmod.c:
* src/libs/libgroff/geometry.cpp:
* src/libs/libgroff/getcwd.c:
* src/libs/libgroff/getopt.c:
* src/libs/libgroff/getopt1.c:
* src/libs/libgroff/hypot.cpp:
* src/libs/libgroff/localcharset.c:
* src/libs/libgroff/matherr.c:
* src/libs/libgroff/ptable.cpp:
* src/libs/libgroff/putenv.c:
* src/libs/libgroff/quotearg.c:
* src/libs/libgroff/spawnvp.c:
* src/libs/libgroff/strcasecmp.c:
* src/libs/libgroff/strerror.c:
* src/libs/libgroff/strtol.c:
* src/libs/libxutil/xmalloc.c:
* src/preproc/eqn/text.cpp:
* src/preproc/pic/object.cpp:
* src/preproc/pic/pic.h:
* src/utils/indxbib/signal.c: Update editor aid comments; drop old-style
Emacs file-local variable setting. Drop comments that had no purpose
other than to mark the end of the file since the editor aid comments
also fulfill that role.
---
src/include/stringclass.h | 6 ++++++
src/libs/libbib/map.c | 8 +++++++-
src/libs/libgroff/assert.cpp | 6 ++++++
src/libs/libgroff/change_lf.cpp | 6 ++++++
src/libs/libgroff/cmap.cpp | 7 ++++++-
src/libs/libgroff/cset.cpp | 7 ++++++-
src/libs/libgroff/device.cpp | 7 ++++++-
src/libs/libgroff/fatal.cpp | 6 ++++++
src/libs/libgroff/fmod.c | 6 ++++++
src/libs/libgroff/geometry.cpp | 7 ++++++-
src/libs/libgroff/getcwd.c | 6 ++++++
src/libs/libgroff/getopt.c | 6 ++++++
src/libs/libgroff/getopt1.c | 6 ++++++
src/libs/libgroff/hypot.cpp | 6 ++++++
src/libs/libgroff/localcharset.c | 6 ++++++
src/libs/libgroff/matherr.c | 6 ++++++
src/libs/libgroff/ptable.cpp | 12 ++++++++----
src/libs/libgroff/putenv.c | 6 ++++++
src/libs/libgroff/quotearg.c | 6 +++++-
src/libs/libgroff/spawnvp.c | 6 +++++-
src/libs/libgroff/strcasecmp.c | 6 ++++++
src/libs/libgroff/strerror.c | 6 ++++++
src/libs/libgroff/strtol.c | 8 +++++++-
src/libs/libxutil/xmalloc.c | 2 +-
src/preproc/eqn/text.cpp | 6 +++++-
src/preproc/pic/object.cpp | 6 +++++-
src/preproc/pic/pic.h | 6 ++++++
src/utils/indxbib/signal.c | 9 ++++++++-
28 files changed, 165 insertions(+), 16 deletions(-)
diff --git a/src/include/stringclass.h b/src/include/stringclass.h
index b9245e10d..cc4616009 100644
--- a/src/include/stringclass.h
+++ b/src/include/stringclass.h
@@ -196,3 +196,9 @@ inline string &string::operator+=(char c)
void put_string(const string &, FILE *);
string as_string(int);
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libbib/map.c b/src/libs/libbib/map.c
index 7da0f6e57..06710e199 100644
--- a/src/libs/libbib/map.c
+++ b/src/libs/libbib/map.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989- 2014 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2014 Free Software Foundation, Inc.
Written by James Clark ([email protected])
This file is part of groff.
@@ -86,3 +86,9 @@ int unmap(char *p, int len)
#endif
#endif /* not HAVE_MMAP */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/assert.cpp b/src/libs/libgroff/assert.cpp
index 9da3d4660..70b6bf8dc 100644
--- a/src/libs/libgroff/assert.cpp
+++ b/src/libs/libgroff/assert.cpp
@@ -36,3 +36,9 @@ void assertion_failed(int lineno, const char *filename,
fflush(stderr);
abort();
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/change_lf.cpp b/src/libs/libgroff/change_lf.cpp
index 012ac8486..f06b6d545 100644
--- a/src/libs/libgroff/change_lf.cpp
+++ b/src/libs/libgroff/change_lf.cpp
@@ -38,3 +38,9 @@ void change_lineno(int ln)
{
current_lineno = ln;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/cmap.cpp b/src/libs/libgroff/cmap.cpp
index cc685f35b..0eee1f7f3 100644
--- a/src/libs/libgroff/cmap.cpp
+++ b/src/libs/libgroff/cmap.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
Written by James Clark ([email protected])
@@ -57,3 +56,9 @@ cmap_init::cmap_init()
cmlower.v[i] = ISASCII(i) && isupper(i) ? tolower(i) : i;
}
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/cset.cpp b/src/libs/libgroff/cset.cpp
index 9f080fbac..309e6109b 100644
--- a/src/libs/libgroff/cset.cpp
+++ b/src/libs/libgroff/cset.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
Written by James Clark ([email protected])
@@ -105,3 +104,9 @@ cset_init::cset_init()
cscntrl.v[i] = ISASCII(i) && iscntrl(i);
}
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/device.cpp b/src/libs/libgroff/device.cpp
index 6caeb8ed6..be21d6a45 100644
--- a/src/libs/libgroff/device.cpp
+++ b/src/libs/libgroff/device.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
Written by James Clark ([email protected])
@@ -37,3 +36,9 @@ device_init::device_init()
if (tem && tem[0])
device = tem;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/fatal.cpp b/src/libs/libgroff/fatal.cpp
index 1cbf3ef53..4ba42f31b 100644
--- a/src/libs/libgroff/fatal.cpp
+++ b/src/libs/libgroff/fatal.cpp
@@ -28,3 +28,9 @@ void fatal_error_exit()
{
exit(FATAL_ERROR_EXIT_CODE);
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/fmod.c b/src/libs/libgroff/fmod.c
index 121ebec39..15a9eaeaf 100644
--- a/src/libs/libgroff/fmod.c
+++ b/src/libs/libgroff/fmod.c
@@ -28,3 +28,9 @@ double fmod(x, y)
double quot = x/y;
return x - (quot < 0.0 ? ceil(quot) : floor(quot)) * y;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/geometry.cpp b/src/libs/libgroff/geometry.cpp
index 971c86175..1bb23b968 100644
--- a/src/libs/libgroff/geometry.cpp
+++ b/src/libs/libgroff/geometry.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
Written by Gaius Mulley <[email protected]>
using adjust_arc_center() from printer.cpp, written by James Clark.
@@ -178,3 +177,9 @@ void check_output_arc_limits(int x_1, int y_1,
*miny += ycenter;
*maxy += ycenter;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/getcwd.c b/src/libs/libgroff/getcwd.c
index a95da6062..0394653d3 100644
--- a/src/libs/libgroff/getcwd.c
+++ b/src/libs/libgroff/getcwd.c
@@ -55,3 +55,9 @@ char *getcwd(buf, size)
return buf;
}
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/getopt.c b/src/libs/libgroff/getopt.c
index 2bf2eee8e..6d4ee5b3a 100644
--- a/src/libs/libgroff/getopt.c
+++ b/src/libs/libgroff/getopt.c
@@ -1240,3 +1240,9 @@ main (int argc, char **argv)
}
#endif /* TEST */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/getopt1.c b/src/libs/libgroff/getopt1.c
index 374b3ce18..15bcfd4f9 100644
--- a/src/libs/libgroff/getopt1.c
+++ b/src/libs/libgroff/getopt1.c
@@ -170,3 +170,9 @@ main (int argc, char **argv)
}
#endif /* TEST */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/hypot.cpp b/src/libs/libgroff/hypot.cpp
index fa0977d5d..597316383 100644
--- a/src/libs/libgroff/hypot.cpp
+++ b/src/libs/libgroff/hypot.cpp
@@ -32,3 +32,9 @@ double groff_hypot(double x, double y)
return result;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/localcharset.c b/src/libs/libgroff/localcharset.c
index 9ce57a835..f98fc62f8 100644
--- a/src/libs/libgroff/localcharset.c
+++ b/src/libs/libgroff/localcharset.c
@@ -579,3 +579,9 @@ locale_charset (void)
return codeset;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/matherr.c b/src/libs/libgroff/matherr.c
index a1adbf837..3c0340f01 100644
--- a/src/libs/libgroff/matherr.c
+++ b/src/libs/libgroff/matherr.c
@@ -46,3 +46,9 @@ struct exception *exc;
#endif /* TLOSS */
#endif /* HAVE_STRUCT_EXCEPTION */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/ptable.cpp b/src/libs/libgroff/ptable.cpp
index 1289f85d9..18626137f 100644
--- a/src/libs/libgroff/ptable.cpp
+++ b/src/libs/libgroff/ptable.cpp
@@ -41,19 +41,23 @@ unsigned long hash_string(const char *s)
return h;
}
-static const unsigned table_sizes[] = {
+static const unsigned table_sizes[] = {
101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009,
80021, 160001, 500009, 1000003, 2000003, 4000037, 8000009,
- 16000057, 32000011, 64000031, 128000003, 0
+ 16000057, 32000011, 64000031, 128000003, 0
};
unsigned next_ptable_size(unsigned n)
{
- const unsigned *p;
+ const unsigned *p;
for (p = table_sizes; *p <= n; p++)
if (*p == 0)
fatal("cannot expand table");
return *p;
}
-// end of ptable.cpp
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/putenv.c b/src/libs/libgroff/putenv.c
index 692a1263a..de8f657d3 100644
--- a/src/libs/libgroff/putenv.c
+++ b/src/libs/libgroff/putenv.c
@@ -95,3 +95,9 @@ int putenv(const char *string)
return 0;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/quotearg.c b/src/libs/libgroff/quotearg.c
index 950cc98dc..9ac565cb7 100644
--- a/src/libs/libgroff/quotearg.c
+++ b/src/libs/libgroff/quotearg.c
@@ -212,4 +212,8 @@ purge_quoted_args(char **argv)
}
}
-/* quotearg.c: end of file */
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/spawnvp.c b/src/libs/libgroff/spawnvp.c
index 765e7588f..9851a40e4 100644
--- a/src/libs/libgroff/spawnvp.c
+++ b/src/libs/libgroff/spawnvp.c
@@ -117,4 +117,8 @@ spawnvp_wrapper(int mode, char *path, char **argv)
#endif /* __MSDOS__ || _WIN32 */
-/* spawnvp.c: end of file */
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/strcasecmp.c b/src/libs/libgroff/strcasecmp.c
index 22c099720..f9dca5d57 100644
--- a/src/libs/libgroff/strcasecmp.c
+++ b/src/libs/libgroff/strcasecmp.c
@@ -63,3 +63,9 @@ STRXCASECMP_FUNCTION (const char *s1, const char *s2
STRXCASECMP_DECLARE_N)
return c1 - c2;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/strerror.c b/src/libs/libgroff/strerror.c
index a8887e5a7..c6c3475d1 100644
--- a/src/libs/libgroff/strerror.c
+++ b/src/libs/libgroff/strerror.c
@@ -44,3 +44,9 @@ char *strerror(n)
return buf;
}
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/strtol.c b/src/libs/libgroff/strtol.c
index 182073245..e2cea0795 100644
--- a/src/libs/libgroff/strtol.c
+++ b/src/libs/libgroff/strtol.c
@@ -123,9 +123,15 @@ long strtol(str, ptr, base)
val = val*base + n;
}
}
-
+
if (ptr)
*ptr = str;
return val;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libxutil/xmalloc.c b/src/libs/libxutil/xmalloc.c
index 7c19c2ef9..a9c989401 100644
--- a/src/libs/libxutil/xmalloc.c
+++ b/src/libs/libxutil/xmalloc.c
@@ -26,5 +26,5 @@ char *xmalloc(int n);
char *xmalloc(int n)
{
- return XtMalloc(n);
+ return XtMalloc(n);
}
diff --git a/src/preproc/eqn/text.cpp b/src/preproc/eqn/text.cpp
index 272f3feba..59e39e698 100644
--- a/src/preproc/eqn/text.cpp
+++ b/src/preproc/eqn/text.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
Written by James Clark ([email protected])
@@ -955,3 +954,8 @@ box *split_text(char *text)
return new quoted_text_box(0);
}
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp
index e207fb1f8..d0b648c27 100644
--- a/src/preproc/pic/object.cpp
+++ b/src/preproc/pic/object.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
Written by James Clark ([email protected])
@@ -2077,3 +2076,8 @@ void print_picture(object *obj)
out->finish_picture();
}
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h
index e6bc71d2c..d681b327a 100644
--- a/src/preproc/pic/pic.h
+++ b/src/preproc/pic/pic.h
@@ -124,3 +124,9 @@ extern int driver_extension_flag;
extern int compatible_flag;
extern int safer_flag;
extern char *graphname;
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/utils/indxbib/signal.c b/src/utils/indxbib/signal.c
index 7cf0dea9b..c1bf8631a 100644
--- a/src/utils/indxbib/signal.c
+++ b/src/utils/indxbib/signal.c
@@ -17,7 +17,8 @@ You should have received a copy of the GNU General Public
License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Unfortunately vendors seem to have problems writing a <signal.h>
-that is correct for C++, so we implement all signal handling in C. */
+ that is correct for C++, so we implement all signal handling in C. */
+// TODO: Revisit that 1993 claim in 2023. Use gnulib?
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -77,3 +78,9 @@ void ignore_fatal_signals()
}
#endif /* not HAVE_RENAME */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit