groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 28/80: [libbib]: Fix code style nits.


From: G. Branden Robinson
Subject: [groff] 28/80: [libbib]: Fix code style nits.
Date: Sat, 30 Nov 2024 04:02:17 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 3cfc70b5b5f76f6a4d329c48bbcc6f3bc56eb0d4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 27 14:33:13 2024 -0600

    [libbib]: Fix code style nits.
    
    * src/utils/libbib/index.cpp:
    * src/utils/libbib/linear.cpp:
    * src/utils/libbib/search.cpp: Align with modern groff conventions.
      Include system library headers before local ones.
    
    * src/utils/libbib/index.cpp: Add Autoconf "<config.h>"-inclusion
      boilerplate to this translation unit.
---
 ChangeLog                  | 10 ++++++++++
 src/libs/libbib/common.cpp |  5 +++++
 src/libs/libbib/index.cpp  |  8 ++++++--
 src/libs/libbib/linear.cpp |  6 +++---
 src/libs/libbib/search.cpp |  6 +++---
 5 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1c3c8d0cb..1c969c04f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/utils/libbib/index.cpp:
+       * src/utils/libbib/linear.cpp:
+       * src/utils/libbib/search.cpp: Align with modern groff
+       conventions.  Include system library headers before local ones.
+
+       * src/utils/libbib/index.cpp: Add Autoconf "<config.h>"-
+       inclusion boilerplate to this translation unit.
+
 2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/utils/hpftodit/hpftodit.cpp:
diff --git a/src/libs/libbib/common.cpp b/src/libs/libbib/common.cpp
index 05accd809..340c770c0 100644
--- a/src/libs/libbib/common.cpp
+++ b/src/libs/libbib/common.cpp
@@ -35,3 +35,8 @@ unsigned hash(const char *s, int len)
   return h;
 }
 
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libbib/index.cpp b/src/libs/libbib/index.cpp
index 53088397a..349d4c54a 100644
--- a/src/libs/libbib/index.cpp
+++ b/src/libs/libbib/index.cpp
@@ -16,10 +16,14 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include "lib.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
-#include <stdlib.h>
 #include <errno.h>
+#include <stdlib.h> // free(), malloc()
+
+#include "lib.h"
 
 #include "posix.h"
 #include "cset.h"
diff --git a/src/libs/libbib/linear.cpp b/src/libs/libbib/linear.cpp
index 13a28148c..2db51e719 100644
--- a/src/libs/libbib/linear.cpp
+++ b/src/libs/libbib/linear.cpp
@@ -16,15 +16,15 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include "lib.h"
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #include <assert.h>
-#include <stdlib.h>
 #include <errno.h>
+#include <string.h> // strchr(), strerror()
+
+#include "lib.h"
 
 #include "posix.h"
 #include "errarg.h"
diff --git a/src/libs/libbib/search.cpp b/src/libs/libbib/search.cpp
index 222acf3bf..5b455ce12 100644
--- a/src/libs/libbib/search.cpp
+++ b/src/libs/libbib/search.cpp
@@ -16,15 +16,15 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include "lib.h"
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #include <assert.h>
-#include <stdlib.h>
 #include <errno.h>
+#include <string.h> // strchr(), strcmp(), strerror(), strlen()
+
+#include "lib.h"
 
 #include "posix.h"
 #include "errarg.h"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]