diff options
| author | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
| commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
| tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/fns.c | |
| parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
| download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip | |
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 184 |
1 files changed, 49 insertions, 135 deletions
| @@ -76,7 +76,7 @@ extern Lisp_Object Qinput_method_function; | |||
| 76 | 76 | ||
| 77 | static int internal_equal (Lisp_Object , Lisp_Object, int, int); | 77 | static int internal_equal (Lisp_Object , Lisp_Object, int, int); |
| 78 | 78 | ||
| 79 | extern long get_random (); | 79 | extern long get_random (void); |
| 80 | extern void seed_random (long); | 80 | extern void seed_random (long); |
| 81 | 81 | ||
| 82 | #ifndef HAVE_UNISTD_H | 82 | #ifndef HAVE_UNISTD_H |
| @@ -390,8 +390,7 @@ static Lisp_Object concat (int nargs, Lisp_Object *args, enum Lisp_Type target_t | |||
| 390 | 390 | ||
| 391 | /* ARGSUSED */ | 391 | /* ARGSUSED */ |
| 392 | Lisp_Object | 392 | Lisp_Object |
| 393 | concat2 (s1, s2) | 393 | concat2 (Lisp_Object s1, Lisp_Object s2) |
| 394 | Lisp_Object s1, s2; | ||
| 395 | { | 394 | { |
| 396 | Lisp_Object args[2]; | 395 | Lisp_Object args[2]; |
| 397 | args[0] = s1; | 396 | args[0] = s1; |
| @@ -401,8 +400,7 @@ concat2 (s1, s2) | |||
| 401 | 400 | ||
| 402 | /* ARGSUSED */ | 401 | /* ARGSUSED */ |
| 403 | Lisp_Object | 402 | Lisp_Object |
| 404 | concat3 (s1, s2, s3) | 403 | concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3) |
| 405 | Lisp_Object s1, s2, s3; | ||
| 406 | { | 404 | { |
| 407 | Lisp_Object args[3]; | 405 | Lisp_Object args[3]; |
| 408 | args[0] = s1; | 406 | args[0] = s1; |
| @@ -492,11 +490,7 @@ struct textprop_rec | |||
| 492 | }; | 490 | }; |
| 493 | 491 | ||
| 494 | static Lisp_Object | 492 | static Lisp_Object |
| 495 | concat (nargs, args, target_type, last_special) | 493 | concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special) |
| 496 | int nargs; | ||
| 497 | Lisp_Object *args; | ||
| 498 | enum Lisp_Type target_type; | ||
| 499 | int last_special; | ||
| 500 | { | 494 | { |
| 501 | Lisp_Object val; | 495 | Lisp_Object val; |
| 502 | register Lisp_Object tail; | 496 | register Lisp_Object tail; |
| @@ -777,7 +771,7 @@ static EMACS_INT string_char_byte_cache_charpos; | |||
| 777 | static EMACS_INT string_char_byte_cache_bytepos; | 771 | static EMACS_INT string_char_byte_cache_bytepos; |
| 778 | 772 | ||
| 779 | void | 773 | void |
| 780 | clear_string_char_byte_cache () | 774 | clear_string_char_byte_cache (void) |
| 781 | { | 775 | { |
| 782 | string_char_byte_cache_string = Qnil; | 776 | string_char_byte_cache_string = Qnil; |
| 783 | } | 777 | } |
| @@ -785,9 +779,7 @@ clear_string_char_byte_cache () | |||
| 785 | /* Return the byte index corresponding to CHAR_INDEX in STRING. */ | 779 | /* Return the byte index corresponding to CHAR_INDEX in STRING. */ |
| 786 | 780 | ||
| 787 | EMACS_INT | 781 | EMACS_INT |
| 788 | string_char_to_byte (string, char_index) | 782 | string_char_to_byte (Lisp_Object string, EMACS_INT char_index) |
| 789 | Lisp_Object string; | ||
| 790 | EMACS_INT char_index; | ||
| 791 | { | 783 | { |
| 792 | EMACS_INT i_byte; | 784 | EMACS_INT i_byte; |
| 793 | EMACS_INT best_below, best_below_byte; | 785 | EMACS_INT best_below, best_below_byte; |
| @@ -847,9 +839,7 @@ string_char_to_byte (string, char_index) | |||
| 847 | /* Return the character index corresponding to BYTE_INDEX in STRING. */ | 839 | /* Return the character index corresponding to BYTE_INDEX in STRING. */ |
| 848 | 840 | ||
| 849 | EMACS_INT | 841 | EMACS_INT |
| 850 | string_byte_to_char (string, byte_index) | 842 | string_byte_to_char (Lisp_Object string, EMACS_INT byte_index) |
| 851 | Lisp_Object string; | ||
| 852 | EMACS_INT byte_index; | ||
| 853 | { | 843 | { |
| 854 | EMACS_INT i, i_byte; | 844 | EMACS_INT i, i_byte; |
| 855 | EMACS_INT best_below, best_below_byte; | 845 | EMACS_INT best_below, best_below_byte; |
| @@ -913,8 +903,7 @@ string_byte_to_char (string, byte_index) | |||
| 913 | /* Convert STRING to a multibyte string. */ | 903 | /* Convert STRING to a multibyte string. */ |
| 914 | 904 | ||
| 915 | Lisp_Object | 905 | Lisp_Object |
| 916 | string_make_multibyte (string) | 906 | string_make_multibyte (Lisp_Object string) |
| 917 | Lisp_Object string; | ||
| 918 | { | 907 | { |
| 919 | unsigned char *buf; | 908 | unsigned char *buf; |
| 920 | EMACS_INT nbytes; | 909 | EMACS_INT nbytes; |
| @@ -947,8 +936,7 @@ string_make_multibyte (string) | |||
| 947 | converted to eight-bit characters. */ | 936 | converted to eight-bit characters. */ |
| 948 | 937 | ||
| 949 | Lisp_Object | 938 | Lisp_Object |
| 950 | string_to_multibyte (string) | 939 | string_to_multibyte (Lisp_Object string) |
| 951 | Lisp_Object string; | ||
| 952 | { | 940 | { |
| 953 | unsigned char *buf; | 941 | unsigned char *buf; |
| 954 | EMACS_INT nbytes; | 942 | EMACS_INT nbytes; |
| @@ -978,8 +966,7 @@ string_to_multibyte (string) | |||
| 978 | /* Convert STRING to a single-byte string. */ | 966 | /* Convert STRING to a single-byte string. */ |
| 979 | 967 | ||
| 980 | Lisp_Object | 968 | Lisp_Object |
| 981 | string_make_unibyte (string) | 969 | string_make_unibyte (Lisp_Object string) |
| 982 | Lisp_Object string; | ||
| 983 | { | 970 | { |
| 984 | int nchars; | 971 | int nchars; |
| 985 | unsigned char *buf; | 972 | unsigned char *buf; |
| @@ -1311,9 +1298,7 @@ With one argument, just copy STRING without its properties. */) | |||
| 1311 | both in characters and in bytes. */ | 1298 | both in characters and in bytes. */ |
| 1312 | 1299 | ||
| 1313 | Lisp_Object | 1300 | Lisp_Object |
| 1314 | substring_both (string, from, from_byte, to, to_byte) | 1301 | substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte) |
| 1315 | Lisp_Object string; | ||
| 1316 | int from, from_byte, to, to_byte; | ||
| 1317 | { | 1302 | { |
| 1318 | Lisp_Object res; | 1303 | Lisp_Object res; |
| 1319 | int size; | 1304 | int size; |
| @@ -1495,8 +1480,7 @@ Elements of LIST that are not conses are ignored. */) | |||
| 1495 | Use only on lists known never to be circular. */ | 1480 | Use only on lists known never to be circular. */ |
| 1496 | 1481 | ||
| 1497 | Lisp_Object | 1482 | Lisp_Object |
| 1498 | assq_no_quit (key, list) | 1483 | assq_no_quit (Lisp_Object key, Lisp_Object list) |
| 1499 | Lisp_Object key, list; | ||
| 1500 | { | 1484 | { |
| 1501 | while (CONSP (list) | 1485 | while (CONSP (list) |
| 1502 | && (!CONSP (XCAR (list)) | 1486 | && (!CONSP (XCAR (list)) |
| @@ -1547,8 +1531,7 @@ The value is actually the first element of LIST whose car equals KEY. */) | |||
| 1547 | Use only on lists known never to be circular. */ | 1531 | Use only on lists known never to be circular. */ |
| 1548 | 1532 | ||
| 1549 | Lisp_Object | 1533 | Lisp_Object |
| 1550 | assoc_no_quit (key, list) | 1534 | assoc_no_quit (Lisp_Object key, Lisp_Object list) |
| 1551 | Lisp_Object key, list; | ||
| 1552 | { | 1535 | { |
| 1553 | while (CONSP (list) | 1536 | while (CONSP (list) |
| 1554 | && (!CONSP (XCAR (list)) | 1537 | && (!CONSP (XCAR (list)) |
| @@ -1824,7 +1807,7 @@ See also the function `nreverse', which is used more often. */) | |||
| 1824 | return new; | 1807 | return new; |
| 1825 | } | 1808 | } |
| 1826 | 1809 | ||
| 1827 | Lisp_Object merge (); | 1810 | Lisp_Object merge (Lisp_Object org_l1, Lisp_Object org_l2, Lisp_Object pred); |
| 1828 | 1811 | ||
| 1829 | DEFUN ("sort", Fsort, Ssort, 2, 2, 0, | 1812 | DEFUN ("sort", Fsort, Ssort, 2, 2, 0, |
| 1830 | doc: /* Sort LIST, stably, comparing elements using PREDICATE. | 1813 | doc: /* Sort LIST, stably, comparing elements using PREDICATE. |
| @@ -1858,9 +1841,7 @@ if the first element should sort before the second. */) | |||
| 1858 | } | 1841 | } |
| 1859 | 1842 | ||
| 1860 | Lisp_Object | 1843 | Lisp_Object |
| 1861 | merge (org_l1, org_l2, pred) | 1844 | merge (Lisp_Object org_l1, Lisp_Object org_l2, Lisp_Object pred) |
| 1862 | Lisp_Object org_l1, org_l2; | ||
| 1863 | Lisp_Object pred; | ||
| 1864 | { | 1845 | { |
| 1865 | Lisp_Object value; | 1846 | Lisp_Object value; |
| 1866 | register Lisp_Object tail; | 1847 | register Lisp_Object tail; |
| @@ -2117,9 +2098,7 @@ of strings. (`equal' ignores text properties.) */) | |||
| 2117 | PROPS, if non-nil, means compare string text properties too. */ | 2098 | PROPS, if non-nil, means compare string text properties too. */ |
| 2118 | 2099 | ||
| 2119 | static int | 2100 | static int |
| 2120 | internal_equal (o1, o2, depth, props) | 2101 | internal_equal (register Lisp_Object o1, register Lisp_Object o2, int depth, int props) |
| 2121 | register Lisp_Object o1, o2; | ||
| 2122 | int depth, props; | ||
| 2123 | { | 2102 | { |
| 2124 | if (depth > 200) | 2103 | if (depth > 200) |
| 2125 | error ("Stack overflow in equal"); | 2104 | error ("Stack overflow in equal"); |
| @@ -2240,7 +2219,6 @@ internal_equal (o1, o2, depth, props) | |||
| 2240 | return 0; | 2219 | return 0; |
| 2241 | } | 2220 | } |
| 2242 | 2221 | ||
| 2243 | extern Lisp_Object Fmake_char_internal (); | ||
| 2244 | 2222 | ||
| 2245 | DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0, | 2223 | DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0, |
| 2246 | doc: /* Store each element of ARRAY with ITEM. | 2224 | doc: /* Store each element of ARRAY with ITEM. |
| @@ -2334,8 +2312,7 @@ This makes STRING unibyte and may change its length. */) | |||
| 2334 | 2312 | ||
| 2335 | /* ARGSUSED */ | 2313 | /* ARGSUSED */ |
| 2336 | Lisp_Object | 2314 | Lisp_Object |
| 2337 | nconc2 (s1, s2) | 2315 | nconc2 (Lisp_Object s1, Lisp_Object s2) |
| 2338 | Lisp_Object s1, s2; | ||
| 2339 | { | 2316 | { |
| 2340 | Lisp_Object args[2]; | 2317 | Lisp_Object args[2]; |
| 2341 | args[0] = s1; | 2318 | args[0] = s1; |
| @@ -2390,10 +2367,7 @@ usage: (nconc &rest LISTS) */) | |||
| 2390 | LENI is the length of VALS, which should also be the length of SEQ. */ | 2367 | LENI is the length of VALS, which should also be the length of SEQ. */ |
| 2391 | 2368 | ||
| 2392 | static void | 2369 | static void |
| 2393 | mapcar1 (leni, vals, fn, seq) | 2370 | mapcar1 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) |
| 2394 | int leni; | ||
| 2395 | Lisp_Object *vals; | ||
| 2396 | Lisp_Object fn, seq; | ||
| 2397 | { | 2371 | { |
| 2398 | register Lisp_Object tail; | 2372 | register Lisp_Object tail; |
| 2399 | Lisp_Object dummy; | 2373 | Lisp_Object dummy; |
| @@ -2702,8 +2676,7 @@ is nil and `use-dialog-box' is non-nil. */) | |||
| 2702 | Anything that calls this function must protect from GC! */ | 2676 | Anything that calls this function must protect from GC! */ |
| 2703 | 2677 | ||
| 2704 | Lisp_Object | 2678 | Lisp_Object |
| 2705 | do_yes_or_no_p (prompt) | 2679 | do_yes_or_no_p (Lisp_Object prompt) |
| 2706 | Lisp_Object prompt; | ||
| 2707 | { | 2680 | { |
| 2708 | return call1 (intern ("yes-or-no-p"), prompt); | 2681 | return call1 (intern ("yes-or-no-p"), prompt); |
| 2709 | } | 2682 | } |
| @@ -2870,8 +2843,7 @@ particular subfeatures supported in this version of FEATURE. */) | |||
| 2870 | Lisp_Object require_nesting_list; | 2843 | Lisp_Object require_nesting_list; |
| 2871 | 2844 | ||
| 2872 | Lisp_Object | 2845 | Lisp_Object |
| 2873 | require_unwind (old_value) | 2846 | require_unwind (Lisp_Object old_value) |
| 2874 | Lisp_Object old_value; | ||
| 2875 | { | 2847 | { |
| 2876 | return require_nesting_list = old_value; | 2848 | return require_nesting_list = old_value; |
| 2877 | } | 2849 | } |
| @@ -3333,12 +3305,7 @@ into shorter lines. */) | |||
| 3333 | } | 3305 | } |
| 3334 | 3306 | ||
| 3335 | static int | 3307 | static int |
| 3336 | base64_encode_1 (from, to, length, line_break, multibyte) | 3308 | base64_encode_1 (const char *from, char *to, int length, int line_break, int multibyte) |
| 3337 | const char *from; | ||
| 3338 | char *to; | ||
| 3339 | int length; | ||
| 3340 | int line_break; | ||
| 3341 | int multibyte; | ||
| 3342 | { | 3309 | { |
| 3343 | int counter = 0, i = 0; | 3310 | int counter = 0, i = 0; |
| 3344 | char *e = to; | 3311 | char *e = to; |
| @@ -3535,12 +3502,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 3535 | characters in *NCHARS_RETURN. */ | 3502 | characters in *NCHARS_RETURN. */ |
| 3536 | 3503 | ||
| 3537 | static int | 3504 | static int |
| 3538 | base64_decode_1 (from, to, length, multibyte, nchars_return) | 3505 | base64_decode_1 (const char *from, char *to, int length, int multibyte, int *nchars_return) |
| 3539 | const char *from; | ||
| 3540 | char *to; | ||
| 3541 | int length; | ||
| 3542 | int multibyte; | ||
| 3543 | int *nchars_return; | ||
| 3544 | { | 3506 | { |
| 3545 | int i = 0; | 3507 | int i = 0; |
| 3546 | char *e = to; | 3508 | char *e = to; |
| @@ -3682,8 +3644,7 @@ static int sweep_weak_table (struct Lisp_Hash_Table *, int); | |||
| 3682 | Lisp_Hash_Table. Otherwise, signal an error. */ | 3644 | Lisp_Hash_Table. Otherwise, signal an error. */ |
| 3683 | 3645 | ||
| 3684 | static struct Lisp_Hash_Table * | 3646 | static struct Lisp_Hash_Table * |
| 3685 | check_hash_table (obj) | 3647 | check_hash_table (Lisp_Object obj) |
| 3686 | Lisp_Object obj; | ||
| 3687 | { | 3648 | { |
| 3688 | CHECK_HASH_TABLE (obj); | 3649 | CHECK_HASH_TABLE (obj); |
| 3689 | return XHASH_TABLE (obj); | 3650 | return XHASH_TABLE (obj); |
| @@ -3694,8 +3655,7 @@ check_hash_table (obj) | |||
| 3694 | number. */ | 3655 | number. */ |
| 3695 | 3656 | ||
| 3696 | int | 3657 | int |
| 3697 | next_almost_prime (n) | 3658 | next_almost_prime (int n) |
| 3698 | int n; | ||
| 3699 | { | 3659 | { |
| 3700 | if (n % 2 == 0) | 3660 | if (n % 2 == 0) |
| 3701 | n += 1; | 3661 | n += 1; |
| @@ -3714,11 +3674,7 @@ next_almost_prime (n) | |||
| 3714 | a DEFUN parameter list. */ | 3674 | a DEFUN parameter list. */ |
| 3715 | 3675 | ||
| 3716 | static int | 3676 | static int |
| 3717 | get_key_arg (key, nargs, args, used) | 3677 | get_key_arg (Lisp_Object key, int nargs, Lisp_Object *args, char *used) |
| 3718 | Lisp_Object key; | ||
| 3719 | int nargs; | ||
| 3720 | Lisp_Object *args; | ||
| 3721 | char *used; | ||
| 3722 | { | 3678 | { |
| 3723 | int i; | 3679 | int i; |
| 3724 | 3680 | ||
| @@ -3743,10 +3699,7 @@ get_key_arg (key, nargs, args, used) | |||
| 3743 | vector that are not copied from VEC are set to INIT. */ | 3699 | vector that are not copied from VEC are set to INIT. */ |
| 3744 | 3700 | ||
| 3745 | Lisp_Object | 3701 | Lisp_Object |
| 3746 | larger_vector (vec, new_size, init) | 3702 | larger_vector (Lisp_Object vec, int new_size, Lisp_Object init) |
| 3747 | Lisp_Object vec; | ||
| 3748 | int new_size; | ||
| 3749 | Lisp_Object init; | ||
| 3750 | { | 3703 | { |
| 3751 | struct Lisp_Vector *v; | 3704 | struct Lisp_Vector *v; |
| 3752 | int i, old_size; | 3705 | int i, old_size; |
| @@ -3774,10 +3727,7 @@ larger_vector (vec, new_size, init) | |||
| 3774 | KEY2 are the same. */ | 3727 | KEY2 are the same. */ |
| 3775 | 3728 | ||
| 3776 | static int | 3729 | static int |
| 3777 | cmpfn_eql (h, key1, hash1, key2, hash2) | 3730 | cmpfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key1, unsigned int hash1, Lisp_Object key2, unsigned int hash2) |
| 3778 | struct Lisp_Hash_Table *h; | ||
| 3779 | Lisp_Object key1, key2; | ||
| 3780 | unsigned hash1, hash2; | ||
| 3781 | { | 3731 | { |
| 3782 | return (FLOATP (key1) | 3732 | return (FLOATP (key1) |
| 3783 | && FLOATP (key2) | 3733 | && FLOATP (key2) |
| @@ -3790,10 +3740,7 @@ cmpfn_eql (h, key1, hash1, key2, hash2) | |||
| 3790 | KEY2 are the same. */ | 3740 | KEY2 are the same. */ |
| 3791 | 3741 | ||
| 3792 | static int | 3742 | static int |
| 3793 | cmpfn_equal (h, key1, hash1, key2, hash2) | 3743 | cmpfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key1, unsigned int hash1, Lisp_Object key2, unsigned int hash2) |
| 3794 | struct Lisp_Hash_Table *h; | ||
| 3795 | Lisp_Object key1, key2; | ||
| 3796 | unsigned hash1, hash2; | ||
| 3797 | { | 3744 | { |
| 3798 | return hash1 == hash2 && !NILP (Fequal (key1, key2)); | 3745 | return hash1 == hash2 && !NILP (Fequal (key1, key2)); |
| 3799 | } | 3746 | } |
| @@ -3804,10 +3751,7 @@ cmpfn_equal (h, key1, hash1, key2, hash2) | |||
| 3804 | if KEY1 and KEY2 are the same. */ | 3751 | if KEY1 and KEY2 are the same. */ |
| 3805 | 3752 | ||
| 3806 | static int | 3753 | static int |
| 3807 | cmpfn_user_defined (h, key1, hash1, key2, hash2) | 3754 | cmpfn_user_defined (struct Lisp_Hash_Table *h, Lisp_Object key1, unsigned int hash1, Lisp_Object key2, unsigned int hash2) |
| 3808 | struct Lisp_Hash_Table *h; | ||
| 3809 | Lisp_Object key1, key2; | ||
| 3810 | unsigned hash1, hash2; | ||
| 3811 | { | 3755 | { |
| 3812 | if (hash1 == hash2) | 3756 | if (hash1 == hash2) |
| 3813 | { | 3757 | { |
| @@ -3828,9 +3772,7 @@ cmpfn_user_defined (h, key1, hash1, key2, hash2) | |||
| 3828 | in a Lisp integer. */ | 3772 | in a Lisp integer. */ |
| 3829 | 3773 | ||
| 3830 | static unsigned | 3774 | static unsigned |
| 3831 | hashfn_eq (h, key) | 3775 | hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key) |
| 3832 | struct Lisp_Hash_Table *h; | ||
| 3833 | Lisp_Object key; | ||
| 3834 | { | 3776 | { |
| 3835 | unsigned hash = XUINT (key) ^ XTYPE (key); | 3777 | unsigned hash = XUINT (key) ^ XTYPE (key); |
| 3836 | xassert ((hash & ~INTMASK) == 0); | 3778 | xassert ((hash & ~INTMASK) == 0); |
| @@ -3843,9 +3785,7 @@ hashfn_eq (h, key) | |||
| 3843 | in a Lisp integer. */ | 3785 | in a Lisp integer. */ |
| 3844 | 3786 | ||
| 3845 | static unsigned | 3787 | static unsigned |
| 3846 | hashfn_eql (h, key) | 3788 | hashfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key) |
| 3847 | struct Lisp_Hash_Table *h; | ||
| 3848 | Lisp_Object key; | ||
| 3849 | { | 3789 | { |
| 3850 | unsigned hash; | 3790 | unsigned hash; |
| 3851 | if (FLOATP (key)) | 3791 | if (FLOATP (key)) |
| @@ -3862,9 +3802,7 @@ hashfn_eql (h, key) | |||
| 3862 | in a Lisp integer. */ | 3802 | in a Lisp integer. */ |
| 3863 | 3803 | ||
| 3864 | static unsigned | 3804 | static unsigned |
| 3865 | hashfn_equal (h, key) | 3805 | hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key) |
| 3866 | struct Lisp_Hash_Table *h; | ||
| 3867 | Lisp_Object key; | ||
| 3868 | { | 3806 | { |
| 3869 | unsigned hash = sxhash (key, 0); | 3807 | unsigned hash = sxhash (key, 0); |
| 3870 | xassert ((hash & ~INTMASK) == 0); | 3808 | xassert ((hash & ~INTMASK) == 0); |
| @@ -3877,9 +3815,7 @@ hashfn_equal (h, key) | |||
| 3877 | guaranteed to fit in a Lisp integer. */ | 3815 | guaranteed to fit in a Lisp integer. */ |
| 3878 | 3816 | ||
| 3879 | static unsigned | 3817 | static unsigned |
| 3880 | hashfn_user_defined (h, key) | 3818 | hashfn_user_defined (struct Lisp_Hash_Table *h, Lisp_Object key) |
| 3881 | struct Lisp_Hash_Table *h; | ||
| 3882 | Lisp_Object key; | ||
| 3883 | { | 3819 | { |
| 3884 | Lisp_Object args[2], hash; | 3820 | Lisp_Object args[2], hash; |
| 3885 | 3821 | ||
| @@ -4003,8 +3939,7 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak, | |||
| 4003 | only the table itself is. */ | 3939 | only the table itself is. */ |
| 4004 | 3940 | ||
| 4005 | Lisp_Object | 3941 | Lisp_Object |
| 4006 | copy_hash_table (h1) | 3942 | copy_hash_table (struct Lisp_Hash_Table *h1) |
| 4007 | struct Lisp_Hash_Table *h1; | ||
| 4008 | { | 3943 | { |
| 4009 | Lisp_Object table; | 3944 | Lisp_Object table; |
| 4010 | struct Lisp_Hash_Table *h2; | 3945 | struct Lisp_Hash_Table *h2; |
| @@ -4035,8 +3970,7 @@ copy_hash_table (h1) | |||
| 4035 | because it's already too large, throw an error. */ | 3970 | because it's already too large, throw an error. */ |
| 4036 | 3971 | ||
| 4037 | static INLINE void | 3972 | static INLINE void |
| 4038 | maybe_resize_hash_table (h) | 3973 | maybe_resize_hash_table (struct Lisp_Hash_Table *h) |
| 4039 | struct Lisp_Hash_Table *h; | ||
| 4040 | { | 3974 | { |
| 4041 | if (NILP (h->next_free)) | 3975 | if (NILP (h->next_free)) |
| 4042 | { | 3976 | { |
| @@ -4101,10 +4035,7 @@ maybe_resize_hash_table (h) | |||
| 4101 | matching KEY, or -1 if not found. */ | 4035 | matching KEY, or -1 if not found. */ |
| 4102 | 4036 | ||
| 4103 | int | 4037 | int |
| 4104 | hash_lookup (h, key, hash) | 4038 | hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, unsigned int *hash) |
| 4105 | struct Lisp_Hash_Table *h; | ||
| 4106 | Lisp_Object key; | ||
| 4107 | unsigned *hash; | ||
| 4108 | { | 4039 | { |
| 4109 | unsigned hash_code; | 4040 | unsigned hash_code; |
| 4110 | int start_of_bucket; | 4041 | int start_of_bucket; |
| @@ -4138,10 +4069,7 @@ hash_lookup (h, key, hash) | |||
| 4138 | Value is the index of the entry in H matching KEY. */ | 4069 | Value is the index of the entry in H matching KEY. */ |
| 4139 | 4070 | ||
| 4140 | int | 4071 | int |
| 4141 | hash_put (h, key, value, hash) | 4072 | hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value, unsigned int hash) |
| 4142 | struct Lisp_Hash_Table *h; | ||
| 4143 | Lisp_Object key, value; | ||
| 4144 | unsigned hash; | ||
| 4145 | { | 4073 | { |
| 4146 | int start_of_bucket, i; | 4074 | int start_of_bucket, i; |
| 4147 | 4075 | ||
| @@ -4171,9 +4099,7 @@ hash_put (h, key, value, hash) | |||
| 4171 | /* Remove the entry matching KEY from hash table H, if there is one. */ | 4099 | /* Remove the entry matching KEY from hash table H, if there is one. */ |
| 4172 | 4100 | ||
| 4173 | static void | 4101 | static void |
| 4174 | hash_remove_from_table (h, key) | 4102 | hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key) |
| 4175 | struct Lisp_Hash_Table *h; | ||
| 4176 | Lisp_Object key; | ||
| 4177 | { | 4103 | { |
| 4178 | unsigned hash_code; | 4104 | unsigned hash_code; |
| 4179 | int start_of_bucket; | 4105 | int start_of_bucket; |
| @@ -4221,8 +4147,7 @@ hash_remove_from_table (h, key) | |||
| 4221 | /* Clear hash table H. */ | 4147 | /* Clear hash table H. */ |
| 4222 | 4148 | ||
| 4223 | void | 4149 | void |
| 4224 | hash_clear (h) | 4150 | hash_clear (struct Lisp_Hash_Table *h) |
| 4225 | struct Lisp_Hash_Table *h; | ||
| 4226 | { | 4151 | { |
| 4227 | if (h->count > 0) | 4152 | if (h->count > 0) |
| 4228 | { | 4153 | { |
| @@ -4251,7 +4176,7 @@ hash_clear (h) | |||
| 4251 | ************************************************************************/ | 4176 | ************************************************************************/ |
| 4252 | 4177 | ||
| 4253 | void | 4178 | void |
| 4254 | init_weak_hash_tables () | 4179 | init_weak_hash_tables (void) |
| 4255 | { | 4180 | { |
| 4256 | weak_hash_tables = NULL; | 4181 | weak_hash_tables = NULL; |
| 4257 | } | 4182 | } |
| @@ -4262,9 +4187,7 @@ init_weak_hash_tables () | |||
| 4262 | non-zero if anything was marked. */ | 4187 | non-zero if anything was marked. */ |
| 4263 | 4188 | ||
| 4264 | static int | 4189 | static int |
| 4265 | sweep_weak_table (h, remove_entries_p) | 4190 | sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p) |
| 4266 | struct Lisp_Hash_Table *h; | ||
| 4267 | int remove_entries_p; | ||
| 4268 | { | 4191 | { |
| 4269 | int bucket, n, marked; | 4192 | int bucket, n, marked; |
| 4270 | 4193 | ||
| @@ -4352,7 +4275,7 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4352 | from Vweak_hash_tables. Called from gc_sweep. */ | 4275 | from Vweak_hash_tables. Called from gc_sweep. */ |
| 4353 | 4276 | ||
| 4354 | void | 4277 | void |
| 4355 | sweep_weak_hash_tables () | 4278 | sweep_weak_hash_tables (void) |
| 4356 | { | 4279 | { |
| 4357 | struct Lisp_Hash_Table *h, *used, *next; | 4280 | struct Lisp_Hash_Table *h, *used, *next; |
| 4358 | int marked; | 4281 | int marked; |
| @@ -4420,9 +4343,7 @@ sweep_weak_hash_tables () | |||
| 4420 | code returned is guaranteed to fit in a Lisp integer. */ | 4343 | code returned is guaranteed to fit in a Lisp integer. */ |
| 4421 | 4344 | ||
| 4422 | static unsigned | 4345 | static unsigned |
| 4423 | sxhash_string (ptr, len) | 4346 | sxhash_string (unsigned char *ptr, int len) |
| 4424 | unsigned char *ptr; | ||
| 4425 | int len; | ||
| 4426 | { | 4347 | { |
| 4427 | unsigned char *p = ptr; | 4348 | unsigned char *p = ptr; |
| 4428 | unsigned char *end = p + len; | 4349 | unsigned char *end = p + len; |
| @@ -4445,9 +4366,7 @@ sxhash_string (ptr, len) | |||
| 4445 | list. We don't recurse deeper than SXHASH_MAX_DEPTH in it. */ | 4366 | list. We don't recurse deeper than SXHASH_MAX_DEPTH in it. */ |
| 4446 | 4367 | ||
| 4447 | static unsigned | 4368 | static unsigned |
| 4448 | sxhash_list (list, depth) | 4369 | sxhash_list (Lisp_Object list, int depth) |
| 4449 | Lisp_Object list; | ||
| 4450 | int depth; | ||
| 4451 | { | 4370 | { |
| 4452 | unsigned hash = 0; | 4371 | unsigned hash = 0; |
| 4453 | int i; | 4372 | int i; |
| @@ -4475,9 +4394,7 @@ sxhash_list (list, depth) | |||
| 4475 | the Lisp structure. */ | 4394 | the Lisp structure. */ |
| 4476 | 4395 | ||
| 4477 | static unsigned | 4396 | static unsigned |
| 4478 | sxhash_vector (vec, depth) | 4397 | sxhash_vector (Lisp_Object vec, int depth) |
| 4479 | Lisp_Object vec; | ||
| 4480 | int depth; | ||
| 4481 | { | 4398 | { |
| 4482 | unsigned hash = ASIZE (vec); | 4399 | unsigned hash = ASIZE (vec); |
| 4483 | int i, n; | 4400 | int i, n; |
| @@ -4496,8 +4413,7 @@ sxhash_vector (vec, depth) | |||
| 4496 | /* Return a hash for bool-vector VECTOR. */ | 4413 | /* Return a hash for bool-vector VECTOR. */ |
| 4497 | 4414 | ||
| 4498 | static unsigned | 4415 | static unsigned |
| 4499 | sxhash_bool_vector (vec) | 4416 | sxhash_bool_vector (Lisp_Object vec) |
| 4500 | Lisp_Object vec; | ||
| 4501 | { | 4417 | { |
| 4502 | unsigned hash = XBOOL_VECTOR (vec)->size; | 4418 | unsigned hash = XBOOL_VECTOR (vec)->size; |
| 4503 | int i, n; | 4419 | int i, n; |
| @@ -4514,9 +4430,7 @@ sxhash_bool_vector (vec) | |||
| 4514 | structure. Value is an unsigned integer clipped to INTMASK. */ | 4430 | structure. Value is an unsigned integer clipped to INTMASK. */ |
| 4515 | 4431 | ||
| 4516 | unsigned | 4432 | unsigned |
| 4517 | sxhash (obj, depth) | 4433 | sxhash (Lisp_Object obj, int depth) |
| 4518 | Lisp_Object obj; | ||
| 4519 | int depth; | ||
| 4520 | { | 4434 | { |
| 4521 | unsigned hash; | 4435 | unsigned hash; |
| 4522 | 4436 | ||
| @@ -5110,7 +5024,7 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5110 | 5024 | ||
| 5111 | 5025 | ||
| 5112 | void | 5026 | void |
| 5113 | syms_of_fns () | 5027 | syms_of_fns (void) |
| 5114 | { | 5028 | { |
| 5115 | /* Hash table stuff. */ | 5029 | /* Hash table stuff. */ |
| 5116 | Qhash_table_p = intern_c_string ("hash-table-p"); | 5030 | Qhash_table_p = intern_c_string ("hash-table-p"); |
| @@ -5286,7 +5200,7 @@ this variable. */); | |||
| 5286 | 5200 | ||
| 5287 | 5201 | ||
| 5288 | void | 5202 | void |
| 5289 | init_fns () | 5203 | init_fns (void) |
| 5290 | { | 5204 | { |
| 5291 | } | 5205 | } |
| 5292 | 5206 | ||