reg)))
-#define CODING_ISO_REQUEST(coding, charset_id) \
- ((charset_id <= (coding)->max_charset_id \
- ? (coding)->safe_charsets[charset_id] \
+#define CODING_ISO_REQUEST(coding, charset_id) \
+ (((charset_id) <= (coding)->max_charset_id \
+ ? ((coding)->safe_charsets[charset_id] != 255 \
+ ? (coding)->safe_charsets[charset_id] \
+ : -1) \
: -1))
#define SAFE_CHARSET_P(coding, id) \
((id) <= (coding)->max_charset_id \
- && (coding)->safe_charsets[id] >= 0)
+ && (coding)->safe_charsets[id] != 255)
#define SHIFT_OUT_OK(category) \
max_charset_id = id;
}
- safe_charsets = Fmake_string (make_number (max_charset_id + 1),
- make_number (255));
+ safe_charsets = make_uninit_string (max_charset_id + 1);
+ memset (SDATA (safe_charsets), 255, max_charset_id + 1);
request = AREF (attrs, coding_attr_iso_request);
reg_usage = AREF (attrs, coding_attr_iso_usage);
reg94 = XINT (XCAR (reg_usage));
continue;
attrs = CODING_ID_ATTRS (this->id);
if (CODING_ISO_FLAGS (this) & CODING_ISO_FLAG_FULL_SUPPORT
- && ! EQ (CODING_ATTR_SAFE_CHARSETS (attrs), Viso_2022_charset_list))
+ && ! EQ (CODING_ATTR_CHARSET_LIST (attrs), Viso_2022_charset_list))
setup_iso_safe_charsets (attrs);
val = CODING_ATTR_SAFE_CHARSETS (attrs);
this->max_charset_id = SCHARS (val) - 1;
- this->safe_charsets = (char *) SDATA (val);
+ this->safe_charsets = SDATA (val);
}
/* A coding system of this category is always ASCII compatible. */
setup_iso_safe_charsets (attrs);
/* Charset list may have been changed. */
charset_list = CODING_ATTR_CHARSET_LIST (attrs);
- coding->safe_charsets = (char *) SDATA (CODING_ATTR_SAFE_CHARSETS(attrs));
+ coding->safe_charsets = SDATA (CODING_ATTR_SAFE_CHARSETS (attrs));
while (1)
{
setup_iso_safe_charsets (attrs);
/* Charset list may have been changed. */
charset_list = CODING_ATTR_CHARSET_LIST (attrs);
- coding->safe_charsets = (char *) SDATA (CODING_ATTR_SAFE_CHARSETS(attrs));
+ coding->safe_charsets = SDATA (CODING_ATTR_SAFE_CHARSETS (attrs));
ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
val = CODING_ATTR_SAFE_CHARSETS (attrs);
coding->max_charset_id = SCHARS (val) - 1;
- coding->safe_charsets = (char *) SDATA (val);
+ coding->safe_charsets = SDATA (val);
coding->default_char = XINT (CODING_ATTR_DEFAULT_CHAR (attrs));
coding_type = CODING_ATTR_TYPE (attrs);
setup_iso_safe_charsets (attrs);
val = CODING_ATTR_SAFE_CHARSETS (attrs);
coding->max_charset_id = SCHARS (val) - 1;
- coding->safe_charsets = (char *) SDATA (val);
+ coding->safe_charsets = SDATA (val);
}
CODING_ISO_FLAGS (coding) = flags;
}
tail = XCDR (tail))
if (max_charset_id < XFASTINT (XCAR (tail)))
max_charset_id = XFASTINT (XCAR (tail));
- safe_charsets = Fmake_string (make_number (max_charset_id + 1),
- make_number (255));
+ safe_charsets = make_uninit_string (max_charset_id + 1);
+ memset (SDATA (safe_charsets), 255, max_charset_id + 1);
for (tail = Vemacs_mule_charset_list; CONSP (tail);
tail = XCDR (tail))
SSET (safe_charsets, XFASTINT (XCAR (tail)), 0);
coding->max_charset_id = max_charset_id;
- coding->safe_charsets = (char *) SDATA (safe_charsets);
+ coding->safe_charsets = SDATA (safe_charsets);
}
}
else if (EQ (coding_type, Qshift_jis))
}
CODING_ATTR_CHARSET_LIST (attrs) = charset_list;
- safe_charsets = Fmake_string (make_number (max_charset_id + 1),
- make_number (255));
+ safe_charsets = make_uninit_string (max_charset_id + 1);
+ memset (SDATA (safe_charsets), 255, max_charset_id + 1);
for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
SSET (safe_charsets, XFASTINT (XCAR (tail)), 0);
CODING_ATTR_SAFE_CHARSETS (attrs) = safe_charsets;