Mercurial > hg > xemacs-beta
comparison src/text.c @ 4990:8f0cf4fd3d2c
Automatic merge
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Sat, 06 Feb 2010 04:01:46 -0600 |
| parents | 16112448d484 |
| children | ae48681c47fa |
comparison
equal
deleted
inserted
replaced
| 4989:d2ec55325515 | 4990:8f0cf4fd3d2c |
|---|---|
| 4236 { | 4236 { |
| 4237 sink->data.len = Dynarr_length (conversion_out_dynarr); | 4237 sink->data.len = Dynarr_length (conversion_out_dynarr); |
| 4238 /* double zero-extend because we may be dealing with Unicode data */ | 4238 /* double zero-extend because we may be dealing with Unicode data */ |
| 4239 Dynarr_add (conversion_out_dynarr, '\0'); | 4239 Dynarr_add (conversion_out_dynarr, '\0'); |
| 4240 Dynarr_add (conversion_out_dynarr, '\0'); | 4240 Dynarr_add (conversion_out_dynarr, '\0'); |
| 4241 sink->data.ptr = Dynarr_atp (conversion_out_dynarr, 0); | 4241 sink->data.ptr = Dynarr_begin (conversion_out_dynarr); |
| 4242 } | 4242 } |
| 4243 | 4243 |
| 4244 PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); | 4244 PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); |
| 4245 } | 4245 } |
| 4246 | 4246 |
| 4468 /* The macros don't currently distinguish between internal and | 4468 /* The macros don't currently distinguish between internal and |
| 4469 external sinks, and allocate and copy two extra bytes in both | 4469 external sinks, and allocate and copy two extra bytes in both |
| 4470 cases. So we add a second zero, just like for external data | 4470 cases. So we add a second zero, just like for external data |
| 4471 (in that case, because we may be converting to Unicode). */ | 4471 (in that case, because we may be converting to Unicode). */ |
| 4472 Dynarr_add (conversion_in_dynarr, '\0'); | 4472 Dynarr_add (conversion_in_dynarr, '\0'); |
| 4473 sink->data.ptr = Dynarr_atp (conversion_in_dynarr, 0); | 4473 sink->data.ptr = Dynarr_begin (conversion_in_dynarr); |
| 4474 } | 4474 } |
| 4475 | 4475 |
| 4476 PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); | 4476 PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion); |
| 4477 } | 4477 } |
| 4478 | 4478 |
| 4530 /* ----------------------------------------------------------------------- */ | 4530 /* ----------------------------------------------------------------------- */ |
| 4531 | 4531 |
| 4532 /* We handle here the cases where SRC is a Lisp_Object, internal data | 4532 /* We handle here the cases where SRC is a Lisp_Object, internal data |
| 4533 (sized or unsized), or external data (sized or unsized), and return type | 4533 (sized or unsized), or external data (sized or unsized), and return type |
| 4534 is unsized alloca() or malloc() data. If the return type is a | 4534 is unsized alloca() or malloc() data. If the return type is a |
| 4535 Lisp_Object, use build_ext_string() for unsized external data, | 4535 Lisp_Object, use build_extstring() for unsized external data, |
| 4536 make_ext_string() for sized external data. If the return type needs to | 4536 make_extstring() for sized external data. If the return type needs to |
| 4537 be sized data, use the *_TO_SIZED_*() macros, and for other more | 4537 be sized data, use the *_TO_SIZED_*() macros, and for other more |
| 4538 complicated cases, use the original TO_*_FORMAT() macros. */ | 4538 complicated cases, use the original TO_*_FORMAT() macros. */ |
| 4539 | 4539 |
| 4540 static void | 4540 static void |
| 4541 new_dfc_convert_now_damn_it (const void *src, Bytecount src_size, | 4541 new_dfc_convert_now_damn_it (const void *src, Bytecount src_size, |
| 4611 | 4611 |
| 4612 assert (i >= 0); | 4612 assert (i >= 0); |
| 4613 vals = Dynarr_atp (active_alloca_convert, i); | 4613 vals = Dynarr_atp (active_alloca_convert, i); |
| 4614 assert (alloca_data); | 4614 assert (alloca_data); |
| 4615 memcpy (alloca_data, vals->dst, vals->dst_size); | 4615 memcpy (alloca_data, vals->dst, vals->dst_size); |
| 4616 xfree (vals->dst, void *); | 4616 xfree (vals->dst); |
| 4617 Dynarr_delete (active_alloca_convert, i); | 4617 Dynarr_delete (active_alloca_convert, i); |
| 4618 return alloca_data; | 4618 return alloca_data; |
| 4619 } | 4619 } |
| 4620 | 4620 |
| 4621 void * | 4621 void * |
| 5156 } | 5156 } |
| 5157 | 5157 |
| 5158 void | 5158 void |
| 5159 vars_of_text (void) | 5159 vars_of_text (void) |
| 5160 { | 5160 { |
| 5161 QSin_char_byte_conversion = build_msg_string ("(in char-byte conversion)"); | 5161 QSin_char_byte_conversion = build_defer_string ("(in char-byte conversion)"); |
| 5162 staticpro (&QSin_char_byte_conversion); | 5162 staticpro (&QSin_char_byte_conversion); |
| 5163 QSin_internal_external_conversion = | 5163 QSin_internal_external_conversion = |
| 5164 build_msg_string ("(in internal-external conversion)"); | 5164 build_defer_string ("(in internal-external conversion)"); |
| 5165 staticpro (&QSin_internal_external_conversion); | 5165 staticpro (&QSin_internal_external_conversion); |
| 5166 | 5166 |
| 5167 #ifdef ENABLE_COMPOSITE_CHARS | 5167 #ifdef ENABLE_COMPOSITE_CHARS |
| 5168 /* #### not dumped properly */ | 5168 /* #### not dumped properly */ |
| 5169 composite_char_row_next = 32; | 5169 composite_char_row_next = 32; |
