unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59118: [PATCH] Prefix all itree functions with itree_
@ 2022-11-08  5:29 Matt Armstrong
  2022-11-08  6:53 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Armstrong @ 2022-11-08  5:29 UTC (permalink / raw)
  To: 59118

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

Tags: patch

X-Debbugs-CC: Eli Zaretskii <eliz@gnu.org>, Basil L. Contovounesios <contovob@tcd.ie>

Steph and I put some effort into prefixing all functions in itree.h with
itree_.  It would be nice to be consistent with that.


In GNU Emacs 29.0.50 (build 9, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.16.0) of 2022-11-07 built on naz
Repository revision: d04433b96215d7d3387573f19cc315de86f2341a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201003
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure 'CFLAGS=-O2 -g3''


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Prefix-all-itree-functions-with-itree_.patch --]
[-- Type: text/patch, Size: 2559 bytes --]

From 3318c0688814de5d68a20038ff03d7376d4fd129 Mon Sep 17 00:00:00 2001
From: Matt Armstrong <matt@rfc20.org>
Date: Mon, 7 Nov 2022 21:21:36 -0800
Subject: [PATCH] Prefix all itree functions with itree_

* src/itree.h: init_itree -> itree_init, forget_itree to itree_forget.
* src/itree.c (itree_init): Rename.
(itree_forget): Rename.
* test/manual/noverlay/itree-tests.c (main): Handle rename.
---
 src/emacs.c                        | 4 ++--
 src/itree.c                        | 4 ++--
 src/itree.h                        | 4 ++--
 test/manual/noverlay/itree-tests.c | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/emacs.c b/src/emacs.c
index 1b2aa9442b7..d61cb4e1570 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1932,7 +1932,7 @@ main (int argc, char **argv)
   running_asynch_code = 0;
   init_random ();
   init_xfaces ();
-  init_itree ();
+  itree_init ();
 
 #if defined HAVE_JSON && !defined WINDOWSNT
   init_json ();
@@ -3105,7 +3105,7 @@ DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
   gflags.will_dump_with_unexec_ = false;
   gflags.dumped_with_unexec_ = true;
 
-  forget_itree ();
+  itree_forget ();
 
   alloc_unexec_pre ();
 
diff --git a/src/itree.c b/src/itree.c
index 989173db4e5..9088e3985eb 100644
--- a/src/itree.c
+++ b/src/itree.c
@@ -288,7 +288,7 @@ itree_iterator_create (struct itree_tree *tree)
 }
 
 void
-init_itree (void)
+itree_init (void)
 {
   eassert (!iter);
   iter = itree_iterator_create (NULL);
@@ -296,7 +296,7 @@ init_itree (void)
 
 #ifdef HAVE_UNEXEC
 void
-forget_itree (void)
+itree_forget (void)
 {
   iter = NULL;
 }
diff --git a/src/itree.h b/src/itree.h
index 10ee0897c37..5fdb4020dbd 100644
--- a/src/itree.h
+++ b/src/itree.h
@@ -106,9 +106,9 @@ #define ITREE_H
     ITREE_PRE_ORDER,
   };
 
-extern void init_itree (void);
+extern void itree_init (void);
 #ifdef HAVE_UNEXEC
-extern void forget_itree (void);
+extern void itree_forget (void);
 #endif
 extern void itree_node_init (struct itree_node *, bool, bool, Lisp_Object);
 extern ptrdiff_t itree_node_begin (struct itree_tree *, struct itree_node *);
diff --git a/test/manual/noverlay/itree-tests.c b/test/manual/noverlay/itree-tests.c
index 278e65f9bf7..08d4f357e24 100644
--- a/test/manual/noverlay/itree-tests.c
+++ b/test/manual/noverlay/itree-tests.c
@@ -1281,7 +1281,7 @@ main (void)
   Suite *s = basic_suite ();
   SRunner *sr = srunner_create (s);
 
-  init_itree ();
+  itree_init ();
   srunner_run_all (sr, CK_ENV);
   int nfailed = srunner_ntests_failed (sr);
   srunner_free (sr);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#59118: [PATCH] Prefix all itree functions with itree_
  2022-11-08  5:29 bug#59118: [PATCH] Prefix all itree functions with itree_ Matt Armstrong
@ 2022-11-08  6:53 ` Eli Zaretskii
  2022-11-08 16:03   ` Matt Armstrong
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2022-11-08  6:53 UTC (permalink / raw)
  To: 59118, matt

On November 8, 2022 7:29:15 AM GMT+02:00, Matt Armstrong <matt@rfc20.org> wrote:
> Tags: patch
> 
> X-Debbugs-CC: Eli Zaretskii <eliz@gnu.org>, Basil L. Contovounesios <contovob@tcd.ie>
> 
> Steph and I put some effort into prefixing all functions in itree.h with
> itree_.  It would be nice to be consistent with that.


Functions that initialize Emacs subsystems during startup are traditionally called init_FOO and syms_of_FOO.  So I'd rather we left init_itree alone.

As for forget_itree, I don't mind renaming it, although it's largely a wasted effort: that function is only present in the unexec build, and will die of natural causes at some not too distant point.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#59118: [PATCH] Prefix all itree functions with itree_
  2022-11-08  6:53 ` Eli Zaretskii
@ 2022-11-08 16:03   ` Matt Armstrong
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Armstrong @ 2022-11-08 16:03 UTC (permalink / raw)
  To: Eli Zaretskii, 59118-done

Eli Zaretskii <eliz@gnu.org> writes:

> Functions that initialize Emacs subsystems during startup are
> traditionally called init_FOO and syms_of_FOO.  So I'd rather we left
> init_itree alone.
>
> As for forget_itree, I don't mind renaming it, although it's largely a
> wasted effort: that function is only present in the unexec build, and
> will die of natural causes at some not too distant point.

Fair enough, closing.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-08 16:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08  5:29 bug#59118: [PATCH] Prefix all itree functions with itree_ Matt Armstrong
2022-11-08  6:53 ` Eli Zaretskii
2022-11-08 16:03   ` Matt Armstrong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).