Mercurial > hg > xemacs-beta
comparison src/file-coding.c @ 1726:a8d8f419b459
[xemacs-hg @ 2003-09-30 15:26:34 by james]
Add type information to xfree to avoid alias creation.
author | james |
---|---|
date | Tue, 30 Sep 2003 15:27:01 +0000 |
parents | 210683f31426 |
children | 34ca43a57692 |
comparison
equal
deleted
inserted
replaced
1725:7ff8f4d70aec | 1726:a8d8f419b459 |
---|---|
1142 NILP (name_or_existing) ? (Ibyte *) "nil" : | 1142 NILP (name_or_existing) ? (Ibyte *) "nil" : |
1143 XSTRING_DATA (Fsymbol_name (XCODING_SYSTEM_NAME | 1143 XSTRING_DATA (Fsymbol_name (XCODING_SYSTEM_NAME |
1144 (name_or_existing))), | 1144 (name_or_existing))), |
1145 ++coding_system_tick); | 1145 ++coding_system_tick); |
1146 name_or_existing = intern_int (newname); | 1146 name_or_existing = intern_int (newname); |
1147 xfree (newname); | 1147 xfree (newname, Ibyte *); |
1148 | 1148 |
1149 if (UNBOUNDP (description)) | 1149 if (UNBOUNDP (description)) |
1150 { | 1150 { |
1151 newname = | 1151 newname = |
1152 emacs_sprintf_malloc | 1152 emacs_sprintf_malloc |
1153 (NULL, "For Internal Use (%s)", | 1153 (NULL, "For Internal Use (%s)", |
1154 XSTRING_DATA (Fsymbol_name (name_or_existing))); | 1154 XSTRING_DATA (Fsymbol_name (name_or_existing))); |
1155 description = build_intstring (newname); | 1155 description = build_intstring (newname); |
1156 xfree (newname); | 1156 xfree (newname, Ibyte *); |
1157 } | 1157 } |
1158 | 1158 |
1159 newname = emacs_sprintf_malloc (NULL, "Int%d", coding_system_tick); | 1159 newname = emacs_sprintf_malloc (NULL, "Int%d", coding_system_tick); |
1160 defmnem = build_intstring (newname); | 1160 defmnem = build_intstring (newname); |
1161 xfree (newname); | 1161 xfree (newname, Ibyte *); |
1162 } | 1162 } |
1163 else | 1163 else |
1164 CHECK_SYMBOL (name_or_existing); | 1164 CHECK_SYMBOL (name_or_existing); |
1165 | 1165 |
1166 if (!NILP (Ffind_coding_system (name_or_existing))) | 1166 if (!NILP (Ffind_coding_system (name_or_existing))) |
1260 (NULL, "internal-eol-copy-%s-%d", | 1260 (NULL, "internal-eol-copy-%s-%d", |
1261 XSTRING_DATA (Fsymbol_name (name_or_existing)), | 1261 XSTRING_DATA (Fsymbol_name (name_or_existing)), |
1262 ++coding_system_tick); | 1262 ++coding_system_tick); |
1263 Lisp_Object newnamesym = intern_int (newname); | 1263 Lisp_Object newnamesym = intern_int (newname); |
1264 Lisp_Object copied = Fcopy_coding_system (csobj, newnamesym); | 1264 Lisp_Object copied = Fcopy_coding_system (csobj, newnamesym); |
1265 xfree (newname); | 1265 xfree (newname, Ibyte *); |
1266 | 1266 |
1267 XCODING_SYSTEM_CANONICAL (csobj) = | 1267 XCODING_SYSTEM_CANONICAL (csobj) = |
1268 make_internal_coding_system | 1268 make_internal_coding_system |
1269 (csobj, | 1269 (csobj, |
1270 "internal-eol-wrapper", | 1270 "internal-eol-wrapper", |
2249 | 2249 |
2250 assert (!str->finalized); | 2250 assert (!str->finalized); |
2251 MAYBE_XCODESYSMETH (str->codesys, finalize_coding_stream, (str)); | 2251 MAYBE_XCODESYSMETH (str->codesys, finalize_coding_stream, (str)); |
2252 if (str->data) | 2252 if (str->data) |
2253 { | 2253 { |
2254 xfree (str->data); | 2254 xfree (str->data, void *); |
2255 str->data = 0; | 2255 str->data = 0; |
2256 } | 2256 } |
2257 str->finalized = 1; | 2257 str->finalized = 1; |
2258 } | 2258 } |
2259 | 2259 |
2308 str->orig_codesys = codesys; | 2308 str->orig_codesys = codesys; |
2309 str->codesys = coding_system_real_canonical (codesys); | 2309 str->codesys = coding_system_real_canonical (codesys); |
2310 | 2310 |
2311 if (str->data) | 2311 if (str->data) |
2312 { | 2312 { |
2313 xfree (str->data); | 2313 xfree (str->data, void *); |
2314 str->data = 0; | 2314 str->data = 0; |
2315 } | 2315 } |
2316 if (XCODING_SYSTEM_METHODS (str->codesys)->coding_data_size) | 2316 if (XCODING_SYSTEM_METHODS (str->codesys)->coding_data_size) |
2317 { | 2317 { |
2318 str->data = | 2318 str->data = |
2812 cause lots of nastiness including crashes. Just let them be | 2812 cause lots of nastiness including crashes. Just let them be |
2813 freed normally. */ | 2813 freed normally. */ |
2814 for (i = 0; i < data->lstream_count; i++) | 2814 for (i = 0; i < data->lstream_count; i++) |
2815 Lstream_delete (XLSTREAM ((data->lstreams)[i])); | 2815 Lstream_delete (XLSTREAM ((data->lstreams)[i])); |
2816 } | 2816 } |
2817 xfree (data->lstreams); | 2817 xfree (data->lstreams, Lisp_Object *); |
2818 } | 2818 } |
2819 } | 2819 } |
2820 | 2820 |
2821 static void | 2821 static void |
2822 chain_finalize_coding_stream (struct coding_stream *str) | 2822 chain_finalize_coding_stream (struct coding_stream *str) |
2826 | 2826 |
2827 static void | 2827 static void |
2828 chain_finalize (Lisp_Object c) | 2828 chain_finalize (Lisp_Object c) |
2829 { | 2829 { |
2830 if (XCODING_SYSTEM_CHAIN_CHAIN (c)) | 2830 if (XCODING_SYSTEM_CHAIN_CHAIN (c)) |
2831 xfree (XCODING_SYSTEM_CHAIN_CHAIN (c)); | 2831 xfree (XCODING_SYSTEM_CHAIN_CHAIN (c), Lisp_Object *); |
2832 } | 2832 } |
2833 | 2833 |
2834 static int | 2834 static int |
2835 chain_putprop (Lisp_Object codesys, Lisp_Object key, Lisp_Object value) | 2835 chain_putprop (Lisp_Object codesys, Lisp_Object key, Lisp_Object value) |
2836 { | 2836 { |
3440 if (Dynarr_at (all_coding_detectors, i).finalize_detection_state_method) | 3440 if (Dynarr_at (all_coding_detectors, i).finalize_detection_state_method) |
3441 Dynarr_at (all_coding_detectors, i).finalize_detection_state_method | 3441 Dynarr_at (all_coding_detectors, i).finalize_detection_state_method |
3442 (st); | 3442 (st); |
3443 } | 3443 } |
3444 | 3444 |
3445 xfree (st); | 3445 xfree (st, struct detection_state *); |
3446 } | 3446 } |
3447 | 3447 |
3448 static int | 3448 static int |
3449 coding_category_symbol_to_id (Lisp_Object symbol) | 3449 coding_category_symbol_to_id (Lisp_Object symbol) |
3450 { | 3450 { |