annotate src/dump-data.c @ 5655:b7ae5f44b950

Remove some redundant functions, change others to labels, lisp/ lisp/ChangeLog addition: 2012-05-05 Aidan Kehoe <kehoea@parhasard.net> Remove some redundant functions; turn other utility functions into labels, avoiding visibility in the global namespace, and reducing the size of the dumped binary. * auto-save.el (auto-save-unhex): Removed. * auto-save.el (auto-save-unescape-name): Use #'string-to-number instead of #'auto-save-unhex. * files.el (save-some-buffers): * files.el (save-some-buffers-1): Changed to a label. * files.el (not-modified): * gui.el (make-gui-button): * gui.el (gui-button-action): Changed to a label. * gui.el (insert-gui-button): * indent.el (indent-for-tab-command): * indent.el (insert-tab): Changed to a label. * indent.el (indent-rigidly): * isearch-mode.el: * isearch-mode.el (isearch-ring-adjust): * isearch-mode.el (isearch-ring-adjust1): Changed to a label. * isearch-mode.el (isearch-pre-command-hook): * isearch-mode.el (isearch-maybe-frob-keyboard-macros): Changed to a label. * isearch-mode.el (isearch-highlight): * isearch-mode.el (isearch-make-extent): Changed to a label. * itimer.el: * itimer.el (itimer-decrement): Removed, replaced uses with decf. * itimer.el (itimer-increment): Removed, replaced uses with incf. * itimer.el (itimer-signum): Removed, replaced uses with minusp, plusp. * itimer.el (itimer-name): * itimer.el (check-itimer): Removed, replaced with #'check-type calls. * itimer.el (itimer-value): * itimer.el (check-itimer-coerce-string): Removed. * itimer.el (itimer-restart): * itimer.el (itimer-function): * itimer.el (check-nonnegative-number): Removed. * itimer.el (itimer-uses-arguments): * itimer.el (check-string): Removed. * itimer.el (itimer-function-arguments): * itimer.el (itimer-recorded-run-time): * itimer.el (set-itimer-name): * itimer.el (set-itimer-value): * itimer.el (set-itimer-value-internal): * itimer.el (set-itimer-restart): * itimer.el (set-itimer-function): * itimer.el (set-itimer-is-idle): * itimer.el (set-itimer-recorded-run-time): * itimer.el (get-itimer): * itimer.el (delete-itimer): * itimer.el (start-itimer): * itimer.el (activate-itimer): * itimer.el (itimer-edit-set-field): * itimer.el (itimer-edit-next-field): * itimer.el (itimer-edit-previous-field): Use incf, decf, plusp, minusp and the more general argument type checking macros. * lib-complete.el: * lib-complete.el (lib-complete:better-root): Changed to a label. * lib-complete.el (lib-complete:get-completion-table): Changed to a label. * lib-complete.el (read-library-internal): Include labels. * lib-complete.el (lib-complete:cache-completions): Changed to a label. * minibuf.el (read-buffer): Use #'set-difference, don't reinvent it. * newcomment.el (comment-padright): Use a label instead of repeating a lambda expression. * packages.el (package-get-key): * packages.el (package-get-key-1): Removed, use #'getf instead. * simple.el (kill-backward-chars): Removed; this isn't used. * simple.el (what-cursor-position): (lambda (arg) (format "%S" arg) -> #'prin1-to-string. * simple.el (debug-print-1): Renamed to #'debug-print. * simple.el (debug-print): Removed, #'debug-print-1 was equivalent. * subr.el (integer-to-bit-vector): check-nonnegative-number no longer available. * widget.el (define-widget): * widget.el (define-widget-keywords): Removed, this was long obsolete.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 05 May 2012 18:42:00 +0100
parents 308d34e9f07d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
1 /* Static array to put the dumped data in and its management
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
2 Copyright (C) 2003 Olivier Galibert
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
3
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
4 This file is part of XEmacs.
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
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
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
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
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
10
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
14 for more details.
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
15
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
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
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
18
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
19 /* Synched up with: Not in FSF. */
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
20
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
21 /* Mule-ized? Mwahahahahahaha */
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
22
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
23 /* Magic values by Larry McVoy to prevent every known compiler, including
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
24 an especially perverse HP-UX one, from putting the array in BSS.
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
25 */
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
26
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
27
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
28 #include <config.h>
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
29 #include "lisp.h"
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
30 #include "dump-data.h"
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
31
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
32 /* 4 bytes for the data size, 4096 for alignment */
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
33
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
34 static Rawbyte dumped_data[MAX_SIZE+4096+4] = {
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
35 255,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
36 6,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
37 1,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
38 2,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
39 3,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
40 4,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
41 255,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
42 3,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
43 9,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
44 62,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
45 255,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
46 10,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
47 4,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
48 61,
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
49 255
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
50 };
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
51
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
52 size_t
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
53 dumped_data_size (void)
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
54 {
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
55 return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) |
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
56 (dumped_data[3] << 24);
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
57 }
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
58
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
59 size_t
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
60 dumped_data_max_size (void)
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
61 {
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
62 return MAX_SIZE;
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
63 }
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
64
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
65 size_t
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
66 dumped_data_align_offset (void)
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
67 {
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
68 EMACS_INT iptr = (EMACS_INT) dumped_data;
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
69 EMACS_INT iptr2;
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
70 iptr2 = (iptr + 4 + 4095) & ~(EMACS_INT) 4095;
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
71
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
72 return iptr2 - iptr;
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
73 }
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
74
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
75 Rawbyte *
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
76 dumped_data_get (void)
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
77 {
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
78 EMACS_INT iptr = (EMACS_INT) dumped_data;
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
79 iptr = (iptr + 4 + 4095) & ~(EMACS_INT) 4095;
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2035
diff changeset
80 return (Rawbyte *) iptr;
2015
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
81 }
2364237fbc0f [xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
olivierg
parents:
diff changeset
82