diff options
| author | Paul Eggert | 2024-01-20 16:52:31 -0800 |
|---|---|---|
| committer | Paul Eggert | 2024-01-20 17:28:53 -0800 |
| commit | b6ed79b71ccb3df8df05531d473ff9510cf9a39f (patch) | |
| tree | cea1f448b8e163fc0972b09774f075f9c2277372 /src/coding.h | |
| parent | 0a47a5a4bef0a33c012302346685ecab861cc306 (diff) | |
| download | emacs-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 'src/coding.h')
| -rw-r--r-- | src/coding.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/coding.h b/src/coding.h index 9beb4350bbf..8905e36838d 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -166,28 +166,28 @@ enum coding_attr_index | |||
| 166 | 166 | ||
| 167 | /* Return the name of a coding system specified by ID. */ | 167 | /* Return the name of a coding system specified by ID. */ |
| 168 | #define CODING_ID_NAME(id) \ | 168 | #define CODING_ID_NAME(id) \ |
| 169 | (HASH_KEY (XHASH_TABLE (Vcoding_system_hash_table), id)) | 169 | HASH_KEY (XHASH_TABLE (Vcoding_system_hash_table), id) |
| 170 | 170 | ||
| 171 | /* Return the attribute vector of a coding system specified by ID. */ | 171 | /* Return the attribute vector of a coding system specified by ID. */ |
| 172 | 172 | ||
| 173 | #define CODING_ID_ATTRS(id) \ | 173 | #define CODING_ID_ATTRS(id) \ |
| 174 | (AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 0)) | 174 | AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 0) |
| 175 | 175 | ||
| 176 | /* Return the list of aliases of a coding system specified by ID. */ | 176 | /* Return the list of aliases of a coding system specified by ID. */ |
| 177 | 177 | ||
| 178 | #define CODING_ID_ALIASES(id) \ | 178 | #define CODING_ID_ALIASES(id) \ |
| 179 | (AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 1)) | 179 | AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 1) |
| 180 | 180 | ||
| 181 | /* Return the eol-type of a coding system specified by ID. */ | 181 | /* Return the eol-type of a coding system specified by ID. */ |
| 182 | 182 | ||
| 183 | #define CODING_ID_EOL_TYPE(id) \ | 183 | #define CODING_ID_EOL_TYPE(id) \ |
| 184 | (AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 2)) | 184 | AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 2) |
| 185 | 185 | ||
| 186 | 186 | ||
| 187 | /* Return the spec vector of CODING_SYSTEM_SYMBOL. */ | 187 | /* Return the spec vector of CODING_SYSTEM_SYMBOL. */ |
| 188 | 188 | ||
| 189 | #define CODING_SYSTEM_SPEC(coding_system_symbol) \ | 189 | #define CODING_SYSTEM_SPEC(coding_system_symbol) \ |
| 190 | (Fgethash (coding_system_symbol, Vcoding_system_hash_table, Qnil)) | 190 | Fgethash (coding_system_symbol, Vcoding_system_hash_table, Qnil) |
| 191 | 191 | ||
| 192 | 192 | ||
| 193 | /* Return the ID of CODING_SYSTEM_SYMBOL. */ | 193 | /* Return the ID of CODING_SYSTEM_SYMBOL. */ |
| @@ -209,7 +209,7 @@ enum coding_attr_index | |||
| 209 | do { \ | 209 | do { \ |
| 210 | if (CODING_SYSTEM_ID (x) < 0 \ | 210 | if (CODING_SYSTEM_ID (x) < 0 \ |
| 211 | && NILP (Fcheck_coding_system (x))) \ | 211 | && NILP (Fcheck_coding_system (x))) \ |
| 212 | wrong_type_argument (Qcoding_system_p, (x)); \ | 212 | wrong_type_argument (Qcoding_system_p, x); \ |
| 213 | } while (false) | 213 | } while (false) |
| 214 | 214 | ||
| 215 | 215 | ||
| @@ -225,7 +225,7 @@ enum coding_attr_index | |||
| 225 | spec = CODING_SYSTEM_SPEC (x); \ | 225 | spec = CODING_SYSTEM_SPEC (x); \ |
| 226 | } \ | 226 | } \ |
| 227 | if (NILP (spec)) \ | 227 | if (NILP (spec)) \ |
| 228 | wrong_type_argument (Qcoding_system_p, (x)); \ | 228 | wrong_type_argument (Qcoding_system_p, x); \ |
| 229 | } while (false) | 229 | } while (false) |
| 230 | 230 | ||
| 231 | 231 | ||
| @@ -242,7 +242,7 @@ enum coding_attr_index | |||
| 242 | id = CODING_SYSTEM_ID (x); \ | 242 | id = CODING_SYSTEM_ID (x); \ |
| 243 | } \ | 243 | } \ |
| 244 | if (id < 0) \ | 244 | if (id < 0) \ |
| 245 | wrong_type_argument (Qcoding_system_p, (x)); \ | 245 | wrong_type_argument (Qcoding_system_p, x); \ |
| 246 | } while (false) | 246 | } while (false) |
| 247 | 247 | ||
| 248 | 248 | ||
| @@ -745,10 +745,9 @@ extern Lisp_Object from_unicode_buffer (const wchar_t *wstr); | |||
| 745 | 745 | ||
| 746 | #define decode_coding_c_string(coding, src, bytes, dst_object) \ | 746 | #define decode_coding_c_string(coding, src, bytes, dst_object) \ |
| 747 | do { \ | 747 | do { \ |
| 748 | (coding)->source = (src); \ | 748 | (coding)->source = src; \ |
| 749 | (coding)->src_chars = (coding)->src_bytes = (bytes); \ | 749 | (coding)->src_chars = (coding)->src_bytes = bytes; \ |
| 750 | decode_coding_object ((coding), Qnil, 0, 0, (bytes), (bytes), \ | 750 | decode_coding_object (coding, Qnil, 0, 0, bytes, bytes, dst_object); \ |
| 751 | (dst_object)); \ | ||
| 752 | } while (false) | 751 | } while (false) |
| 753 | 752 | ||
| 754 | 753 | ||