aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
authorStefan Monnier2003-02-22 22:22:27 +0000
committerStefan Monnier2003-02-22 22:22:27 +0000
commite52bd6b740c55eca2b59ce7e9d9b84d4994aeee9 (patch)
tree223e601c6b865501ec0ccdca5d22e036b5fe77e5 /src/fns.c
parent2b47daccff702690b67ce5c8a33fe908079dda75 (diff)
downloademacs-e52bd6b740c55eca2b59ce7e9d9b84d4994aeee9.tar.gz
emacs-e52bd6b740c55eca2b59ce7e9d9b84d4994aeee9.zip
(string_to_multibyte): Remove unused var i.
(Flanginfo): Fix int/Lisp_Object mixup. (void_call2): New fun. (Fmap_char_table): Use it in place of call2.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/fns.c b/src/fns.c
index 729872722bd..fe3e0f82a3f 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1047,7 +1047,6 @@ string_to_multibyte (string)
1047{ 1047{
1048 unsigned char *buf; 1048 unsigned char *buf;
1049 int nbytes; 1049 int nbytes;
1050 int i;
1051 1050
1052 if (STRING_MULTIBYTE (string)) 1051 if (STRING_MULTIBYTE (string))
1053 return string; 1052 return string;
@@ -2699,6 +2698,14 @@ map_char_table (c_function, function, subtable, arg, depth, indices)
2699 } 2698 }
2700} 2699}
2701 2700
2701static void void_call2 P_ ((Lisp_Object a, Lisp_Object b, Lisp_Object c));
2702static void
2703void_call2 (a, b, c)
2704 Lisp_Object a, b, c;
2705{
2706 call2 (a, b, c);
2707}
2708
2702DEFUN ("map-char-table", Fmap_char_table, Smap_char_table, 2709DEFUN ("map-char-table", Fmap_char_table, Smap_char_table,
2703 2, 2, 0, 2710 2, 2, 0,
2704 doc: /* Call FUNCTION for each (normal and generic) characters in CHAR-TABLE. 2711 doc: /* Call FUNCTION for each (normal and generic) characters in CHAR-TABLE.
@@ -2712,7 +2719,11 @@ The key is always a possible IDX argument to `aref'. */)
2712 2719
2713 CHECK_CHAR_TABLE (char_table); 2720 CHECK_CHAR_TABLE (char_table);
2714 2721
2715 map_char_table ((POINTER_TYPE *) call2, Qnil, char_table, function, 0, indices); 2722 /* When Lisp_Object is represented as a union, `call2' cannot directly
2723 be passed to map_char_table because it returns a Lisp_Object rather
2724 than returning nothing.
2725 Casting leads to crashes on some architectures. -stef */
2726 map_char_table (void_call2, Qnil, char_table, function, 0, indices);
2716 return Qnil; 2727 return Qnil;
2717} 2728}
2718 2729
@@ -3490,7 +3501,7 @@ The data read from the system are decoded using `locale-coding-system'. */)
3490 it is consistent with CODESET? If not, what to do? */ 3501 it is consistent with CODESET? If not, what to do? */
3491 Faset (v, make_number (i), 3502 Faset (v, make_number (i),
3492 code_convert_string_norecord (val, Vlocale_coding_system, 3503 code_convert_string_norecord (val, Vlocale_coding_system,
3493 Qnil)); 3504 0));
3494 } 3505 }
3495 return v; 3506 return v;
3496 } 3507 }
@@ -3508,7 +3519,7 @@ The data read from the system are decoded using `locale-coding-system'. */)
3508 str = nl_langinfo (months[i]); 3519 str = nl_langinfo (months[i]);
3509 val = make_unibyte_string (str, strlen (str)); 3520 val = make_unibyte_string (str, strlen (str));
3510 p->contents[i] = 3521 p->contents[i] =
3511 code_convert_string_norecord (val, Vlocale_coding_system, Qnil); 3522 code_convert_string_norecord (val, Vlocale_coding_system, 0);
3512 } 3523 }
3513 XSETVECTOR (val, p); 3524 XSETVECTOR (val, p);
3514 return val; 3525 return val;