aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2024-01-20 16:52:31 -0800
committerPaul Eggert2024-01-20 17:28:53 -0800
commitb6ed79b71ccb3df8df05531d473ff9510cf9a39f (patch)
treecea1f448b8e163fc0972b09774f075f9c2277372 /lib-src
parent0a47a5a4bef0a33c012302346685ecab861cc306 (diff)
downloademacs-b6ed79b71ccb3df8df05531d473ff9510cf9a39f.tar.gz
emacs-b6ed79b71ccb3df8df05531d473ff9510cf9a39f.zip
Be more systematic about parens in C source code
Be more systematic about putting space before paren in calls, and in avoiding unnecessary parentheses in macros. This was partly inspired by my wading through gcc -E output while debugging something else, and seeing too many parens. This patch does not change the generated .o files on my platform.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c6
-rw-r--r--lib-src/seccomp-filter.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 506366141e6..032cfa8010b 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -3825,7 +3825,7 @@ C_entries (int c_ext, /* extension of C */
3825 { 3825 {
3826 case fstartlist: 3826 case fstartlist:
3827 /* This prevents tagging fb in 3827 /* This prevents tagging fb in
3828 void (__attribute__((noreturn)) *fb) (void); 3828 void (__attribute__ ((noreturn)) *fb) (void);
3829 Fixing this is not easy and not very important. */ 3829 Fixing this is not easy and not very important. */
3830 fvdef = finlist; 3830 fvdef = finlist;
3831 continue; 3831 continue;
@@ -4380,14 +4380,14 @@ Yacc_entries (FILE *inf)
4380 4380
4381#define LOOKING_AT(cp, kw) /* kw is the keyword, a literal string */ \ 4381#define LOOKING_AT(cp, kw) /* kw is the keyword, a literal string */ \
4382 ((assert ("" kw), true) /* syntax error if not a literal string */ \ 4382 ((assert ("" kw), true) /* syntax error if not a literal string */ \
4383 && strneq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \ 4383 && strneq (cp, kw, sizeof (kw) - 1) /* cp points at kw */ \
4384 && notinname ((cp)[sizeof (kw)-1]) /* end of kw */ \ 4384 && notinname ((cp)[sizeof (kw)-1]) /* end of kw */ \
4385 && ((cp) = skip_spaces ((cp) + sizeof (kw) - 1), true)) /* skip spaces */ 4385 && ((cp) = skip_spaces ((cp) + sizeof (kw) - 1), true)) /* skip spaces */
4386 4386
4387/* Similar to LOOKING_AT but does not use notinname, does not skip */ 4387/* Similar to LOOKING_AT but does not use notinname, does not skip */
4388#define LOOKING_AT_NOCASE(cp, kw) /* the keyword is a literal string */ \ 4388#define LOOKING_AT_NOCASE(cp, kw) /* the keyword is a literal string */ \
4389 ((assert ("" kw), true) /* syntax error if not a literal string */ \ 4389 ((assert ("" kw), true) /* syntax error if not a literal string */ \
4390 && strncaseeq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \ 4390 && strncaseeq (cp, kw, sizeof (kw) - 1) /* cp points at kw */ \
4391 && ((cp) += sizeof (kw) - 1, true)) /* skip spaces */ 4391 && ((cp) += sizeof (kw) - 1, true)) /* skip spaces */
4392 4392
4393/* 4393/*
diff --git a/lib-src/seccomp-filter.c b/lib-src/seccomp-filter.c
index 8846e6aedae..0aeb6e8d88a 100644
--- a/lib-src/seccomp-filter.c
+++ b/lib-src/seccomp-filter.c
@@ -114,7 +114,7 @@ set_attribute (enum scmp_filter_attr attr, uint32_t value)
114 { \ 114 { \
115 const struct scmp_arg_cmp arg_array[] = {__VA_ARGS__}; \ 115 const struct scmp_arg_cmp arg_array[] = {__VA_ARGS__}; \
116 enum { arg_cnt = sizeof arg_array / sizeof *arg_array }; \ 116 enum { arg_cnt = sizeof arg_array / sizeof *arg_array }; \
117 int status = seccomp_rule_add_array (ctx, (action), (syscall), \ 117 int status = seccomp_rule_add_array (ctx, action, syscall, \
118 arg_cnt, arg_array); \ 118 arg_cnt, arg_array); \
119 if (status < 0) \ 119 if (status < 0) \
120 fail (-status, "seccomp_rule_add_array (%s, %s, %d, {%s})", \ 120 fail (-status, "seccomp_rule_add_array (%s, %s, %d, {%s})", \
@@ -143,7 +143,7 @@ export_filter (const char *file,
143} 143}
144 144
145#define EXPORT_FILTER(file, function) \ 145#define EXPORT_FILTER(file, function) \
146 export_filter ((file), (function), #function) 146 export_filter (file, function, #function)
147 147
148int 148int
149main (int argc, char **argv) 149main (int argc, char **argv)