Commit 83316bf4 authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge: Minor changes for problems found by GCC 4.5.2's static checks.

parents 135e287c 53df7c11
2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
Minor changes for problems found by GCC 4.5.2's static checks.
* fringe.c (update_window_fringes): Mark locals as initialized
(Bug#8227).
(destroy_fringe_bitmap, init_fringe_bitmap): Now static.
* alloc.c (mark_fringe_data): Move decl from here ...
* lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
to check its interface.
(init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
* fontset.c (free_realized_fontset): Now static.
(Fset_fontset_font): Rename local to avoid shadowing.
(fontset_font): Mark local as initialized.
(FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
* xrdb.c: Include "xterm.h", to check x_load_resources's interface.
* xselect.c (x_disown_buffer_selections): Remove; not used.
(TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
(x_own_selection, Fx_disown_selection_internal): Rename locals
to avoid shadowing.
(x_handle_dnd_message): Remove local to avoid shadowing.
* lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
so that the caller can use some name other than gcpro1.
(GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
* xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
(Fx_backspace_delete_keys_p):
Use them to avoid shadowing, and rename vars to avoid shadowing.
(x_decode_color, x_set_name, x_window): Now static.
(Fx_create_frame): Add braces to silence GCC warning.
(Fx_file_dialog, Fx_select_font): Fix pointer signedness.
(x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
Remove unused locals.
(Fx_create_frame, x_create_tip_frame, Fx_show_tip):
(Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
macros.
* xterm.h (x_mouse_leave): New decl.
* xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
Remove unused functions.
(x_shift_glyphs_for_insert, XTflash, XTring_bell):
(x_calc_absolute_position): Now static.
(XTread_socket): Don't define label "out" unless it's used.
Don't declare local "event" unless it's used.
(x_iconify_frame, x_free_frame_resources): Don't declare locals
unless they are used.
(XEMBED_VERSION, xembed_set_info): Don't define unless needed.
(x_fatal_error_signal): Remove; not used.
(x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
(x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
(x_error_catcher, x_connection_closed, x_error_handler):
(x_error_quitter, xembed_send_message, x_iconify_frame):
(my_log_handler): Rename locals to avoid shadowing.
(x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
(x_connection_closed): Tell GCC not to suggest NO_RETURN.
* xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font): Rename
or move locals to avoid shadowing.
(tty_defined_color, merge_face_heights): Now static.
(free_realized_faces_for_fontset): Remove; not used.
(Fx_list_fonts): Mark variable that gcc -Wuninitialized
does not deduce is never used uninitialized.
(STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
(LFACEP): Define only if XASSERTS, as it's not needed otherwise.
* terminal.c (store_terminal_param): Now static.
* xmenu.c (menu_highlight_callback): Now static.
(set_frame_menubar): Remove unused local.
(xmenu_show): Rename parameter to avoid shadowing.
(xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
since they might point to immutable storage.
(next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
since it's unused otherwise.
* xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
Add a FIXME, since the code still doesn't look right. (Bug#8215)
(Fcurrent_bidi_paragraph_direction): Simplify slightly; this
avoids a gcc -Wuninitialized diagnostic.
(display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
(note_mouse_highlight): Mark variables that gcc -Wuninitialized
does not deduce are never used uninitialized.
* lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
* xdisp.c (redisplay_window): Rename local to avoid shadowing.
* window.c (window_loop, size_window):
(run_window_configuration_change_hook, enlarge_window): Likewise.
* window.c (display_buffer): Now static.
(size_window): Mark variables that gcc -Wuninitialized
does not deduce are never used uninitialized.
* window.h (check_all_windows): New decl, to forestall
gcc -Wmissing-prototypes diagnostic.
* dispextern.h (bidi_dump_cached_states): Likewise.
* charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
shadowing.
* charset.c (map_charset_for_dump, Fchar_charset): Likewise.
Include <limits.h>.
(Fsort_charsets): Redo min/max calculation to shorten the code a bit
and to avoid gcc -Wuninitialized warning.
(load_charset_map): Mark variables that gcc -Wuninitialized
does not deduce are never used uninitialized.
(load_charset): Abort instead of using uninitialized var (Bug#8229).
* coding.c (coding_set_source, coding_set_destination):
Use "else { /* comment */ }" rather than "else /* comment */;"
for clarity, and to avoid gcc -Wempty-body warning.
(Fdefine_coding_system_internal): Don't redeclare 'i' inside
a block, when the outer 'i' will do.
(decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
(emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
(decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
(decode_coding_raw_text, decode_coding_charset, get_translation_table):
(Fdecode_sjis_char, Fdefine_coding_system_internal):
Rename locals to avoid shadowing.
* character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
* coding.c (emacs_mule_char, encode_invocation_designation):
Now static, since they're not used elsewhere.
(decode_coding_iso_2022): Add "default: abort ();" as a safety check.
(decode_coding_object, encode_coding_object, detect_coding_system):
(decode_coding_emacs_mule): Mark variables that gcc
-Wuninitialized does not deduce are never used uninitialized.
(detect_coding_iso_2022): Initialize a local variable that might
be used uninitialized. Leave a FIXME because it's not clear that
this initialization is needed. (Bug#8211)
(ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
(ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
(SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
(ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
Remove unused macros.
* category.c (hash_get_category_set): Remove unused local var.
(copy_category_table): Now static, since it's not used elsewhere.
* character.c (string_count_byte8): Likewise.
* ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
(Fregister_code_conversion_map): Rename locals to avoid shadowing.
* chartab.c (copy_sub_char_table): Now static, since it's not used
elsewhere.
(sub_char_table_ref_and_range, char_table_ref_and_range):
Rename locals to avoid shadowing.
(ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
* bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
(BIDI_BOB): Remove unused macro.
* cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
deduce are never used uninitialized.
* term.c (encode_terminal_code): Likewise.
* term.c (encode_terminal_code): Now static. Remove unused local.
* tparam.h: New file.
* term.c, tparam.h: Include it.
* deps.mk (term.o, tparam.o): Depend on tparam.h.
* term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
Move these decls to tparam.h, and make them agree with what
is actually in tparam.c. The previous trick of using incompatible
decls in different modules does not conform to the C standard.
All callers of tparam changed to use tparam's actual API.
* tparam.c (tparam1, tparam, tgoto):
Use const pointers where appropriate.
* cm.c (calccost, cmgoto): Use const pointers where appropriate.
* cm.h (struct cm): Likewise.
* dispextern.h (do_line_insertion_deletion_costs): Likewise.
* scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
* term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
(term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
(turn_on_face, init_tty): Likewise.
* termchar.h (struct tty_display_info): Likewise.
* term.c (term_mouse_position): Rename local to avoid shadowing.
* alloc.c (mark_ttys): Move decl from here ...
* lisp.h (mark_ttys): ... to here, so that it's checked against defn.
2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
 
* .gdbinit (pwinx, xbuffer): Fix access to buffer name.
......@@ -271,16 +271,11 @@ Lisp_Object Qpost_gc_hook;
static void mark_buffer (Lisp_Object);
static void mark_terminals (void);
extern void mark_kboards (void);
extern void mark_ttys (void);
extern void mark_backtrace (void);
static void gc_sweep (void);
static void mark_glyph_matrix (struct glyph_matrix *);
static void mark_face_cache (struct face_cache *);
#ifdef HAVE_WINDOW_SYSTEM
extern void mark_fringe_data (void);
#endif /* HAVE_WINDOW_SYSTEM */
static struct Lisp_String *allocate_string (void);
static void compact_small_strings (void);
static void free_large_strings (void);
......
......@@ -72,7 +72,6 @@ static Lisp_Object bidi_type_table, bidi_mirror_table;
#define RLO_CHAR 0x202E
#define BIDI_EOB -1
#define BIDI_BOB -2 /* FIXME: Is this needed? */
/* Local data structures. (Look in dispextern.h for the rest.) */
......@@ -180,7 +179,7 @@ bidi_get_type (int ch, bidi_dir_t override)
}
}
void
static void
bidi_check_type (bidi_type_t type)
{
if (type < UNKNOWN_BT || type > NEUTRAL_ON)
......
......@@ -61,7 +61,6 @@ static Lisp_Object hash_get_category_set (Lisp_Object, Lisp_Object);
static Lisp_Object
hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
{
Lisp_Object val;
struct Lisp_Hash_Table *h;
int i;
unsigned hash;
......@@ -228,7 +227,7 @@ copy_category_entry (Lisp_Object table, Lisp_Object c, Lisp_Object val)
the original and the copy. This function is called recursively by
binding TABLE to a sub char table. */
Lisp_Object
static Lisp_Object
copy_category_table (Lisp_Object table)
{
table = copy_char_table (table);
......@@ -538,4 +537,3 @@ See the documentation of the variable `word-combining-categories'. */);
category_table_version = 0;
}
......@@ -758,18 +758,18 @@ while(0)
buffer. */
#define CCL_WRITE_STRING(len) \
do { \
int i; \
int ccli; \
if (!dst) \
CCL_INVALID_CMD; \
else if (dst + len <= dst_end) \
{ \
if (XFASTINT (ccl_prog[ic]) & 0x1000000) \
for (i = 0; i < len; i++) \
*dst++ = XFASTINT (ccl_prog[ic + i]) & 0xFFFFFF; \
for (ccli = 0; ccli < len; ccli++) \
*dst++ = XFASTINT (ccl_prog[ic + ccli]) & 0xFFFFFF; \
else \
for (i = 0; i < len; i++) \
*dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \
>> ((2 - (i % 3)) * 8)) & 0xFF; \
for (ccli = 0; ccli < len; ccli++) \
*dst++ = ((XFASTINT (ccl_prog[ic + (ccli / 3)])) \
>> ((2 - (ccli % 3)) * 8)) & 0xFF; \
} \
else \
CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
......@@ -806,15 +806,15 @@ while(0)
#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \
do { \
unsigned code; \
unsigned ncode; \
\
charset = char_charset ((c), (charset_list), &code); \
charset = char_charset ((c), (charset_list), &ncode); \
if (! charset && ! NILP (charset_list)) \
charset = char_charset ((c), Qnil, &code); \
charset = char_charset ((c), Qnil, &ncode); \
if (charset) \
{ \
(id) = CHARSET_ID (charset); \
(encoded) = code; \
(encoded) = ncode; \
} \
} while (0)
......@@ -2092,22 +2092,22 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
{
const unsigned char *p = SDATA (str) + consumed_bytes;
const unsigned char *endp = SDATA (str) + str_bytes;
int i = 0;
int j = 0;
int *src, src_size;
if (endp - p == str_chars - consumed_chars)
while (i < CCL_EXECUTE_BUF_SIZE && p < endp)
source[i++] = *p++;
while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
source[j++] = *p++;
else
while (i < CCL_EXECUTE_BUF_SIZE && p < endp)
source[i++] = STRING_CHAR_ADVANCE (p);
consumed_chars += i;
while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
source[j++] = STRING_CHAR_ADVANCE (p);
consumed_chars += j;
consumed_bytes = p - SDATA (str);
if (consumed_bytes == str_bytes)
ccl.last_block = NILP (contin);
src = source;
src_size = i;
src_size = j;
while (1)
{
ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE,
......@@ -2123,8 +2123,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
outp = outbuf + offset;
}
for (i = 0; i < ccl.produced; i++)
CHAR_STRING_ADVANCE (destination[i], outp);
for (j = 0; j < ccl.produced; j++)
CHAR_STRING_ADVANCE (destination[j], outp);
}
else
{
......@@ -2135,8 +2135,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
outp = outbuf + offset;
}
for (i = 0; i < ccl.produced; i++)
*outp++ = destination[i];
for (j = 0; j < ccl.produced; j++)
*outp++ = destination[j];
}
src += ccl.consumed;
src_size -= ccl.consumed;
......@@ -2253,7 +2253,7 @@ Return index number of the registered map. */)
{
int len = ASIZE (Vcode_conversion_map_vector);
int i;
Lisp_Object index;
Lisp_Object idx;
CHECK_SYMBOL (symbol);
CHECK_VECTOR (map);
......@@ -2267,11 +2267,11 @@ Return index number of the registered map. */)
if (EQ (symbol, XCAR (slot)))
{
index = make_number (i);
idx = make_number (i);
XSETCDR (slot, map);
Fput (symbol, Qcode_conversion_map, map);
Fput (symbol, Qcode_conversion_map_id, index);
return index;
Fput (symbol, Qcode_conversion_map_id, idx);
return idx;
}
}
......@@ -2279,11 +2279,11 @@ Return index number of the registered map. */)
Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
len * 2, Qnil);
index = make_number (i);
idx = make_number (i);
Fput (symbol, Qcode_conversion_map, map);
Fput (symbol, Qcode_conversion_map_id, index);
Fput (symbol, Qcode_conversion_map_id, idx);
ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map));
return index;
return idx;
}
......@@ -2341,4 +2341,3 @@ used by CCL. */);
defsubr (&Sregister_ccl_program);
defsubr (&Sregister_code_conversion_map);
}
......@@ -786,7 +786,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, EMACS_INT chars, i
}
EMACS_INT
static EMACS_INT
string_count_byte8 (Lisp_Object string)
{
int multibyte = STRING_MULTIBYTE (string);
......
......@@ -356,11 +356,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
{ \
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
int len; \
unsigned char *string_ptr = &SDATA (STRING)[BYTEIDX]; \
int string_len; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
OUTPUT = STRING_CHAR_AND_LENGTH (string_ptr, string_len); \
BYTEIDX += string_len; \
} \
else \
{ \
......
......@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
#include <limits.h>
#include <sys/types.h>
#include <setjmp.h>
#include "lisp.h"
......@@ -250,7 +251,7 @@ struct charset_map_entries
static void
load_charset_map (struct charset *charset, struct charset_map_entries *entries, int n_entries, int control_flag)
{
Lisp_Object vec, table;
Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil);
unsigned max_code = CHARSET_MAX_CODE (charset);
int ascii_compatible_p = charset->ascii_compatible_p;
int min_char, max_char, nonascii_min_char;
......@@ -629,8 +630,12 @@ load_charset (struct charset *charset, int control_flag)
if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
map = CHARSET_MAP (charset);
else if (CHARSET_UNIFIED_P (charset))
else
{
if (! CHARSET_UNIFIED_P (charset))
abort ();
map = CHARSET_UNIFY_MAP (charset);
}
if (STRINGP (map))
load_charset_map_from_file (charset, map, control_flag);
else
......@@ -668,9 +673,9 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object
while (1)
{
int index = GET_TEMP_CHARSET_WORK_ENCODER (c);
int idx = GET_TEMP_CHARSET_WORK_ENCODER (c);
if (index >= from_idx && index <= to_idx)
if (idx >= from_idx && idx <= to_idx)
{
if (NILP (XCAR (range)))
XSETCAR (range, make_number (c));
......@@ -2066,10 +2071,10 @@ that case, find the charset from what supported by that coding system. */)
for (; CONSP (restriction); restriction = XCDR (restriction))
{
struct charset *charset;
struct charset *rcharset;
CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset);
if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset))
CHECK_CHARSET_GET_CHARSET (XCAR (restriction), rcharset);
if (ENCODE_CHAR (rcharset, c) != CHARSET_INVALID_CODE (rcharset))
return XCAR (restriction);
}
return Qnil;
......@@ -2250,7 +2255,7 @@ See also `charset-priority-list' and `set-charset-priority'. */)
int n = XFASTINT (len), i, j, done;
Lisp_Object tail, elt, attrs;
struct charset_sort_data *sort_data;
int id, min_id, max_id;
int id, min_id = INT_MAX, max_id = INT_MIN;
USE_SAFE_ALLOCA;
if (n == 0)
......@@ -2262,11 +2267,9 @@ See also `charset-priority-list' and `set-charset-priority'. */)
CHECK_CHARSET_GET_ATTR (elt, attrs);
sort_data[i].charset = elt;
sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs));
if (i == 0)
min_id = max_id = id;
else if (id < min_id)
if (id < min_id)
min_id = id;
else if (id > max_id)
if (id > max_id)
max_id = id;
}
for (done = 0, tail = Vcharset_ordered_list, i = 0;
......
......@@ -358,9 +358,9 @@ extern int emacs_mule_charset[256];
#define CHECK_CHARSET_GET_CHARSET(x, charset) \
do { \
int id; \
CHECK_CHARSET_GET_ID (x, id); \
charset = CHARSET_FROM_ID (id); \
int csid; \
CHECK_CHARSET_GET_ID (x, csid); \
charset = CHARSET_FROM_ID (csid); \
} while (0)
......@@ -541,4 +541,3 @@ extern void map_charset_chars (void (*) (Lisp_Object, Lisp_Object),
struct charset *, unsigned, unsigned);
#endif /* EMACS_CHARSET_H */
......@@ -118,7 +118,7 @@ char_table_ascii (Lisp_Object table)
return XSUB_CHAR_TABLE (sub)->contents[0];
}
Lisp_Object
static Lisp_Object
copy_sub_char_table (Lisp_Object table)
{
Lisp_Object copy;
......@@ -216,16 +216,16 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
int depth = XINT (tbl->depth);
int min_char = XINT (tbl->min_char);
int max_char = min_char + chartab_chars[depth - 1] - 1;
int index = CHARTAB_IDX (c, depth, min_char), idx;
int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
Lisp_Object val;
val = tbl->contents[index];
val = tbl->contents[chartab_idx];
if (SUB_CHAR_TABLE_P (val))
val = sub_char_table_ref_and_range (val, c, from, to, defalt);
else if (NILP (val))
val = defalt;
idx = index;
idx = chartab_idx;
while (idx > 0 && *from < min_char + idx * chartab_chars[depth])
{
Lisp_Object this_val;
......@@ -244,13 +244,13 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
break;
}
}
while ((c = min_char + (index + 1) * chartab_chars[depth]) <= max_char
while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char
&& *to >= c)
{
Lisp_Object this_val;
index++;
this_val = tbl->contents[index];
chartab_idx++;
this_val = tbl->contents[chartab_idx];
if (SUB_CHAR_TABLE_P (this_val))
this_val = sub_char_table_ref_and_range (this_val, c, from, to, defalt);
else if (NILP (this_val))
......@@ -275,10 +275,10 @@ Lisp_Object
char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
int index = CHARTAB_IDX (c, 0, 0), idx;
int chartab_idx = CHARTAB_IDX (c, 0, 0), idx;
Lisp_Object val;
val = tbl->contents[index];
val = tbl->contents[chartab_idx];
if (*from < 0)
*from = 0;
if (*to < 0)
......@@ -288,7 +288,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
else if (NILP (val))
val = tbl->defalt;
idx = index;
idx = chartab_idx;
while (*from < idx * chartab_chars[0])
{
Lisp_Object this_val;
......@@ -308,13 +308,13 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
break;
}
}
while (*to >= (index + 1) * chartab_chars[0])
while (*to >= (chartab_idx + 1) * chartab_chars[0])
{
Lisp_Object this_val;
index++;
c = index * chartab_chars[0];
this_val = tbl->contents[index];
chartab_idx++;
c = chartab_idx * chartab_chars[0];
this_val = tbl->contents[chartab_idx];
if (SUB_CHAR_TABLE_P (this_val))
this_val = sub_char_table_ref_and_range (this_val, c, from, to,
tbl->defalt);
......@@ -331,20 +331,6 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
}
#define ASET_RANGE(ARRAY, FROM, TO, LIMIT, VAL) \
do { \
int limit = (TO) < (LIMIT) ? (TO) : (LIMIT); \
for (; (FROM) < limit; (FROM)++) (ARRAY)->contents[(FROM)] = (VAL); \
} while (0)
#define GET_SUB_CHAR_TABLE(TABLE, SUBTABLE, IDX, DEPTH, MIN_CHAR) \
do { \
(SUBTABLE) = (TABLE)->contents[(IDX)]; \
if (!SUB_CHAR_TABLE_P (SUBTABLE)) \
(SUBTABLE) = make_sub_char_table ((DEPTH), (MIN_CHAR), (SUBTABLE)); \
} while (0)
static void
sub_char_table_set (Lisp_Object table, int c, Lisp_Object val)
{
......@@ -1012,4 +998,3 @@ syms_of_chartab (void)
defsubr (&Soptimize_char_table);
defsubr (&Smap_char_table);
}
......@@ -199,7 +199,7 @@ calccost (struct tty_display_info *tty,
tabx,
tab2x,
tabcost;
register char *p;
register const char *p;
/* If have just wrapped on a terminal with xn,
don't believe the cursor position: give up here
......@@ -330,9 +330,9 @@ cmgoto (struct tty_display_info *tty, int row, int col)
llcost,
relcost,
directcost;
int use;
char *p,
*dcm;
int use IF_LINT (= 0);
char *p;
const char *dcm;
/* First the degenerate case */
if (row == curY (tty) && col == curX (tty)) /* already there */
......@@ -460,4 +460,3 @@ Wcm_init (struct tty_display_info *tty)
return - 2;
return 0;
}