diff options
| author | Miles Bader | 2007-07-15 02:05:20 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-07-15 02:05:20 +0000 |
| commit | 7eb1e4534e88a32fe5e549e630fdabf3e062be2b (patch) | |
| tree | 34fc72789f1cfbfeb067cf507f8871c322df300a /src/fns.c | |
| parent | 76d11d2cf9623e9f4c38e8239c4444ffc1fae485 (diff) | |
| parent | 6f8a87c027ebd6f9cfdac5c0df97d651227bec62 (diff) | |
| download | emacs-7eb1e4534e88a32fe5e549e630fdabf3e062be2b.tar.gz emacs-7eb1e4534e88a32fe5e549e630fdabf3e062be2b.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 803-813)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 51-58)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 233-236)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-25
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 47 |
1 files changed, 22 insertions, 25 deletions
| @@ -2825,8 +2825,8 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table, | |||
| 2825 | void | 2825 | void |
| 2826 | map_char_table (c_function, function, table, subtable, arg, depth, indices) | 2826 | map_char_table (c_function, function, table, subtable, arg, depth, indices) |
| 2827 | void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); | 2827 | void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); |
| 2828 | Lisp_Object function, table, subtable, arg, *indices; | 2828 | Lisp_Object function, table, subtable, arg; |
| 2829 | int depth; | 2829 | int depth, *indices; |
| 2830 | { | 2830 | { |
| 2831 | int i, to; | 2831 | int i, to; |
| 2832 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2832 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -2860,7 +2860,7 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices) | |||
| 2860 | } | 2860 | } |
| 2861 | else | 2861 | else |
| 2862 | { | 2862 | { |
| 2863 | int charset = XFASTINT (indices[0]) - 128; | 2863 | int charset = indices[0] - 128; |
| 2864 | 2864 | ||
| 2865 | i = 32; | 2865 | i = 32; |
| 2866 | to = SUB_CHAR_TABLE_ORDINARY_SLOTS; | 2866 | to = SUB_CHAR_TABLE_ORDINARY_SLOTS; |
| @@ -2874,8 +2874,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices) | |||
| 2874 | int charset; | 2874 | int charset; |
| 2875 | 2875 | ||
| 2876 | elt = XCHAR_TABLE (subtable)->contents[i]; | 2876 | elt = XCHAR_TABLE (subtable)->contents[i]; |
| 2877 | XSETFASTINT (indices[depth], i); | 2877 | indices[depth] = i; |
| 2878 | charset = XFASTINT (indices[0]) - 128; | 2878 | charset = indices[0] - 128; |
| 2879 | if (depth == 0 | 2879 | if (depth == 0 |
| 2880 | && (!CHARSET_DEFINED_P (charset) | 2880 | && (!CHARSET_DEFINED_P (charset) |
| 2881 | || charset == CHARSET_8_BIT_CONTROL | 2881 | || charset == CHARSET_8_BIT_CONTROL |
| @@ -2892,8 +2892,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices) | |||
| 2892 | { | 2892 | { |
| 2893 | int c1, c2, c; | 2893 | int c1, c2, c; |
| 2894 | 2894 | ||
| 2895 | c1 = depth >= 1 ? XFASTINT (indices[1]) : 0; | 2895 | c1 = depth >= 1 ? indices[1] : 0; |
| 2896 | c2 = depth >= 2 ? XFASTINT (indices[2]) : 0; | 2896 | c2 = depth >= 2 ? indices[2] : 0; |
| 2897 | c = MAKE_CHAR (charset, c1, c2); | 2897 | c = MAKE_CHAR (charset, c1, c2); |
| 2898 | 2898 | ||
| 2899 | if (NILP (elt)) | 2899 | if (NILP (elt)) |
| @@ -2927,14 +2927,14 @@ The key is always a possible IDX argument to `aref'. */) | |||
| 2927 | Lisp_Object function, char_table; | 2927 | Lisp_Object function, char_table; |
| 2928 | { | 2928 | { |
| 2929 | /* The depth of char table is at most 3. */ | 2929 | /* The depth of char table is at most 3. */ |
| 2930 | Lisp_Object indices[3]; | 2930 | int indices[3]; |
| 2931 | 2931 | ||
| 2932 | CHECK_CHAR_TABLE (char_table); | 2932 | CHECK_CHAR_TABLE (char_table); |
| 2933 | 2933 | ||
| 2934 | /* When Lisp_Object is represented as a union, `call2' cannot directly | 2934 | /* When Lisp_Object is represented as a union, `call2' cannot directly |
| 2935 | be passed to map_char_table because it returns a Lisp_Object rather | 2935 | be passed to map_char_table because it returns a Lisp_Object rather |
| 2936 | than returning nothing. | 2936 | than returning nothing. |
| 2937 | Casting leads to crashes on some architectures. -stef */ | 2937 | Casting leads to crashes on some architectures. --Stef */ |
| 2938 | map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices); | 2938 | map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices); |
| 2939 | return Qnil; | 2939 | return Qnil; |
| 2940 | } | 2940 | } |
| @@ -4271,7 +4271,7 @@ base64_decode_1 (from, to, length, multibyte, nchars_return) | |||
| 4271 | 4271 | ||
| 4272 | /* The list of all weak hash tables. Don't staticpro this one. */ | 4272 | /* The list of all weak hash tables. Don't staticpro this one. */ |
| 4273 | 4273 | ||
| 4274 | Lisp_Object Vweak_hash_tables; | 4274 | struct Lisp_Hash_Table *weak_hash_tables; |
| 4275 | 4275 | ||
| 4276 | /* Various symbols. */ | 4276 | /* Various symbols. */ |
| 4277 | 4277 | ||
| @@ -4617,11 +4617,11 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak, | |||
| 4617 | 4617 | ||
| 4618 | /* Maybe add this hash table to the list of all weak hash tables. */ | 4618 | /* Maybe add this hash table to the list of all weak hash tables. */ |
| 4619 | if (NILP (h->weak)) | 4619 | if (NILP (h->weak)) |
| 4620 | h->next_weak = Qnil; | 4620 | h->next_weak = NULL; |
| 4621 | else | 4621 | else |
| 4622 | { | 4622 | { |
| 4623 | h->next_weak = Vweak_hash_tables; | 4623 | h->next_weak = weak_hash_tables; |
| 4624 | Vweak_hash_tables = table; | 4624 | weak_hash_tables = h; |
| 4625 | } | 4625 | } |
| 4626 | 4626 | ||
| 4627 | return table; | 4627 | return table; |
| @@ -4652,8 +4652,8 @@ copy_hash_table (h1) | |||
| 4652 | /* Maybe add this hash table to the list of all weak hash tables. */ | 4652 | /* Maybe add this hash table to the list of all weak hash tables. */ |
| 4653 | if (!NILP (h2->weak)) | 4653 | if (!NILP (h2->weak)) |
| 4654 | { | 4654 | { |
| 4655 | h2->next_weak = Vweak_hash_tables; | 4655 | h2->next_weak = weak_hash_tables; |
| 4656 | Vweak_hash_tables = table; | 4656 | weak_hash_tables = h2; |
| 4657 | } | 4657 | } |
| 4658 | 4658 | ||
| 4659 | return table; | 4659 | return table; |
| @@ -4972,13 +4972,12 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4972 | 4972 | ||
| 4973 | /* Remove elements from weak hash tables that don't survive the | 4973 | /* Remove elements from weak hash tables that don't survive the |
| 4974 | current garbage collection. Remove weak tables that don't survive | 4974 | current garbage collection. Remove weak tables that don't survive |
| 4975 | from Vweak_hash_tables. Called from gc_sweep. */ | 4975 | from weak_hash_tables. Called from gc_sweep. */ |
| 4976 | 4976 | ||
| 4977 | void | 4977 | void |
| 4978 | sweep_weak_hash_tables () | 4978 | sweep_weak_hash_tables () |
| 4979 | { | 4979 | { |
| 4980 | Lisp_Object table, used, next; | 4980 | struct Lisp_Hash_Table *h, *used, *next; |
| 4981 | struct Lisp_Hash_Table *h; | ||
| 4982 | int marked; | 4981 | int marked; |
| 4983 | 4982 | ||
| 4984 | /* Mark all keys and values that are in use. Keep on marking until | 4983 | /* Mark all keys and values that are in use. Keep on marking until |
| @@ -4990,9 +4989,8 @@ sweep_weak_hash_tables () | |||
| 4990 | do | 4989 | do |
| 4991 | { | 4990 | { |
| 4992 | marked = 0; | 4991 | marked = 0; |
| 4993 | for (table = Vweak_hash_tables; !GC_NILP (table); table = h->next_weak) | 4992 | for (h = weak_hash_tables; h; h = h->next_weak) |
| 4994 | { | 4993 | { |
| 4995 | h = XHASH_TABLE (table); | ||
| 4996 | if (h->size & ARRAY_MARK_FLAG) | 4994 | if (h->size & ARRAY_MARK_FLAG) |
| 4997 | marked |= sweep_weak_table (h, 0); | 4995 | marked |= sweep_weak_table (h, 0); |
| 4998 | } | 4996 | } |
| @@ -5000,9 +4998,8 @@ sweep_weak_hash_tables () | |||
| 5000 | while (marked); | 4998 | while (marked); |
| 5001 | 4999 | ||
| 5002 | /* Remove tables and entries that aren't used. */ | 5000 | /* Remove tables and entries that aren't used. */ |
| 5003 | for (table = Vweak_hash_tables, used = Qnil; !GC_NILP (table); table = next) | 5001 | for (h = weak_hash_tables, used = NULL; h; h = next) |
| 5004 | { | 5002 | { |
| 5005 | h = XHASH_TABLE (table); | ||
| 5006 | next = h->next_weak; | 5003 | next = h->next_weak; |
| 5007 | 5004 | ||
| 5008 | if (h->size & ARRAY_MARK_FLAG) | 5005 | if (h->size & ARRAY_MARK_FLAG) |
| @@ -5013,11 +5010,11 @@ sweep_weak_hash_tables () | |||
| 5013 | 5010 | ||
| 5014 | /* Add table to the list of used weak hash tables. */ | 5011 | /* Add table to the list of used weak hash tables. */ |
| 5015 | h->next_weak = used; | 5012 | h->next_weak = used; |
| 5016 | used = table; | 5013 | used = h; |
| 5017 | } | 5014 | } |
| 5018 | } | 5015 | } |
| 5019 | 5016 | ||
| 5020 | Vweak_hash_tables = used; | 5017 | weak_hash_tables = used; |
| 5021 | } | 5018 | } |
| 5022 | 5019 | ||
| 5023 | 5020 | ||
| @@ -5918,7 +5915,7 @@ used if both `use-dialog-box' and this variable are non-nil. */); | |||
| 5918 | void | 5915 | void |
| 5919 | init_fns () | 5916 | init_fns () |
| 5920 | { | 5917 | { |
| 5921 | Vweak_hash_tables = Qnil; | 5918 | weak_hash_tables = NULL; |
| 5922 | } | 5919 | } |
| 5923 | 5920 | ||
| 5924 | /* arch-tag: 787f8219-5b74-46bd-8469-7e1cc475fa31 | 5921 | /* arch-tag: 787f8219-5b74-46bd-8469-7e1cc475fa31 |