Mercurial > hg > xemacs-beta
comparison src/elhash.c @ 5277:d804e621add0
Simplify the API of PARSE_KEYWORDS for callers.
src/ChangeLog addition:
2010-09-18 Aidan Kehoe <kehoea@parhasard.net>
Simplify the API of PARSE_KEYWORDS for callers.
* lisp.h (PARSE_KEYWORDS): Simply the API, while making the
implementation a little more complex; work out KEYWORDS_OFFSET
from the appropriate Lisp_Subr struct, take the function name as
the C name of the DEFUN rather than a symbol visible as a
Lisp_Object, on debug builds assert that we're actually in the
function so we choke on badly-done copy-and-pasting,
* lisp.h (PARSE_KEYWORDS_8): New. This is the old PARSE_KEYWORDS.
* fns.c (Fmerge, FsortX, Ffill, Freduce, Freplace):
Change to use the new PARSE_KEYWORDS syntax.
* elhash.c (Fmake_hash_table): Chance to the new PARSE_KEYWORDS
syntax, rename a define to correspond to what other files use.
* symbols.c (intern_massaging_name):
* buffer.c (ADD_INT):
Rename intern_converting_underscores_to_dashes() to
intern_massaging_name(), now it does a little more.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 18 Sep 2010 15:57:20 +0100 |
parents | 33899241a6a8 |
children | c096d8051f89 308d34e9f07d |
comparison
equal
deleted
inserted
replaced
5276:dd2976af8783 | 5277:d804e621add0 |
---|---|
960 else if (EQ (key, Qsize)) size = value; | 960 else if (EQ (key, Qsize)) size = value; |
961 else if (EQ (key, Qrehash_size)) rehash_size = value; | 961 else if (EQ (key, Qrehash_size)) rehash_size = value; |
962 else if (EQ (key, Qrehash_threshold)) rehash_threshold = value; | 962 else if (EQ (key, Qrehash_threshold)) rehash_threshold = value; |
963 else if (EQ (key, Qweakness)) weakness = value; | 963 else if (EQ (key, Qweakness)) weakness = value; |
964 else if (EQ (key, Qdata)) data = value; | 964 else if (EQ (key, Qdata)) data = value; |
965 #ifndef NO_NEED_TO_HANDLE_21_4_CODE | 965 #ifdef NEED_TO_HANDLE_21_4_CODE |
966 else if (EQ (key, Qtype))/*obsolete*/ weakness = value; | 966 else if (EQ (key, Qtype))/*obsolete*/ weakness = value; |
967 #endif | 967 #endif |
968 else if (KEYWORDP (key)) | 968 else if (KEYWORDP (key)) |
969 signal_error (Qinvalid_read_syntax, | 969 signal_error (Qinvalid_read_syntax, |
970 "can't mix keyword and non-keyword hash table syntax", | 970 "can't mix keyword and non-keyword hash table syntax", |
1107 | 1107 |
1108 arguments: (&key TEST SIZE REHASH-SIZE REHASH-THRESHOLD WEAKNESS) | 1108 arguments: (&key TEST SIZE REHASH-SIZE REHASH-THRESHOLD WEAKNESS) |
1109 */ | 1109 */ |
1110 (int nargs, Lisp_Object *args)) | 1110 (int nargs, Lisp_Object *args)) |
1111 { | 1111 { |
1112 #ifdef NO_NEED_TO_HANDLE_21_4_CODE | 1112 #ifndef NEED_TO_HANDLE_21_4_CODE |
1113 PARSE_KEYWORDS (Qmake_hash_table, nargs, args, 0, 5, | 1113 PARSE_KEYWORDS (Fmake_hash_table, nargs, args, 5, |
1114 (test, size, rehash_size, rehash_threshold, weakness), | 1114 (test, size, rehash_size, rehash_threshold, weakness), |
1115 NULL, 0); | 1115 NULL); |
1116 #else | 1116 #else |
1117 PARSE_KEYWORDS (Qmake_hash_table, nargs, args, 0, 6, | 1117 PARSE_KEYWORDS (Fmake_hash_table, nargs, args, 6, |
1118 (test, size, rehash_size, rehash_threshold, weakness, | 1118 (test, size, rehash_size, rehash_threshold, weakness, |
1119 type), (type = Qunbound, weakness = Qunbound), 0); | 1119 type), (type = Qunbound, weakness = Qunbound)); |
1120 | 1120 |
1121 if (EQ (weakness, Qunbound)) | 1121 if (EQ (weakness, Qunbound)) |
1122 { | 1122 { |
1123 if (EQ (weakness, Qunbound) && !EQ (type, Qunbound)) | 1123 if (EQ (weakness, Qunbound) && !EQ (type, Qunbound)) |
1124 { | 1124 { |