aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2025-12-14 14:45:49 -0800
committerPaul Eggert2025-12-14 14:47:22 -0800
commit5fe0b9e6b017d7f6662ee7fcb5aa6d1ce2ede316 (patch)
treea23d822878174a7a6f0dd89f231ddbf5cf2a3829 /lib-src
parent19e5d27dafa84d93cb84469c9f21594c05204bb3 (diff)
downloademacs-5fe0b9e6b017d7f6662ee7fcb5aa6d1ce2ede316.tar.gz
emacs-5fe0b9e6b017d7f6662ee7fcb5aa6d1ce2ede316.zip
make-docfile preferring streq
* lib-src/make-docfile.c (main, add_global, compare_globals): Prefer streq to strcmp where either will do.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/make-docfile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index f41cf8d136b..ac3c7ccc9d3 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -150,7 +150,7 @@ main (int argc, char **argv)
150 150
151 /* If first two args are -o FILE, output to FILE. */ 151 /* If first two args are -o FILE, output to FILE. */
152 i = 1; 152 i = 1;
153 if (argc > i + 1 && !strcmp (argv[i], "-o")) 153 if (argc > i + 1 && streq (argv[i], "-o"))
154 { 154 {
155 if (! freopen (argv[i + 1], "w", stdout)) 155 if (! freopen (argv[i + 1], "w", stdout))
156 { 156 {
@@ -159,7 +159,7 @@ main (int argc, char **argv)
159 } 159 }
160 i += 2; 160 i += 2;
161 } 161 }
162 if (argc > i + 1 && !strcmp (argv[i], "-a")) 162 if (argc > i + 1 && streq (argv[i], "-a"))
163 { 163 {
164 if (! freopen (argv[i + 1], "a", stdout)) 164 if (! freopen (argv[i + 1], "a", stdout))
165 { 165 {
@@ -168,7 +168,7 @@ main (int argc, char **argv)
168 } 168 }
169 i += 2; 169 i += 2;
170 } 170 }
171 if (argc > i + 1 && !strcmp (argv[i], "-d")) 171 if (argc > i + 1 && streq (argv[i], "-d"))
172 { 172 {
173 if (chdir (argv[i + 1]) != 0) 173 if (chdir (argv[i + 1]) != 0)
174 { 174 {
@@ -177,7 +177,7 @@ main (int argc, char **argv)
177 } 177 }
178 i += 2; 178 i += 2;
179 } 179 }
180 if (argc > i && !strcmp (argv[i], "-g")) 180 if (argc > i && streq (argv[i], "-g"))
181 { 181 {
182 generate_globals = true; 182 generate_globals = true;
183 ++i; 183 ++i;
@@ -198,7 +198,7 @@ main (int argc, char **argv)
198 int j; 198 int j;
199 /* Don't process one file twice. */ 199 /* Don't process one file twice. */
200 for (j = first_infile; j < i; j++) 200 for (j = first_infile; j < i; j++)
201 if (strcmp (argv[i], argv[j]) == 0) 201 if (streq (argv[i], argv[j]))
202 break; 202 break;
203 if (j == i) 203 if (j == i)
204 scan_file (argv[i]); 204 scan_file (argv[i]);
@@ -602,7 +602,7 @@ add_global (enum global_type type, char const *name, int value,
602 char const *svalue) 602 char const *svalue)
603{ 603{
604 /* Ignore the one non-symbol that can occur. */ 604 /* Ignore the one non-symbol that can occur. */
605 if (strcmp (name, "...")) 605 if (!streq (name, "..."))
606 { 606 {
607 if (num_globals == num_globals_allocated) 607 if (num_globals == num_globals_allocated)
608 { 608 {
@@ -654,9 +654,9 @@ compare_globals (const void *a, const void *b)
654 int ai = ncommonsym, bi = ncommonsym; 654 int ai = ncommonsym, bi = ncommonsym;
655 for (int i = 0; i < ncommonsym; i++) 655 for (int i = 0; i < ncommonsym; i++)
656 { 656 {
657 if (ga->name[0] == 'Q' && strcmp (ga->name + 1, commonsym[i]) == 0) 657 if (ga->name[0] == 'Q' && streq (ga->name + 1, commonsym[i]))
658 ai = i; 658 ai = i;
659 if (gb->name[0] == 'Q' && strcmp (gb->name + 1, commonsym[i]) == 0) 659 if (gb->name[0] == 'Q' && streq (gb->name + 1, commonsym[i]))
660 bi = i; 660 bi = i;
661 } 661 }
662 if (! (ai == ncommonsym && bi == ncommonsym)) 662 if (! (ai == ncommonsym && bi == ncommonsym))
@@ -692,7 +692,7 @@ write_globals (void)
692 for (i = 0; i < num_globals; i++) 692 for (i = 0; i < num_globals; i++)
693 { 693 {
694 while (i + 1 < num_globals 694 while (i + 1 < num_globals
695 && strcmp (globals[i].name, globals[i + 1].name) == 0) 695 && streq (globals[i].name, globals[i + 1].name))
696 { 696 {
697 if (globals[i].type == FUNCTION 697 if (globals[i].type == FUNCTION
698 && globals[i].v.value != globals[i + 1].v.value) 698 && globals[i].v.value != globals[i + 1].v.value)