diff options
| author | Kim F. Storm | 2006-07-18 13:28:02 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-07-18 13:28:02 +0000 |
| commit | 692ae65c86d601f90c0b1937546ebcb874bda066 (patch) | |
| tree | 84020c7278045a6319891772b305246732dd5740 /src | |
| parent | edef16312ebfce4799a96ceece8131d7a41509e9 (diff) | |
| download | emacs-692ae65c86d601f90c0b1937546ebcb874bda066.tar.gz emacs-692ae65c86d601f90c0b1937546ebcb874bda066.zip | |
(Flength): wrong_type_argument is no-return.
(hashfn_user_defined, Fmake_hash_table): Use signal_error.
(Fmd5): Use xsignal1.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 34 |
1 files changed, 10 insertions, 24 deletions
| @@ -182,7 +182,7 @@ To get the number of bytes, use `string-bytes'. */) | |||
| 182 | else if (NILP (sequence)) | 182 | else if (NILP (sequence)) |
| 183 | XSETFASTINT (val, 0); | 183 | XSETFASTINT (val, 0); |
| 184 | else | 184 | else |
| 185 | val = wrong_type_argument (Qsequencep, sequence); | 185 | wrong_type_argument (Qsequencep, sequence); |
| 186 | 186 | ||
| 187 | return val; | 187 | return val; |
| 188 | } | 188 | } |
| @@ -4487,10 +4487,7 @@ hashfn_user_defined (h, key) | |||
| 4487 | args[1] = key; | 4487 | args[1] = key; |
| 4488 | hash = Ffuncall (2, args); | 4488 | hash = Ffuncall (2, args); |
| 4489 | if (!INTEGERP (hash)) | 4489 | if (!INTEGERP (hash)) |
| 4490 | Fsignal (Qerror, | 4490 | signal_error ("Invalid hash code returned from user-supplied hash function", hash); |
| 4491 | list2 (build_string ("Invalid hash code returned from \ | ||
| 4492 | user-supplied hash function"), | ||
| 4493 | hash)); | ||
| 4494 | return XUINT (hash); | 4491 | return XUINT (hash); |
| 4495 | } | 4492 | } |
| 4496 | 4493 | ||
| @@ -5246,8 +5243,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5246 | 5243 | ||
| 5247 | prop = Fget (test, Qhash_table_test); | 5244 | prop = Fget (test, Qhash_table_test); |
| 5248 | if (!CONSP (prop) || !CONSP (XCDR (prop))) | 5245 | if (!CONSP (prop) || !CONSP (XCDR (prop))) |
| 5249 | Fsignal (Qerror, list2 (build_string ("Invalid hash table test"), | 5246 | signal_error ("Invalid hash table test", test); |
| 5250 | test)); | ||
| 5251 | user_test = XCAR (prop); | 5247 | user_test = XCAR (prop); |
| 5252 | user_hash = XCAR (XCDR (prop)); | 5248 | user_hash = XCAR (XCDR (prop)); |
| 5253 | } | 5249 | } |
| @@ -5260,9 +5256,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5260 | if (NILP (size)) | 5256 | if (NILP (size)) |
| 5261 | size = make_number (DEFAULT_HASH_SIZE); | 5257 | size = make_number (DEFAULT_HASH_SIZE); |
| 5262 | else if (!INTEGERP (size) || XINT (size) < 0) | 5258 | else if (!INTEGERP (size) || XINT (size) < 0) |
| 5263 | Fsignal (Qerror, | 5259 | signal_error ("Invalid hash table size", size); |
| 5264 | list2 (build_string ("Invalid hash table size"), | ||
| 5265 | size)); | ||
| 5266 | 5260 | ||
| 5267 | /* Look for `:rehash-size SIZE'. */ | 5261 | /* Look for `:rehash-size SIZE'. */ |
| 5268 | i = get_key_arg (QCrehash_size, nargs, args, used); | 5262 | i = get_key_arg (QCrehash_size, nargs, args, used); |
| @@ -5270,9 +5264,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5270 | if (!NUMBERP (rehash_size) | 5264 | if (!NUMBERP (rehash_size) |
| 5271 | || (INTEGERP (rehash_size) && XINT (rehash_size) <= 0) | 5265 | || (INTEGERP (rehash_size) && XINT (rehash_size) <= 0) |
| 5272 | || XFLOATINT (rehash_size) <= 1.0) | 5266 | || XFLOATINT (rehash_size) <= 1.0) |
| 5273 | Fsignal (Qerror, | 5267 | signal_error ("Invalid hash table rehash size", rehash_size); |
| 5274 | list2 (build_string ("Invalid hash table rehash size"), | ||
| 5275 | rehash_size)); | ||
| 5276 | 5268 | ||
| 5277 | /* Look for `:rehash-threshold THRESHOLD'. */ | 5269 | /* Look for `:rehash-threshold THRESHOLD'. */ |
| 5278 | i = get_key_arg (QCrehash_threshold, nargs, args, used); | 5270 | i = get_key_arg (QCrehash_threshold, nargs, args, used); |
| @@ -5280,9 +5272,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5280 | if (!FLOATP (rehash_threshold) | 5272 | if (!FLOATP (rehash_threshold) |
| 5281 | || XFLOATINT (rehash_threshold) <= 0.0 | 5273 | || XFLOATINT (rehash_threshold) <= 0.0 |
| 5282 | || XFLOATINT (rehash_threshold) > 1.0) | 5274 | || XFLOATINT (rehash_threshold) > 1.0) |
| 5283 | Fsignal (Qerror, | 5275 | signal_error ("Invalid hash table rehash threshold", rehash_threshold); |
| 5284 | list2 (build_string ("Invalid hash table rehash threshold"), | ||
| 5285 | rehash_threshold)); | ||
| 5286 | 5276 | ||
| 5287 | /* Look for `:weakness WEAK'. */ | 5277 | /* Look for `:weakness WEAK'. */ |
| 5288 | i = get_key_arg (QCweakness, nargs, args, used); | 5278 | i = get_key_arg (QCweakness, nargs, args, used); |
| @@ -5294,14 +5284,12 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5294 | && !EQ (weak, Qvalue) | 5284 | && !EQ (weak, Qvalue) |
| 5295 | && !EQ (weak, Qkey_or_value) | 5285 | && !EQ (weak, Qkey_or_value) |
| 5296 | && !EQ (weak, Qkey_and_value)) | 5286 | && !EQ (weak, Qkey_and_value)) |
| 5297 | Fsignal (Qerror, list2 (build_string ("Invalid hash table weakness"), | 5287 | signal_error ("Invalid hash table weakness", weak); |
| 5298 | weak)); | ||
| 5299 | 5288 | ||
| 5300 | /* Now, all args should have been used up, or there's a problem. */ | 5289 | /* Now, all args should have been used up, or there's a problem. */ |
| 5301 | for (i = 0; i < nargs; ++i) | 5290 | for (i = 0; i < nargs; ++i) |
| 5302 | if (!used[i]) | 5291 | if (!used[i]) |
| 5303 | Fsignal (Qerror, | 5292 | signal_error ("Invalid argument list", args[i]); |
| 5304 | list2 (build_string ("Invalid argument list"), args[i])); | ||
| 5305 | 5293 | ||
| 5306 | return make_hash_table (test, size, rehash_size, rehash_threshold, weak, | 5294 | return make_hash_table (test, size, rehash_size, rehash_threshold, weak, |
| 5307 | user_test, user_hash); | 5295 | user_test, user_hash); |
| @@ -5552,8 +5540,7 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5552 | if (!NILP (noerror)) | 5540 | if (!NILP (noerror)) |
| 5553 | coding_system = Qraw_text; | 5541 | coding_system = Qraw_text; |
| 5554 | else | 5542 | else |
| 5555 | while (1) | 5543 | xsignal1 (Qcoding_system_error, coding_system); |
| 5556 | Fsignal (Qcoding_system_error, Fcons (coding_system, Qnil)); | ||
| 5557 | } | 5544 | } |
| 5558 | 5545 | ||
| 5559 | if (STRING_MULTIBYTE (object)) | 5546 | if (STRING_MULTIBYTE (object)) |
| @@ -5687,8 +5674,7 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5687 | if (!NILP (noerror)) | 5674 | if (!NILP (noerror)) |
| 5688 | coding_system = Qraw_text; | 5675 | coding_system = Qraw_text; |
| 5689 | else | 5676 | else |
| 5690 | while (1) | 5677 | xsignal1 (Qcoding_system_error, coding_system); |
| 5691 | Fsignal (Qcoding_system_error, Fcons (coding_system, Qnil)); | ||
| 5692 | } | 5678 | } |
| 5693 | } | 5679 | } |
| 5694 | 5680 | ||