Mercurial > hg > xemacs-beta
annotate src/dump-data.c @ 5879:77d7b77909c2
Move extents.c to working in byte positions only; fix a bug, extent_detach()
src/ChangeLog addition:
2015-03-27 Aidan Kehoe <kehoea@parhasard.net>
Fix a small bug, extent_detach(); minimise needless char-byte
conversion, extents.c, sticking to byte positions in general in
this file.
* extents.c:
* extents.c (signal_single_extent_changed):
Pass byte endpoints to
gutter_extent_signal_changed_region_maybe(),
buffer_extent_signal_changed_region().
* extents.c (extent_detach):
Call signal_extent_changed() correctly, pass both extent endpoints
rather than just the byte and character variants of the start.
* extents.c (struct report_extent_modification_closure):
Do this in terms of byte positions.
* extents.c (report_extent_modification_mapper):
Use byte positions, only converting to characters when we are
definitely calling Lisp.
* extents.c (report_extent_modification):
Use byte positions in this API, move the byte-char conversion to
our callers, simplifying extents.c (it all now works in byte
positions).
* extents.h:
Update report_extent_modification's prototype.
* gutter.c (gutter_extent_signal_changed_region_maybe):
Use byte positions here, avoids needless byte-char conversion.
* gutter.h:
Update the prototype here.
* insdel.c:
* insdel.c (buffer_extent_signal_changed_region):
Implement this in terms of byte positions.
* insdel.c (signal_before_change):
* insdel.c (signal_after_change):
Call report_extent_modification() with byte positions, doing the
char->byte conversion here rather than leaving it to extents.c.
* insdel.h:
* insdel.h (struct each_buffer_change_data):
The extent unchanged info now describes bytecounts.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Fri, 27 Mar 2015 23:39:49 +0000 |
| parents | 308d34e9f07d |
| children |
| rev | line source |
|---|---|
| 2015 | 1 /* Static array to put the dumped data in and its management |
| 2 Copyright (C) 2003 Olivier Galibert | |
| 3 | |
| 4 This file is part of XEmacs. | |
| 5 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
6 XEmacs is free software: you can redistribute it and/or modify it |
| 2015 | 7 under the terms of the GNU General Public License as published by the |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
8 Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
9 option) any later version. |
| 2015 | 10 |
| 11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 for more details. | |
| 15 | |
| 16 You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 2015 | 18 |
| 19 /* Synched up with: Not in FSF. */ | |
| 20 | |
| 21 /* Mule-ized? Mwahahahahahaha */ | |
| 22 | |
| 23 /* Magic values by Larry McVoy to prevent every known compiler, including | |
| 24 an especially perverse HP-UX one, from putting the array in BSS. | |
| 25 */ | |
| 26 | |
| 27 | |
| 28 #include <config.h> | |
| 29 #include "lisp.h" | |
| 30 #include "dump-data.h" | |
| 31 | |
| 32 /* 4 bytes for the data size, 4096 for alignment */ | |
| 33 | |
| 2367 | 34 static Rawbyte dumped_data[MAX_SIZE+4096+4] = { |
| 2015 | 35 255, |
| 36 6, | |
| 37 1, | |
| 38 2, | |
| 39 3, | |
| 40 4, | |
| 41 255, | |
| 42 3, | |
| 43 9, | |
| 44 62, | |
| 45 255, | |
| 46 10, | |
| 47 4, | |
| 48 61, | |
| 49 255 | |
| 50 }; | |
| 51 | |
| 52 size_t | |
| 2367 | 53 dumped_data_size (void) |
| 2015 | 54 { |
| 2367 | 55 return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) | |
| 56 (dumped_data[3] << 24); | |
| 2015 | 57 } |
| 58 | |
| 59 size_t | |
| 2367 | 60 dumped_data_max_size (void) |
| 2015 | 61 { |
| 62 return MAX_SIZE; | |
| 63 } | |
| 64 | |
| 65 size_t | |
| 2367 | 66 dumped_data_align_offset (void) |
| 2015 | 67 { |
| 2367 | 68 EMACS_INT iptr = (EMACS_INT) dumped_data; |
| 2015 | 69 EMACS_INT iptr2; |
| 2367 | 70 iptr2 = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; |
| 2015 | 71 |
| 2367 | 72 return iptr2 - iptr; |
| 2015 | 73 } |
| 74 | |
| 2367 | 75 Rawbyte * |
| 76 dumped_data_get (void) | |
| 2015 | 77 { |
| 2367 | 78 EMACS_INT iptr = (EMACS_INT) dumped_data; |
| 79 iptr = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; | |
| 80 return (Rawbyte *) iptr; | |
| 2015 | 81 } |
| 82 |
