Mercurial > hg > xemacs-beta
comparison src/select-x.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 | 70921960b980 |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
1725:7ff8f4d70aec | 1726:a8d8f419b459 |
---|---|
640 | 640 |
641 x_reply_selection_request (event, format, data, size, type); | 641 x_reply_selection_request (event, format, data, size, type); |
642 successful_p = Qt; | 642 successful_p = Qt; |
643 /* Tell x_selection_request_lisp_error() it's cool. */ | 643 /* Tell x_selection_request_lisp_error() it's cool. */ |
644 event->type = 0; | 644 event->type = 0; |
645 xfree (data); | 645 xfree (data, UChar_Binary *); |
646 } | 646 } |
647 | 647 |
648 unbind_to (count); | 648 unbind_to (count); |
649 | 649 |
650 DONE_LABEL: | 650 DONE_LABEL: |
769 { | 769 { |
770 if (prev) | 770 if (prev) |
771 prev->next = rest->next; | 771 prev->next = rest->next; |
772 else | 772 else |
773 for_whom_the_bell_tolls = rest->next; | 773 for_whom_the_bell_tolls = rest->next; |
774 xfree (rest); | 774 xfree (rest, struct prop_location *); |
775 return; | 775 return; |
776 } | 776 } |
777 prev = rest; | 777 prev = rest; |
778 rest = rest->next; | 778 rest = rest->next; |
779 } | 779 } |
804 stderr_out ("Saw expected prop-%s on %s\n", | 804 stderr_out ("Saw expected prop-%s on %s\n", |
805 (event->state == PropertyDelete ? "delete" : "change"), | 805 (event->state == PropertyDelete ? "delete" : "change"), |
806 XSTRING_DATA | 806 XSTRING_DATA |
807 (XSYMBOL (x_atom_to_symbol | 807 (XSYMBOL (x_atom_to_symbol |
808 (get_device_from_display (event->display), | 808 (get_device_from_display (event->display), |
809 event->atom))->name); | 809 event->atom))->name)); |
810 #endif | 810 #endif |
811 if (prev) | 811 if (prev) |
812 prev->next = rest->next; | 812 prev->next = rest->next; |
813 else | 813 else |
814 for_whom_the_bell_tolls = rest->next; | 814 for_whom_the_bell_tolls = rest->next; |
815 xfree (rest); | 815 xfree (rest, struct prop_location *); |
816 return; | 816 return; |
817 } | 817 } |
818 prev = rest; | 818 prev = rest; |
819 rest = rest->next; | 819 rest = rest->next; |
820 } | 820 } |
1072 { | 1072 { |
1073 #if 0 | 1073 #if 0 |
1074 stderr_out (" read INCR done\n"); | 1074 stderr_out (" read INCR done\n"); |
1075 #endif | 1075 #endif |
1076 unexpect_property_change (prop_id); | 1076 unexpect_property_change (prop_id); |
1077 if (tmp_data) xfree (tmp_data); | 1077 if (tmp_data) |
1078 xfree (tmp_data, UChar_Binary *); | |
1078 break; | 1079 break; |
1079 } | 1080 } |
1080 #if 0 | 1081 #if 0 |
1081 stderr_out (" read INCR %d\n", tmp_size_bytes); | 1082 stderr_out (" read INCR %d\n", tmp_size_bytes); |
1082 #endif | 1083 #endif |
1089 *size_bytes_ret = offset + tmp_size_bytes; | 1090 *size_bytes_ret = offset + tmp_size_bytes; |
1090 *data_ret = (UChar_Binary *) xrealloc (*data_ret, *size_bytes_ret); | 1091 *data_ret = (UChar_Binary *) xrealloc (*data_ret, *size_bytes_ret); |
1091 } | 1092 } |
1092 memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); | 1093 memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); |
1093 offset += tmp_size_bytes; | 1094 offset += tmp_size_bytes; |
1094 xfree (tmp_data); | 1095 xfree (tmp_data, UChar_Binary *); |
1095 } | 1096 } |
1096 } | 1097 } |
1097 | 1098 |
1098 | 1099 |
1099 static Lisp_Object | 1100 static Lisp_Object |
1138 /* Ok, that data wasn't *the* data, it was just the beginning. */ | 1139 /* Ok, that data wasn't *the* data, it was just the beginning. */ |
1139 | 1140 |
1140 Bytecount min_size_bytes = | 1141 Bytecount min_size_bytes = |
1141 /* careful here. */ | 1142 /* careful here. */ |
1142 (Bytecount) (* ((unsigned int *) data)); | 1143 (Bytecount) (* ((unsigned int *) data)); |
1143 xfree (data); | 1144 xfree (data, UChar_Binary *); |
1144 receive_incremental_selection (display, window, property, target_type, | 1145 receive_incremental_selection (display, window, property, target_type, |
1145 min_size_bytes, &data, &bytes, | 1146 min_size_bytes, &data, &bytes, |
1146 &actual_type, &actual_format, | 1147 &actual_type, &actual_format, |
1147 &actual_size); | 1148 &actual_size); |
1148 } | 1149 } |
1150 /* It's been read. Now convert it to a lisp object in some semi-rational | 1151 /* It's been read. Now convert it to a lisp object in some semi-rational |
1151 manner. */ | 1152 manner. */ |
1152 val = selection_data_to_lisp_data (d, data, bytes, | 1153 val = selection_data_to_lisp_data (d, data, bytes, |
1153 actual_type, actual_format); | 1154 actual_type, actual_format); |
1154 | 1155 |
1155 xfree (data); | 1156 xfree (data, UChar_Binary *); |
1156 return val; | 1157 return val; |
1157 } | 1158 } |
1158 | 1159 |
1159 | 1160 |
1160 /* Called from the event loop to handle SelectionNotify events. | 1161 /* Called from the event loop to handle SelectionNotify events. |
1282 ret = (bytes ? | 1283 ret = (bytes ? |
1283 make_ext_string ((Extbyte *) data, bytes, | 1284 make_ext_string ((Extbyte *) data, bytes, |
1284 memchr (data, 0x1b, bytes) ? | 1285 memchr (data, 0x1b, bytes) ? |
1285 Qctext : Qbinary) | 1286 Qctext : Qbinary) |
1286 : Qnil); | 1287 : Qnil); |
1287 xfree (data); | 1288 xfree (data, UChar_Binary *); |
1288 return ret; | 1289 return ret; |
1289 } | 1290 } |
1290 | 1291 |
1291 | 1292 |
1292 DEFUN ("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0, /* | 1293 DEFUN ("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0, /* |