diff options
| author | Joakim Verona | 2013-02-23 00:04:35 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-23 00:04:35 +0100 |
| commit | 05a2b6a9e5b5a0d35ba1918bc657666692bcdc91 (patch) | |
| tree | 8bdfb7db5ae5f6e2f5e7ab49c249d5123283a100 | |
| parent | 77a72b7ae367eb0c98f1bcbe021076a9cb97e86f (diff) | |
| parent | 800d26890ae8c76f031a80b8fbad383e1f4cf19a (diff) | |
| download | emacs-05a2b6a9e5b5a0d35ba1918bc657666692bcdc91.tar.gz emacs-05a2b6a9e5b5a0d35ba1918bc657666692bcdc91.zip | |
auto upstream
| -rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/ack.texi | 4 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 2 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/flymake.texi | 16 | ||||
| -rw-r--r-- | etc/DEBUG | 33 | ||||
| -rw-r--r-- | lisp/ChangeLog | 35 | ||||
| -rw-r--r-- | lisp/cmuscheme.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 10 | ||||
| -rw-r--r-- | lisp/htmlfontify.el | 2 | ||||
| -rw-r--r-- | lisp/image-mode.el | 21 | ||||
| -rw-r--r-- | lisp/isearch.el | 14 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 12 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/inf-lisp.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/tcl.el | 4 | ||||
| -rw-r--r-- | lisp/replace.el | 1 | ||||
| -rw-r--r-- | lisp/textmodes/ispell.el | 5 | ||||
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 31 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 4 | ||||
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/ralloc.c | 188 | ||||
| -rw-r--r-- | src/vm-limit.c | 20 | ||||
| -rw-r--r-- | src/w32.c | 41 |
25 files changed, 288 insertions, 198 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 83d5b1d25ed..33f530cbadc 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-22 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * ack.texi (Acknowledgments): | ||
| 4 | * emacs.texi (Acknowledgments): Small updates. | ||
| 5 | |||
| 1 | 2013-02-21 Glenn Morris <rgm@gnu.org> | 6 | 2013-02-21 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * files.texi (File Conveniences): Not just GIFs can be animated. | 8 | * files.texi (File Conveniences): Not just GIFs can be animated. |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index 718a51c60db..17309f74408 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -202,7 +202,7 @@ Andrew Choi and Yamamoto Mitsuharu wrote the Carbon support, used | |||
| 202 | prior to Emacs 23 for Mac OS. | 202 | prior to Emacs 23 for Mac OS. |
| 203 | 203 | ||
| 204 | @item | 204 | @item |
| 205 | Chong Yidong was the Emacs co-maintainer from Emacs 23 onwards. He made many | 205 | Chong Yidong was the Emacs co-maintainer from Emacs 23 to 24.3. He made many |
| 206 | improvements to the Emacs display engine. He also wrote | 206 | improvements to the Emacs display engine. He also wrote |
| 207 | @file{tabulated-list.el}, a generic major mode for lists of data; | 207 | @file{tabulated-list.el}, a generic major mode for lists of data; |
| 208 | and improved support for themes and packages. | 208 | and improved support for themes and packages. |
| @@ -825,7 +825,7 @@ facility. He also wrote @code{ebrowse}, the C@t{++} browser; | |||
| 825 | and @file{rx.el}, a regular expression constructor. | 825 | and @file{rx.el}, a regular expression constructor. |
| 826 | 826 | ||
| 827 | @item | 827 | @item |
| 828 | Stefan Monnier was the Emacs co-maintainer from Emacs 23 onwards. He added | 828 | Stefan Monnier was the Emacs (co-)maintainer from Emacs 23 onwards. He added |
| 829 | support for Arch and Subversion to VC, re-wrote much of the Emacs server | 829 | support for Arch and Subversion to VC, re-wrote much of the Emacs server |
| 830 | to use the built-in networking primitives, and re-wrote the abbrev and | 830 | to use the built-in networking primitives, and re-wrote the abbrev and |
| 831 | minibuffer completion code for Emacs 23. He also wrote @code{PCL-CVS}, | 831 | minibuffer completion code for Emacs 23. He also wrote @code{PCL-CVS}, |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 4f11da8032a..bda7c0821c0 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -1375,7 +1375,7 @@ Engster, Hans Henrik Eriksen, Michael Ernst, Ata Etemadi, Frederick | |||
| 1375 | Farnbach, Oscar Figueiredo, Fred Fish, Steve Fisk, Karl Fogel, Gary | 1375 | Farnbach, Oscar Figueiredo, Fred Fish, Steve Fisk, Karl Fogel, Gary |
| 1376 | Foster, Eric S. Fraga, Romain Francoise, Noah Friedman, Andreas | 1376 | Foster, Eric S. Fraga, Romain Francoise, Noah Friedman, Andreas |
| 1377 | Fuchs, Shigeru Fukaya, Hallvard Furuseth, Keith Gabryelski, Peter S. | 1377 | Fuchs, Shigeru Fukaya, Hallvard Furuseth, Keith Gabryelski, Peter S. |
| 1378 | Galbraith, Kevin Gallagher, Kevin Gallo, Juan León Lahoz García, | 1378 | Galbraith, Kevin Gallagher, Fabián E. Gallina, Kevin Gallo, Juan León Lahoz García, |
| 1379 | Howard Gayle, Daniel German, Stephen Gildea, Julien Gilles, David | 1379 | Howard Gayle, Daniel German, Stephen Gildea, Julien Gilles, David |
| 1380 | Gillespie, Bob Glickstein, Deepak Goel, David De La Harpe Golden, Boris | 1380 | Gillespie, Bob Glickstein, Deepak Goel, David De La Harpe Golden, Boris |
| 1381 | Goldowsky, David Goodger, Chris Gray, Kevin Greiner, Michelangelo Grigni, Odd | 1381 | Goldowsky, David Goodger, Chris Gray, Kevin Greiner, Michelangelo Grigni, Odd |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 4f827073b2f..9a4f4c10610 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-02-22 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * flymake.texi (Syntax check statuses): Fix multitable continued rows. | ||
| 4 | |||
| 1 | 2013-02-21 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2013-02-21 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 6 | ||
| 3 | * Makefile.in (html): New rule. | 7 | * Makefile.in (html): New rule. |
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 79259a76503..5dedda16ee1 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi | |||
| @@ -210,14 +210,14 @@ The following statuses are defined. | |||
| 210 | @multitable @columnfractions 0.25 0.75 | 210 | @multitable @columnfractions 0.25 0.75 |
| 211 | @item Flymake* or Flymake:E/W* | 211 | @item Flymake* or Flymake:E/W* |
| 212 | @tab Flymake is currently running. For the second case, E/W contains the | 212 | @tab Flymake is currently running. For the second case, E/W contains the |
| 213 | error and warning count for the previous run. | 213 | error and warning count for the previous run. |
| 214 | 214 | ||
| 215 | @item Flymake | 215 | @item Flymake |
| 216 | @tab Syntax check is not running. Usually this means syntax check was | 216 | @tab Syntax check is not running. Usually this means syntax check was |
| 217 | successfully passed (no errors, no warnings). Other possibilities are: | 217 | successfully passed (no errors, no warnings). Other possibilities are: |
| 218 | syntax check was killed as a result of executing | 218 | syntax check was killed as a result of executing |
| 219 | @code{flymake-compile}, or syntax check cannot start as compilation | 219 | @code{flymake-compile}, or syntax check cannot start as compilation |
| 220 | is currently in progress. | 220 | is currently in progress. |
| 221 | 221 | ||
| 222 | @item Flymake:E/W | 222 | @item Flymake:E/W |
| 223 | @tab Number of errors/warnings found by the syntax check process. | 223 | @tab Number of errors/warnings found by the syntax check process. |
| @@ -232,9 +232,9 @@ OFF for the buffer. | |||
| 232 | @multitable @columnfractions 0.25 0.75 | 232 | @multitable @columnfractions 0.25 0.75 |
| 233 | @item CFGERR | 233 | @item CFGERR |
| 234 | @tab Syntax check process returned nonzero exit code, but no | 234 | @tab Syntax check process returned nonzero exit code, but no |
| 235 | errors/warnings were reported. This indicates a possible configuration | 235 | errors/warnings were reported. This indicates a possible configuration |
| 236 | error (for example, no suitable error message patterns for the | 236 | error (for example, no suitable error message patterns for the |
| 237 | syntax check tool). | 237 | syntax check tool). |
| 238 | 238 | ||
| 239 | @item NOMASTER | 239 | @item NOMASTER |
| 240 | @tab Flymake was unable to find master file for the current buffer. | 240 | @tab Flymake was unable to find master file for the current buffer. |
| @@ -8,17 +8,28 @@ See the end of the file for license conditions. | |||
| 8 | read the Windows-specific section near the end of this document.] | 8 | read the Windows-specific section near the end of this document.] |
| 9 | 9 | ||
| 10 | ** When you debug Emacs with GDB, you should start it in the directory | 10 | ** When you debug Emacs with GDB, you should start it in the directory |
| 11 | where the executable was made. That directory has a .gdbinit file | 11 | where the executable was made (the 'src' directory in the Emacs source |
| 12 | that defines various "user-defined" commands for debugging Emacs. | 12 | tree). That directory has a .gdbinit file that defines various |
| 13 | (These commands are described below under "Examining Lisp object | 13 | "user-defined" commands for debugging Emacs. (These commands are |
| 14 | values" and "Debugging Emacs Redisplay problems".) | 14 | described below under "Examining Lisp object values" and "Debugging |
| 15 | 15 | Emacs Redisplay problems".) | |
| 16 | ** When you are trying to analyze failed assertions, it will be | 16 | |
| 17 | essential to compile Emacs either completely without optimizations or | 17 | Some GDB versions by default do not automatically load .gdbinit files |
| 18 | at least (when using GCC) with the -fno-crossjumping option. Failure | 18 | in the directory where you invoke GDB. With those versions of GDB, |
| 19 | to do so may make the compiler recycle the same abort call for all | 19 | you will see a warning when GDB starts, like this: |
| 20 | assertions in a given function, rendering the stack backtrace useless | 20 | |
| 21 | for identifying the specific failed assertion. | 21 | warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". |
| 22 | |||
| 23 | There are several ways to overcome that difficulty, they are all | ||
| 24 | described in the node "Auto-loading safe path" in the GDB user manual. | ||
| 25 | |||
| 26 | ** When you are trying to analyze failed assertions or backtraces, it | ||
| 27 | will be essential to compile Emacs either completely without | ||
| 28 | optimizations (set CFLAGS to "-O0 -g3") or at least (when using GCC) | ||
| 29 | with the -fno-crossjumping option in CFLAGS. Failure to do so may | ||
| 30 | make the compiler recycle the same abort call for all assertions in a | ||
| 31 | given function, rendering the stack backtrace useless for identifying | ||
| 32 | the specific failed assertion. | ||
| 22 | 33 | ||
| 23 | ** It is a good idea to run Emacs under GDB (or some other suitable | 34 | ** It is a good idea to run Emacs under GDB (or some other suitable |
| 24 | debugger) *all the time*. Then, when Emacs crashes, you will be able | 35 | debugger) *all the time*. Then, when Emacs crashes, you will be able |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 68cff2f6d29..1555dfc43b6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,38 @@ | |||
| 1 | 2013-02-22 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * isearch.el (isearch-lazy-highlight-new-loop): | ||
| 4 | Set `isearch-lazy-highlight-start' and `isearch-lazy-highlight-end' | ||
| 5 | to `isearch-other-end' if it is not nil. (Bug#13402) | ||
| 6 | |||
| 7 | * replace.el (replace-highlight): Let-bind `isearch-other-end' | ||
| 8 | to `match-beg'. | ||
| 9 | |||
| 10 | * textmodes/ispell.el (ispell-highlight-spelling-error-overlay): | ||
| 11 | Let-bind `isearch-other-end' to `start', `isearch-forward' to t | ||
| 12 | and `isearch-error' to nil. | ||
| 13 | |||
| 14 | 2013-02-22 Michael Albinus <michael.albinus@gmx.de> | ||
| 15 | |||
| 16 | * net/tramp.el (tramp-tramp-file-p): Fix docstring. | ||
| 17 | |||
| 18 | * net/tramp-sh.el (tramp-sh-handle-insert-directory): Handle | ||
| 19 | multibyte file names. | ||
| 20 | |||
| 21 | 2013-02-22 Glenn Morris <rgm@gnu.org> | ||
| 22 | |||
| 23 | * textmodes/sgml-mode.el (sgml-xml-mode): Move before use. | ||
| 24 | (sgml-transformation-function): Give it a :set function. | ||
| 25 | (sgml-tag): Doc fix. | ||
| 26 | |||
| 27 | * cmuscheme.el (scheme-buffer): | ||
| 28 | * progmodes/inf-lisp.el (inferior-lisp-buffer): | ||
| 29 | * progmodes/tcl.el (inferior-tcl-buffer): | ||
| 30 | * textmodes/tex-mode.el (tex-command): Doc fixes. | ||
| 31 | |||
| 32 | * image-mode.el (image-mode): Add mouse bindings for mode-line-process. | ||
| 33 | |||
| 34 | * htmlfontify.el (hfy-default-header): Encode title string. (Bug#7457) | ||
| 35 | |||
| 1 | 2013-02-21 Bastien Guerry <bzg@gnu.org> | 36 | 2013-02-21 Bastien Guerry <bzg@gnu.org> |
| 2 | 37 | ||
| 3 | * cmuscheme.el (scheme-buffer): Fix docstring. (Bug#13778) | 38 | * cmuscheme.el (scheme-buffer): Fix docstring. (Bug#13778) |
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el index 130eb374538..0f89eae8828 100644 --- a/lisp/cmuscheme.el +++ b/lisp/cmuscheme.el | |||
| @@ -478,8 +478,8 @@ This process selection is performed by function `scheme-proc'. | |||
| 478 | 478 | ||
| 479 | Whenever \\[run-scheme] fires up a new process, it resets `scheme-buffer' | 479 | Whenever \\[run-scheme] fires up a new process, it resets `scheme-buffer' |
| 480 | to be the new process's buffer. If you only run one process, this will | 480 | to be the new process's buffer. If you only run one process, this will |
| 481 | do the right thing. If you run multiple processes, you can change | 481 | do the right thing. If you run multiple processes, you might need to |
| 482 | `scheme-buffer' to another process buffer with \\[set-variable]. | 482 | set `scheme-buffer' to whichever process buffer you want to use. |
| 483 | 483 | ||
| 484 | More sophisticated approaches are, of course, possible. If you find yourself | 484 | More sophisticated approaches are, of course, possible. If you find yourself |
| 485 | needing to switch back and forth between multiple processes frequently, | 485 | needing to switch back and forth between multiple processes frequently, |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 8de9e89a23d..6642a2082c7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-02-22 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * gnus-registry.el (gnus-registry-save): Provide class name when | ||
| 4 | calling `eieio-persistent-read' to avoid "unsafe call" warning. Use | ||
| 5 | `condition-case' to stay compatible with older EIEIO versions which | ||
| 6 | only accept one argument. | ||
| 7 | |||
| 1 | 2013-02-17 Daiki Ueno <ueno@gnu.org> | 8 | 2013-02-17 Daiki Ueno <ueno@gnu.org> |
| 2 | 9 | ||
| 3 | * mml2015.el (epg-key-user-id-list, epg-user-id-string) | 10 | * mml2015.el (epg-key-user-id-list, epg-user-id-string) |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index e808b1975b4..d4764c08fde 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -296,8 +296,14 @@ This is not required after changing `gnus-registry-cache-file'." | |||
| 296 | (condition-case nil | 296 | (condition-case nil |
| 297 | (progn | 297 | (progn |
| 298 | (gnus-message 5 "Reading Gnus registry from %s..." file) | 298 | (gnus-message 5 "Reading Gnus registry from %s..." file) |
| 299 | (setq gnus-registry-db (gnus-registry-fixup-registry | 299 | (setq gnus-registry-db |
| 300 | (eieio-persistent-read file))) | 300 | (gnus-registry-fixup-registry |
| 301 | (condition-case nil | ||
| 302 | (with-no-warnings | ||
| 303 | (eieio-persistent-read file 'registry-db)) | ||
| 304 | ;; Older EIEIO versions do not check the class name. | ||
| 305 | ('wrong-number-of-arguments | ||
| 306 | (eieio-persistent-read file))))) | ||
| 301 | (gnus-message 5 "Reading Gnus registry from %s...done" file)) | 307 | (gnus-message 5 "Reading Gnus registry from %s...done" file)) |
| 302 | (error | 308 | (error |
| 303 | (gnus-message | 309 | (gnus-message |
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index df8ef86a3cd..768dda993e2 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el | |||
| @@ -717,7 +717,7 @@ STYLE is the inline CSS stylesheet (or tag referring to an external sheet)." | |||
| 717 | --> </script> | 717 | --> </script> |
| 718 | </head> | 718 | </head> |
| 719 | <body onload=\"stripe('index'); return true;\">\n" | 719 | <body onload=\"stripe('index'); return true;\">\n" |
| 720 | file style)) | 720 | (mapconcat 'hfy-html-quote (mapcar 'char-to-string file) "") style)) |
| 721 | 721 | ||
| 722 | (defun hfy-default-footer (_file) | 722 | (defun hfy-default-footer (_file) |
| 723 | "Default value for `hfy-page-footer'. | 723 | "Default value for `hfy-page-footer'. |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 6ae1bb20cdc..ac090f020b3 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -476,11 +476,22 @@ to toggle between display as an image and display as text." | |||
| 476 | ((setq animated (image-multi-frame-p image)) | 476 | ((setq animated (image-multi-frame-p image)) |
| 477 | (setq image-multi-frame t | 477 | (setq image-multi-frame t |
| 478 | mode-line-process | 478 | mode-line-process |
| 479 | `(:eval (propertize | 479 | `(:eval |
| 480 | (format " [%s/%s]" | 480 | (concat " " |
| 481 | (1+ (image-current-frame ',image)) | 481 | (propertize |
| 482 | ,(car animated)) | 482 | (format "[%s/%s]" |
| 483 | 'help-echo "Frame number"))) | 483 | (1+ (image-current-frame ',image)) |
| 484 | ,(car animated)) | ||
| 485 | 'help-echo "Frames | ||
| 486 | mouse-1: Next frame | ||
| 487 | mouse-3: Previous frame" | ||
| 488 | 'mouse-face 'mode-line-highlight | ||
| 489 | 'local-map | ||
| 490 | '(keymap | ||
| 491 | (mode-line | ||
| 492 | keymap | ||
| 493 | (down-mouse-1 . image-next-frame) | ||
| 494 | (down-mouse-3 . image-previous-frame))))))) | ||
| 484 | (message "%s" | 495 | (message "%s" |
| 485 | (concat msg1 "text. This image has multiple frames."))) | 496 | (concat msg1 "text. This image has multiple frames."))) |
| 486 | ;;; (substitute-command-keys | 497 | ;;; (substitute-command-keys |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 31b1918429f..b36b250738a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2961,8 +2961,15 @@ by other Emacs features." | |||
| 2961 | (setq isearch-lazy-highlight-window (selected-window) | 2961 | (setq isearch-lazy-highlight-window (selected-window) |
| 2962 | isearch-lazy-highlight-window-start (window-start) | 2962 | isearch-lazy-highlight-window-start (window-start) |
| 2963 | isearch-lazy-highlight-window-end (window-end) | 2963 | isearch-lazy-highlight-window-end (window-end) |
| 2964 | isearch-lazy-highlight-start (point) | 2964 | ;; Start lazy-highlighting at the beginning of the found |
| 2965 | isearch-lazy-highlight-end (point) | 2965 | ;; match (`isearch-other-end'). If no match, use point. |
| 2966 | ;; One of the next two variables (depending on search direction) | ||
| 2967 | ;; is used to define the starting position of lazy-highlighting | ||
| 2968 | ;; and also to remember the current position of point between | ||
| 2969 | ;; calls of `isearch-lazy-highlight-update', and another variable | ||
| 2970 | ;; is used to define where the wrapped search must stop. | ||
| 2971 | isearch-lazy-highlight-start (or isearch-other-end (point)) | ||
| 2972 | isearch-lazy-highlight-end (or isearch-other-end (point)) | ||
| 2966 | isearch-lazy-highlight-wrapped nil | 2973 | isearch-lazy-highlight-wrapped nil |
| 2967 | isearch-lazy-highlight-last-string isearch-string | 2974 | isearch-lazy-highlight-last-string isearch-string |
| 2968 | isearch-lazy-highlight-case-fold-search isearch-case-fold-search | 2975 | isearch-lazy-highlight-case-fold-search isearch-case-fold-search |
| @@ -3060,6 +3067,9 @@ Attempt to do the search exactly the way the pending Isearch would." | |||
| 3060 | (overlay-put ov 'priority 1000) | 3067 | (overlay-put ov 'priority 1000) |
| 3061 | (overlay-put ov 'face lazy-highlight-face) | 3068 | (overlay-put ov 'face lazy-highlight-face) |
| 3062 | (overlay-put ov 'window (selected-window)))) | 3069 | (overlay-put ov 'window (selected-window)))) |
| 3070 | ;; Remember the current position of point for | ||
| 3071 | ;; the next call of `isearch-lazy-highlight-update' | ||
| 3072 | ;; when `lazy-highlight-max-at-a-time' is too small. | ||
| 3063 | (if isearch-lazy-highlight-forward | 3073 | (if isearch-lazy-highlight-forward |
| 3064 | (setq isearch-lazy-highlight-end (point)) | 3074 | (setq isearch-lazy-highlight-end (point)) |
| 3065 | (setq isearch-lazy-highlight-start (point))))) | 3075 | (setq isearch-lazy-highlight-start (point))))) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 82cbda57086..f2dc514116a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2606,10 +2606,13 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 2606 | (if full-directory-p "yes" "no")) | 2606 | (if full-directory-p "yes" "no")) |
| 2607 | ;; If `full-directory-p', we just say `ls -l FILENAME'. | 2607 | ;; If `full-directory-p', we just say `ls -l FILENAME'. |
| 2608 | ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. | 2608 | ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. |
| 2609 | ;; "--dired" returns byte positions. Therefore, the file names | ||
| 2610 | ;; must be encoded, which is guaranteed by "LC_ALL=en_US.UTF8 | ||
| 2611 | ;; LC_CTYPE=''". | ||
| 2609 | (if full-directory-p | 2612 | (if full-directory-p |
| 2610 | (tramp-send-command | 2613 | (tramp-send-command |
| 2611 | v | 2614 | v |
| 2612 | (format "%s %s %s 2>/dev/null" | 2615 | (format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s 2>/dev/null" |
| 2613 | (tramp-get-ls-command v) | 2616 | (tramp-get-ls-command v) |
| 2614 | switches | 2617 | switches |
| 2615 | (if wildcard | 2618 | (if wildcard |
| @@ -2625,7 +2628,7 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 2625 | (tramp-run-real-handler 'file-name-directory (list localname)))) | 2628 | (tramp-run-real-handler 'file-name-directory (list localname)))) |
| 2626 | (tramp-send-command | 2629 | (tramp-send-command |
| 2627 | v | 2630 | v |
| 2628 | (format "%s %s %s" | 2631 | (format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s" |
| 2629 | (tramp-get-ls-command v) | 2632 | (tramp-get-ls-command v) |
| 2630 | switches | 2633 | switches |
| 2631 | (if (or wildcard | 2634 | (if (or wildcard |
| @@ -2671,6 +2674,11 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 2671 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | 2674 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) |
| 2672 | (replace-match ""))) | 2675 | (replace-match ""))) |
| 2673 | 2676 | ||
| 2677 | ;; Decode the output, it could be multibyte. | ||
| 2678 | (decode-coding-region | ||
| 2679 | beg (point-max) | ||
| 2680 | (or file-name-coding-system default-file-name-coding-system)) | ||
| 2681 | |||
| 2674 | ;; The inserted file could be from somewhere else. | 2682 | ;; The inserted file could be from somewhere else. |
| 2675 | (when (and (not wildcard) (not full-directory-p)) | 2683 | (when (and (not wildcard) (not full-directory-p)) |
| 2676 | (goto-char (point-max)) | 2684 | (goto-char (point-max)) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 4bfe541f053..fe4959715d5 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1166,11 +1166,9 @@ If the `tramp-methods' entry does not exist, return nil." | |||
| 1166 | 1166 | ||
| 1167 | ;;;###tramp-autoload | 1167 | ;;;###tramp-autoload |
| 1168 | (defun tramp-tramp-file-p (name) | 1168 | (defun tramp-tramp-file-p (name) |
| 1169 | "Return t if NAME is a string with Tramp file name syntax. | 1169 | "Return t if NAME is a string with Tramp file name syntax." |
| 1170 | It checks also, whether NAME is unibyte encoded." | ||
| 1171 | (save-match-data | 1170 | (save-match-data |
| 1172 | (and (stringp name) | 1171 | (and (stringp name) |
| 1173 | ; (string-equal name (string-as-unibyte name)) | ||
| 1174 | (string-match tramp-file-name-regexp name)))) | 1172 | (string-match tramp-file-name-regexp name)))) |
| 1175 | 1173 | ||
| 1176 | (defun tramp-find-method (method user host) | 1174 | (defun tramp-find-method (method user host) |
| @@ -1354,7 +1352,7 @@ The outline level is equal to the verbosity of the Tramp message." | |||
| 1354 | (get-buffer-create (tramp-debug-buffer-name vec)) | 1352 | (get-buffer-create (tramp-debug-buffer-name vec)) |
| 1355 | (when (bobp) | 1353 | (when (bobp) |
| 1356 | (setq buffer-undo-list t) | 1354 | (setq buffer-undo-list t) |
| 1357 | ;; So it does not get loaded while outline-regexp is let-bound. | 1355 | ;; So it does not get loaded while `outline-regexp' is let-bound. |
| 1358 | (require 'outline) | 1356 | (require 'outline) |
| 1359 | ;; Activate `outline-mode'. This runs `text-mode-hook' and | 1357 | ;; Activate `outline-mode'. This runs `text-mode-hook' and |
| 1360 | ;; `outline-mode-hook'. We must prevent that local processes | 1358 | ;; `outline-mode-hook'. We must prevent that local processes |
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 069f5a32a9e..d73e9489d7c 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el | |||
| @@ -201,8 +201,8 @@ This process selection is performed by function `inferior-lisp-proc'. | |||
| 201 | Whenever \\[inferior-lisp] fires up a new process, it resets | 201 | Whenever \\[inferior-lisp] fires up a new process, it resets |
| 202 | `inferior-lisp-buffer' to be the new process's buffer. If you only run | 202 | `inferior-lisp-buffer' to be the new process's buffer. If you only run |
| 203 | one process, this does the right thing. If you run multiple | 203 | one process, this does the right thing. If you run multiple |
| 204 | processes, you can change `inferior-lisp-buffer' to another process | 204 | processes, you might need to change `inferior-lisp-buffer' to |
| 205 | buffer with \\[set-variable].") | 205 | whichever process buffer you want to use.") |
| 206 | 206 | ||
| 207 | (defvar inferior-lisp-mode-hook '() | 207 | (defvar inferior-lisp-mode-hook '() |
| 208 | "Hook for customizing Inferior Lisp mode.") | 208 | "Hook for customizing Inferior Lisp mode.") |
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index a32cd969757..9169a433015 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el | |||
| @@ -332,8 +332,8 @@ This process selection is performed by function `inferior-tcl-proc'. | |||
| 332 | Whenever \\[inferior-tcl] fires up a new process, it resets | 332 | Whenever \\[inferior-tcl] fires up a new process, it resets |
| 333 | `inferior-tcl-buffer' to be the new process's buffer. If you only run | 333 | `inferior-tcl-buffer' to be the new process's buffer. If you only run |
| 334 | one process, this does the right thing. If you run multiple | 334 | one process, this does the right thing. If you run multiple |
| 335 | processes, you can change `inferior-tcl-buffer' to another process | 335 | processes, you might need to set `inferior-tcl-buffer' to |
| 336 | buffer with \\[set-variable].") | 336 | whichever process buffer you want to use.") |
| 337 | 337 | ||
| 338 | ;; | 338 | ;; |
| 339 | ;; Hooks and other customization. | 339 | ;; Hooks and other customization. |
diff --git a/lisp/replace.el b/lisp/replace.el index 0b8aaa7d349..7f9ea869333 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -2203,6 +2203,7 @@ make, or the user didn't cancel the call." | |||
| 2203 | replace-regexp-lax-whitespace) | 2203 | replace-regexp-lax-whitespace) |
| 2204 | (isearch-case-fold-search case-fold-search) | 2204 | (isearch-case-fold-search case-fold-search) |
| 2205 | (isearch-forward t) | 2205 | (isearch-forward t) |
| 2206 | (isearch-other-end match-beg) | ||
| 2206 | (isearch-error nil)) | 2207 | (isearch-error nil)) |
| 2207 | (isearch-lazy-highlight-new-loop range-beg range-end)))) | 2208 | (isearch-lazy-highlight-new-loop range-beg range-end)))) |
| 2208 | 2209 | ||
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index dbcf3910db8..50a10dba9a2 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -2602,7 +2602,10 @@ The variable `ispell-highlight-face' selects the face to use for highlighting." | |||
| 2602 | (regexp-quote (buffer-substring-no-properties start end)) | 2602 | (regexp-quote (buffer-substring-no-properties start end)) |
| 2603 | "\\b")) | 2603 | "\\b")) |
| 2604 | (isearch-regexp t) | 2604 | (isearch-regexp t) |
| 2605 | (isearch-case-fold-search nil)) | 2605 | (isearch-case-fold-search nil) |
| 2606 | (isearch-forward t) | ||
| 2607 | (isearch-other-end start) | ||
| 2608 | (isearch-error nil)) | ||
| 2606 | (isearch-lazy-highlight-new-loop | 2609 | (isearch-lazy-highlight-new-loop |
| 2607 | (if (boundp 'reg-start) reg-start) | 2610 | (if (boundp 'reg-start) reg-start) |
| 2608 | (if (boundp 'reg-end) reg-end))) | 2611 | (if (boundp 'reg-end) reg-end))) |
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index b7288772034..fb0dc84b0e1 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -46,9 +46,26 @@ | |||
| 46 | :type 'integer | 46 | :type 'integer |
| 47 | :group 'sgml) | 47 | :group 'sgml) |
| 48 | 48 | ||
| 49 | (defcustom sgml-xml-mode nil | ||
| 50 | "When non-nil, tag insertion functions will be XML-compliant. | ||
| 51 | It is set to be buffer-local when the file has | ||
| 52 | a DOCTYPE or an XML declaration." | ||
| 53 | :type 'boolean | ||
| 54 | :version "22.1" | ||
| 55 | :group 'sgml) | ||
| 56 | |||
| 49 | (defcustom sgml-transformation-function 'identity | 57 | (defcustom sgml-transformation-function 'identity |
| 50 | "Default value for `skeleton-transformation-function' in SGML mode." | 58 | "Default value for `skeleton-transformation-function' in SGML mode." |
| 51 | :type 'function | 59 | :type 'function |
| 60 | :initialize 'custom-initialize-default | ||
| 61 | :set (lambda (sym val) | ||
| 62 | (set-default sym val) | ||
| 63 | (mapc (lambda (buff) | ||
| 64 | (with-current-buffer buff | ||
| 65 | (and (derived-mode-p 'sgml-mode) | ||
| 66 | (not sgml-xml-mode) | ||
| 67 | (setq skeleton-transformation-function val)))) | ||
| 68 | (buffer-list))) | ||
| 52 | :group 'sgml) | 69 | :group 'sgml) |
| 53 | 70 | ||
| 54 | (put 'sgml-transformation-function 'variable-interactive | 71 | (put 'sgml-transformation-function 'variable-interactive |
| @@ -364,14 +381,6 @@ an optional alist of possible values." | |||
| 364 | (string :tag "Description"))) | 381 | (string :tag "Description"))) |
| 365 | :group 'sgml) | 382 | :group 'sgml) |
| 366 | 383 | ||
| 367 | (defcustom sgml-xml-mode nil | ||
| 368 | "When non-nil, tag insertion functions will be XML-compliant. | ||
| 369 | It is set to be buffer-local when the file has | ||
| 370 | a DOCTYPE or an XML declaration." | ||
| 371 | :type 'boolean | ||
| 372 | :version "22.1" | ||
| 373 | :group 'sgml) | ||
| 374 | |||
| 375 | (defvar sgml-empty-tags nil | 384 | (defvar sgml-empty-tags nil |
| 376 | "List of tags whose !ELEMENT definition says EMPTY.") | 385 | "List of tags whose !ELEMENT definition says EMPTY.") |
| 377 | 386 | ||
| @@ -635,10 +644,8 @@ This only works for Latin-1 input." | |||
| 635 | (define-skeleton sgml-tag | 644 | (define-skeleton sgml-tag |
| 636 | "Prompt for a tag and insert it, optionally with attributes. | 645 | "Prompt for a tag and insert it, optionally with attributes. |
| 637 | Completion and configuration are done according to `sgml-tag-alist'. | 646 | Completion and configuration are done according to `sgml-tag-alist'. |
| 638 | If you like tags and attributes in uppercase do \\[set-variable] | 647 | If you like tags and attributes in uppercase, customize |
| 639 | `skeleton-transformation-function' RET `upcase' RET, or put this | 648 | `sgml-transformation-function' to 'upcase." |
| 640 | in your `.emacs': | ||
| 641 | (setq sgml-transformation-function 'upcase)" | ||
| 642 | (funcall (or skeleton-transformation-function 'identity) | 649 | (funcall (or skeleton-transformation-function 'identity) |
| 643 | (setq sgml-tag-last | 650 | (setq sgml-tag-last |
| 644 | (completing-read | 651 | (completing-read |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 480ab8a581a..7b16262233d 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -271,9 +271,7 @@ otherwise the value of `tex-start-options', the \(shell-quoted\) | |||
| 271 | value of `tex-start-commands', and the file name are added at the end | 271 | value of `tex-start-commands', and the file name are added at the end |
| 272 | with blanks as separators. | 272 | with blanks as separators. |
| 273 | 273 | ||
| 274 | In TeX, LaTeX, and SliTeX Mode this variable becomes buffer local. | 274 | In TeX, LaTeX, and SliTeX Mode this variable becomes buffer local.") |
| 275 | In these modes, use \\[set-variable] if you want to change it for the | ||
| 276 | current buffer.") | ||
| 277 | 275 | ||
| 278 | (defvar tex-trailer nil | 276 | (defvar tex-trailer nil |
| 279 | "String appended after the end of a region sent to TeX by \\[tex-region].") | 277 | "String appended after the end of a region sent to TeX by \\[tex-region].") |
diff --git a/src/ChangeLog b/src/ChangeLog index ff45c4b2a83..cc8cb84831a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2013-02-22 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Assume C89 or better. | ||
| 4 | * ralloc.c (SIZE, POINTER, NIL): | ||
| 5 | * vm-limit.c (POINTER): | ||
| 6 | Remove, replacing all uses with C89 equivalents. These old | ||
| 7 | symbols were present only for porting to pre-C89 platforms. | ||
| 8 | |||
| 9 | 2013-02-22 Claudio Bley <claudio.bley@gmail.com> | ||
| 10 | |||
| 11 | * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop. | ||
| 12 | This avoids warning messages reported as part of Bug#13546. | ||
| 13 | |||
| 1 | 2013-02-21 Ken Brown <kbrown@cornell.edu> | 14 | 2013-02-21 Ken Brown <kbrown@cornell.edu> |
| 2 | 15 | ||
| 3 | * sheap.c (report_sheap_usage): Fix arguments of message1_no_log. | 16 | * sheap.c (report_sheap_usage): Fix arguments of message1_no_log. |
diff --git a/src/ralloc.c b/src/ralloc.c index ec1ac40414c..13fd65cbb0c 100644 --- a/src/ralloc.c +++ b/src/ralloc.c | |||
| @@ -52,10 +52,6 @@ extern size_t __malloc_extra_blocks; | |||
| 52 | 52 | ||
| 53 | #include "getpagesize.h" | 53 | #include "getpagesize.h" |
| 54 | 54 | ||
| 55 | typedef size_t SIZE; | ||
| 56 | typedef void *POINTER; | ||
| 57 | #define NIL ((POINTER) 0) | ||
| 58 | |||
| 59 | /* A flag to indicate whether we have initialized ralloc yet. For | 55 | /* A flag to indicate whether we have initialized ralloc yet. For |
| 60 | Emacs's sake, please do not make this local to malloc_init; on some | 56 | Emacs's sake, please do not make this local to malloc_init; on some |
| 61 | machines, the dumping procedure makes all static variables | 57 | machines, the dumping procedure makes all static variables |
| @@ -72,14 +68,14 @@ static void r_alloc_init (void); | |||
| 72 | /* Declarations for working with the malloc, ralloc, and system breaks. */ | 68 | /* Declarations for working with the malloc, ralloc, and system breaks. */ |
| 73 | 69 | ||
| 74 | /* Function to set the real break value. */ | 70 | /* Function to set the real break value. */ |
| 75 | POINTER (*real_morecore) (ptrdiff_t); | 71 | void *(*real_morecore) (ptrdiff_t); |
| 76 | 72 | ||
| 77 | /* The break value, as seen by malloc. */ | 73 | /* The break value, as seen by malloc. */ |
| 78 | static POINTER virtual_break_value; | 74 | static void *virtual_break_value; |
| 79 | 75 | ||
| 80 | /* The address of the end of the last data in use by ralloc, | 76 | /* The address of the end of the last data in use by ralloc, |
| 81 | including relocatable blocs as well as malloc data. */ | 77 | including relocatable blocs as well as malloc data. */ |
| 82 | static POINTER break_value; | 78 | static void *break_value; |
| 83 | 79 | ||
| 84 | /* This is the size of a page. We round memory requests to this boundary. */ | 80 | /* This is the size of a page. We round memory requests to this boundary. */ |
| 85 | static int page_size; | 81 | static int page_size; |
| @@ -92,17 +88,17 @@ static int extra_bytes; | |||
| 92 | by changing the definition of PAGE. */ | 88 | by changing the definition of PAGE. */ |
| 93 | #define PAGE (getpagesize ()) | 89 | #define PAGE (getpagesize ()) |
| 94 | #define ROUNDUP(size) (((size_t) (size) + page_size - 1) \ | 90 | #define ROUNDUP(size) (((size_t) (size) + page_size - 1) \ |
| 95 | & ~((size_t)(page_size - 1))) | 91 | & ~((size_t) (page_size - 1))) |
| 96 | 92 | ||
| 97 | #define MEM_ALIGN sizeof (double) | 93 | #define MEM_ALIGN sizeof (double) |
| 98 | #define MEM_ROUNDUP(addr) (((size_t)(addr) + MEM_ALIGN - 1) \ | 94 | #define MEM_ROUNDUP(addr) (((size_t) (addr) + MEM_ALIGN - 1) \ |
| 99 | & ~(MEM_ALIGN - 1)) | 95 | & ~(MEM_ALIGN - 1)) |
| 100 | 96 | ||
| 101 | /* The hook `malloc' uses for the function which gets more space | 97 | /* The hook `malloc' uses for the function which gets more space |
| 102 | from the system. */ | 98 | from the system. */ |
| 103 | 99 | ||
| 104 | #ifndef SYSTEM_MALLOC | 100 | #ifndef SYSTEM_MALLOC |
| 105 | extern POINTER (*__morecore) (ptrdiff_t); | 101 | extern void *(*__morecore) (ptrdiff_t); |
| 106 | #endif | 102 | #endif |
| 107 | 103 | ||
| 108 | 104 | ||
| @@ -131,13 +127,13 @@ typedef struct heap | |||
| 131 | struct heap *next; | 127 | struct heap *next; |
| 132 | struct heap *prev; | 128 | struct heap *prev; |
| 133 | /* Start of memory range of this heap. */ | 129 | /* Start of memory range of this heap. */ |
| 134 | POINTER start; | 130 | void *start; |
| 135 | /* End of memory range of this heap. */ | 131 | /* End of memory range of this heap. */ |
| 136 | POINTER end; | 132 | void *end; |
| 137 | /* Start of relocatable data in this heap. */ | 133 | /* Start of relocatable data in this heap. */ |
| 138 | POINTER bloc_start; | 134 | void *bloc_start; |
| 139 | /* Start of unused space in this heap. */ | 135 | /* Start of unused space in this heap. */ |
| 140 | POINTER free; | 136 | void *free; |
| 141 | /* First bloc in this heap. */ | 137 | /* First bloc in this heap. */ |
| 142 | struct bp *first_bloc; | 138 | struct bp *first_bloc; |
| 143 | /* Last bloc in this heap. */ | 139 | /* Last bloc in this heap. */ |
| @@ -159,7 +155,7 @@ static heap_ptr first_heap, last_heap; | |||
| 159 | The data blocks abut each other; if b->next is non-nil, then | 155 | The data blocks abut each other; if b->next is non-nil, then |
| 160 | b->data + b->size == b->next->data. | 156 | b->data + b->size == b->next->data. |
| 161 | 157 | ||
| 162 | An element with variable==NIL denotes a freed block, which has not yet | 158 | An element with variable==NULL denotes a freed block, which has not yet |
| 163 | been collected. They may only appear while r_alloc_freeze_level > 0, | 159 | been collected. They may only appear while r_alloc_freeze_level > 0, |
| 164 | and will be freed when the arena is thawed. Currently, these blocs are | 160 | and will be freed when the arena is thawed. Currently, these blocs are |
| 165 | not reusable, while the arena is frozen. Very inefficient. */ | 161 | not reusable, while the arena is frozen. Very inefficient. */ |
| @@ -168,10 +164,10 @@ typedef struct bp | |||
| 168 | { | 164 | { |
| 169 | struct bp *next; | 165 | struct bp *next; |
| 170 | struct bp *prev; | 166 | struct bp *prev; |
| 171 | POINTER *variable; | 167 | void **variable; |
| 172 | POINTER data; | 168 | void *data; |
| 173 | SIZE size; | 169 | size_t size; |
| 174 | POINTER new_data; /* temporarily used for relocation */ | 170 | void *new_data; /* temporarily used for relocation */ |
| 175 | struct heap *heap; /* Heap this bloc is in. */ | 171 | struct heap *heap; /* Heap this bloc is in. */ |
| 176 | } *bloc_ptr; | 172 | } *bloc_ptr; |
| 177 | 173 | ||
| @@ -192,7 +188,7 @@ static int r_alloc_freeze_level; | |||
| 192 | /* Find the heap that ADDRESS falls within. */ | 188 | /* Find the heap that ADDRESS falls within. */ |
| 193 | 189 | ||
| 194 | static heap_ptr | 190 | static heap_ptr |
| 195 | find_heap (POINTER address) | 191 | find_heap (void *address) |
| 196 | { | 192 | { |
| 197 | heap_ptr heap; | 193 | heap_ptr heap; |
| 198 | 194 | ||
| @@ -223,11 +219,11 @@ find_heap (POINTER address) | |||
| 223 | Return the address of the space if all went well, or zero if we couldn't | 219 | Return the address of the space if all went well, or zero if we couldn't |
| 224 | allocate the memory. */ | 220 | allocate the memory. */ |
| 225 | 221 | ||
| 226 | static POINTER | 222 | static void * |
| 227 | obtain (POINTER address, SIZE size) | 223 | obtain (void *address, size_t size) |
| 228 | { | 224 | { |
| 229 | heap_ptr heap; | 225 | heap_ptr heap; |
| 230 | SIZE already_available; | 226 | size_t already_available; |
| 231 | 227 | ||
| 232 | /* Find the heap that ADDRESS falls within. */ | 228 | /* Find the heap that ADDRESS falls within. */ |
| 233 | for (heap = last_heap; heap; heap = heap->prev) | 229 | for (heap = last_heap; heap; heap = heap->prev) |
| @@ -253,19 +249,19 @@ obtain (POINTER address, SIZE size) | |||
| 253 | get more space. */ | 249 | get more space. */ |
| 254 | if (heap == NIL_HEAP) | 250 | if (heap == NIL_HEAP) |
| 255 | { | 251 | { |
| 256 | POINTER new = (*real_morecore)(0); | 252 | void *new = real_morecore (0); |
| 257 | SIZE get; | 253 | size_t get; |
| 258 | 254 | ||
| 259 | already_available = (char *)last_heap->end - (char *)address; | 255 | already_available = (char *) last_heap->end - (char *) address; |
| 260 | 256 | ||
| 261 | if (new != last_heap->end) | 257 | if (new != last_heap->end) |
| 262 | { | 258 | { |
| 263 | /* Someone else called sbrk. Make a new heap. */ | 259 | /* Someone else called sbrk. Make a new heap. */ |
| 264 | 260 | ||
| 265 | heap_ptr new_heap = (heap_ptr) MEM_ROUNDUP (new); | 261 | heap_ptr new_heap = (heap_ptr) MEM_ROUNDUP (new); |
| 266 | POINTER bloc_start = (POINTER) MEM_ROUNDUP ((POINTER)(new_heap + 1)); | 262 | void *bloc_start = (void *) MEM_ROUNDUP ((void *) (new_heap + 1)); |
| 267 | 263 | ||
| 268 | if ((*real_morecore) ((char *) bloc_start - (char *) new) != new) | 264 | if (real_morecore ((char *) bloc_start - (char *) new) != new) |
| 269 | return 0; | 265 | return 0; |
| 270 | 266 | ||
| 271 | new_heap->start = new; | 267 | new_heap->start = new; |
| @@ -287,10 +283,10 @@ obtain (POINTER address, SIZE size) | |||
| 287 | Get some extra, so we can come here less often. */ | 283 | Get some extra, so we can come here less often. */ |
| 288 | 284 | ||
| 289 | get = size + extra_bytes - already_available; | 285 | get = size + extra_bytes - already_available; |
| 290 | get = (char *) ROUNDUP ((char *)last_heap->end + get) | 286 | get = (char *) ROUNDUP ((char *) last_heap->end + get) |
| 291 | - (char *) last_heap->end; | 287 | - (char *) last_heap->end; |
| 292 | 288 | ||
| 293 | if ((*real_morecore) (get) != last_heap->end) | 289 | if (real_morecore (get) != last_heap->end) |
| 294 | return 0; | 290 | return 0; |
| 295 | 291 | ||
| 296 | last_heap->end = (char *) last_heap->end + get; | 292 | last_heap->end = (char *) last_heap->end + get; |
| @@ -319,13 +315,13 @@ relinquish (void) | |||
| 319 | ? h->bloc_start : break_value); | 315 | ? h->bloc_start : break_value); |
| 320 | } | 316 | } |
| 321 | 317 | ||
| 322 | if (excess > extra_bytes * 2 && (*real_morecore) (0) == last_heap->end) | 318 | if (excess > extra_bytes * 2 && real_morecore (0) == last_heap->end) |
| 323 | { | 319 | { |
| 324 | /* Keep extra_bytes worth of empty space. | 320 | /* Keep extra_bytes worth of empty space. |
| 325 | And don't free anything unless we can free at least extra_bytes. */ | 321 | And don't free anything unless we can free at least extra_bytes. */ |
| 326 | excess -= extra_bytes; | 322 | excess -= extra_bytes; |
| 327 | 323 | ||
| 328 | if ((char *)last_heap->end - (char *)last_heap->bloc_start <= excess) | 324 | if ((char *) last_heap->end - (char *) last_heap->bloc_start <= excess) |
| 329 | { | 325 | { |
| 330 | heap_ptr lh_prev; | 326 | heap_ptr lh_prev; |
| 331 | 327 | ||
| @@ -336,12 +332,12 @@ relinquish (void) | |||
| 336 | return; | 332 | return; |
| 337 | 333 | ||
| 338 | /* Return the last heap, with its header, to the system. */ | 334 | /* Return the last heap, with its header, to the system. */ |
| 339 | excess = (char *)last_heap->end - (char *)last_heap->start; | 335 | excess = (char *) last_heap->end - (char *) last_heap->start; |
| 340 | lh_prev = last_heap->prev; | 336 | lh_prev = last_heap->prev; |
| 341 | /* If the system doesn't want that much memory back, leave | 337 | /* If the system doesn't want that much memory back, leave |
| 342 | last_heap unaltered to reflect that. This can occur if | 338 | last_heap unaltered to reflect that. This can occur if |
| 343 | break_value is still within the original data segment. */ | 339 | break_value is still within the original data segment. */ |
| 344 | if ((*real_morecore) (- excess) != 0) | 340 | if (real_morecore (- excess) != 0) |
| 345 | { | 341 | { |
| 346 | last_heap = lh_prev; | 342 | last_heap = lh_prev; |
| 347 | last_heap->next = NIL_HEAP; | 343 | last_heap->next = NIL_HEAP; |
| @@ -349,13 +345,13 @@ relinquish (void) | |||
| 349 | } | 345 | } |
| 350 | else | 346 | else |
| 351 | { | 347 | { |
| 352 | excess = (char *) last_heap->end | 348 | excess = ((char *) last_heap->end |
| 353 | - (char *) ROUNDUP ((char *)last_heap->end - excess); | 349 | - (char *) ROUNDUP ((char *) last_heap->end - excess)); |
| 354 | /* If the system doesn't want that much memory back, leave | 350 | /* If the system doesn't want that much memory back, leave |
| 355 | the end of the last heap unchanged to reflect that. This | 351 | the end of the last heap unchanged to reflect that. This |
| 356 | can occur if break_value is still within the original | 352 | can occur if break_value is still within the original |
| 357 | data segment. */ | 353 | data segment. */ |
| 358 | if ((*real_morecore) (- excess) != 0) | 354 | if (real_morecore (- excess) != 0) |
| 359 | last_heap->end = (char *) last_heap->end - excess; | 355 | last_heap->end = (char *) last_heap->end - excess; |
| 360 | } | 356 | } |
| 361 | } | 357 | } |
| @@ -367,9 +363,9 @@ relinquish (void) | |||
| 367 | to that block. */ | 363 | to that block. */ |
| 368 | 364 | ||
| 369 | static bloc_ptr | 365 | static bloc_ptr |
| 370 | find_bloc (POINTER *ptr) | 366 | find_bloc (void **ptr) |
| 371 | { | 367 | { |
| 372 | register bloc_ptr p = first_bloc; | 368 | bloc_ptr p = first_bloc; |
| 373 | 369 | ||
| 374 | while (p != NIL_BLOC) | 370 | while (p != NIL_BLOC) |
| 375 | { | 371 | { |
| @@ -392,10 +388,10 @@ find_bloc (POINTER *ptr) | |||
| 392 | memory for the new block. */ | 388 | memory for the new block. */ |
| 393 | 389 | ||
| 394 | static bloc_ptr | 390 | static bloc_ptr |
| 395 | get_bloc (SIZE size) | 391 | get_bloc (size_t size) |
| 396 | { | 392 | { |
| 397 | register bloc_ptr new_bloc; | 393 | bloc_ptr new_bloc; |
| 398 | register heap_ptr heap; | 394 | heap_ptr heap; |
| 399 | 395 | ||
| 400 | if (! (new_bloc = malloc (BLOC_PTR_SIZE)) | 396 | if (! (new_bloc = malloc (BLOC_PTR_SIZE)) |
| 401 | || ! (new_bloc->data = obtain (break_value, size))) | 397 | || ! (new_bloc->data = obtain (break_value, size))) |
| @@ -409,7 +405,7 @@ get_bloc (SIZE size) | |||
| 409 | 405 | ||
| 410 | new_bloc->size = size; | 406 | new_bloc->size = size; |
| 411 | new_bloc->next = NIL_BLOC; | 407 | new_bloc->next = NIL_BLOC; |
| 412 | new_bloc->variable = (POINTER *) NIL; | 408 | new_bloc->variable = NULL; |
| 413 | new_bloc->new_data = 0; | 409 | new_bloc->new_data = 0; |
| 414 | 410 | ||
| 415 | /* Record in the heap that this space is in use. */ | 411 | /* Record in the heap that this space is in use. */ |
| @@ -447,9 +443,9 @@ get_bloc (SIZE size) | |||
| 447 | Do not touch the contents of blocs or break_value. */ | 443 | Do not touch the contents of blocs or break_value. */ |
| 448 | 444 | ||
| 449 | static int | 445 | static int |
| 450 | relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address) | 446 | relocate_blocs (bloc_ptr bloc, heap_ptr heap, void *address) |
| 451 | { | 447 | { |
| 452 | register bloc_ptr b = bloc; | 448 | bloc_ptr b = bloc; |
| 453 | 449 | ||
| 454 | /* No need to ever call this if arena is frozen, bug somewhere! */ | 450 | /* No need to ever call this if arena is frozen, bug somewhere! */ |
| 455 | if (r_alloc_freeze_level) | 451 | if (r_alloc_freeze_level) |
| @@ -471,8 +467,8 @@ relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address) | |||
| 471 | get enough new space to hold BLOC and all following blocs. */ | 467 | get enough new space to hold BLOC and all following blocs. */ |
| 472 | if (heap == NIL_HEAP) | 468 | if (heap == NIL_HEAP) |
| 473 | { | 469 | { |
| 474 | register bloc_ptr tb = b; | 470 | bloc_ptr tb = b; |
| 475 | register SIZE s = 0; | 471 | size_t s = 0; |
| 476 | 472 | ||
| 477 | /* Add up the size of all the following blocs. */ | 473 | /* Add up the size of all the following blocs. */ |
| 478 | while (tb != NIL_BLOC) | 474 | while (tb != NIL_BLOC) |
| @@ -568,12 +564,12 @@ update_heap_bloc_correspondence (bloc_ptr bloc, heap_ptr heap) | |||
| 568 | that come after BLOC in memory. */ | 564 | that come after BLOC in memory. */ |
| 569 | 565 | ||
| 570 | static int | 566 | static int |
| 571 | resize_bloc (bloc_ptr bloc, SIZE size) | 567 | resize_bloc (bloc_ptr bloc, size_t size) |
| 572 | { | 568 | { |
| 573 | register bloc_ptr b; | 569 | bloc_ptr b; |
| 574 | heap_ptr heap; | 570 | heap_ptr heap; |
| 575 | POINTER address; | 571 | void *address; |
| 576 | SIZE old_size; | 572 | size_t old_size; |
| 577 | 573 | ||
| 578 | /* No need to ever call this if arena is frozen, bug somewhere! */ | 574 | /* No need to ever call this if arena is frozen, bug somewhere! */ |
| 579 | if (r_alloc_freeze_level) | 575 | if (r_alloc_freeze_level) |
| @@ -675,7 +671,7 @@ free_bloc (bloc_ptr bloc) | |||
| 675 | 671 | ||
| 676 | if (r_alloc_freeze_level) | 672 | if (r_alloc_freeze_level) |
| 677 | { | 673 | { |
| 678 | bloc->variable = (POINTER *) NIL; | 674 | bloc->variable = NULL; |
| 679 | return; | 675 | return; |
| 680 | } | 676 | } |
| 681 | 677 | ||
| @@ -752,17 +748,17 @@ free_bloc (bloc_ptr bloc) | |||
| 752 | __morecore hook values - in particular, __default_morecore in the | 748 | __morecore hook values - in particular, __default_morecore in the |
| 753 | GNU malloc package. */ | 749 | GNU malloc package. */ |
| 754 | 750 | ||
| 755 | static POINTER | 751 | static void * |
| 756 | r_alloc_sbrk (ptrdiff_t size) | 752 | r_alloc_sbrk (ptrdiff_t size) |
| 757 | { | 753 | { |
| 758 | register bloc_ptr b; | 754 | bloc_ptr b; |
| 759 | POINTER address; | 755 | void *address; |
| 760 | 756 | ||
| 761 | if (! r_alloc_initialized) | 757 | if (! r_alloc_initialized) |
| 762 | r_alloc_init (); | 758 | r_alloc_init (); |
| 763 | 759 | ||
| 764 | if (use_relocatable_buffers <= 0) | 760 | if (use_relocatable_buffers <= 0) |
| 765 | return (*real_morecore) (size); | 761 | return real_morecore (size); |
| 766 | 762 | ||
| 767 | if (size == 0) | 763 | if (size == 0) |
| 768 | return virtual_break_value; | 764 | return virtual_break_value; |
| @@ -772,19 +768,19 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 772 | /* Allocate a page-aligned space. GNU malloc would reclaim an | 768 | /* Allocate a page-aligned space. GNU malloc would reclaim an |
| 773 | extra space if we passed an unaligned one. But we could | 769 | extra space if we passed an unaligned one. But we could |
| 774 | not always find a space which is contiguous to the previous. */ | 770 | not always find a space which is contiguous to the previous. */ |
| 775 | POINTER new_bloc_start; | 771 | void *new_bloc_start; |
| 776 | heap_ptr h = first_heap; | 772 | heap_ptr h = first_heap; |
| 777 | SIZE get = ROUNDUP (size); | 773 | size_t get = ROUNDUP (size); |
| 778 | 774 | ||
| 779 | address = (POINTER) ROUNDUP (virtual_break_value); | 775 | address = (void *) ROUNDUP (virtual_break_value); |
| 780 | 776 | ||
| 781 | /* Search the list upward for a heap which is large enough. */ | 777 | /* Search the list upward for a heap which is large enough. */ |
| 782 | while ((char *) h->end < (char *) MEM_ROUNDUP ((char *)address + get)) | 778 | while ((char *) h->end < (char *) MEM_ROUNDUP ((char *) address + get)) |
| 783 | { | 779 | { |
| 784 | h = h->next; | 780 | h = h->next; |
| 785 | if (h == NIL_HEAP) | 781 | if (h == NIL_HEAP) |
| 786 | break; | 782 | break; |
| 787 | address = (POINTER) ROUNDUP (h->start); | 783 | address = (void *) ROUNDUP (h->start); |
| 788 | } | 784 | } |
| 789 | 785 | ||
| 790 | /* If not found, obtain more space. */ | 786 | /* If not found, obtain more space. */ |
| @@ -796,19 +792,19 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 796 | return 0; | 792 | return 0; |
| 797 | 793 | ||
| 798 | if (first_heap == last_heap) | 794 | if (first_heap == last_heap) |
| 799 | address = (POINTER) ROUNDUP (virtual_break_value); | 795 | address = (void *) ROUNDUP (virtual_break_value); |
| 800 | else | 796 | else |
| 801 | address = (POINTER) ROUNDUP (last_heap->start); | 797 | address = (void *) ROUNDUP (last_heap->start); |
| 802 | h = last_heap; | 798 | h = last_heap; |
| 803 | } | 799 | } |
| 804 | 800 | ||
| 805 | new_bloc_start = (POINTER) MEM_ROUNDUP ((char *)address + get); | 801 | new_bloc_start = (void *) MEM_ROUNDUP ((char *) address + get); |
| 806 | 802 | ||
| 807 | if (first_heap->bloc_start < new_bloc_start) | 803 | if (first_heap->bloc_start < new_bloc_start) |
| 808 | { | 804 | { |
| 809 | /* This is no clean solution - no idea how to do it better. */ | 805 | /* This is no clean solution - no idea how to do it better. */ |
| 810 | if (r_alloc_freeze_level) | 806 | if (r_alloc_freeze_level) |
| 811 | return NIL; | 807 | return NULL; |
| 812 | 808 | ||
| 813 | /* There is a bug here: if the above obtain call succeeded, but the | 809 | /* There is a bug here: if the above obtain call succeeded, but the |
| 814 | relocate_blocs call below does not succeed, we need to free | 810 | relocate_blocs call below does not succeed, we need to free |
| @@ -818,7 +814,7 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 818 | if (! relocate_blocs (first_bloc, h, new_bloc_start)) | 814 | if (! relocate_blocs (first_bloc, h, new_bloc_start)) |
| 819 | return 0; | 815 | return 0; |
| 820 | 816 | ||
| 821 | /* Note that (POINTER)(h+1) <= new_bloc_start since | 817 | /* Note that (char *) (h + 1) <= (char *) new_bloc_start since |
| 822 | get >= page_size, so the following does not destroy the heap | 818 | get >= page_size, so the following does not destroy the heap |
| 823 | header. */ | 819 | header. */ |
| 824 | for (b = last_bloc; b != NIL_BLOC; b = b->prev) | 820 | for (b = last_bloc; b != NIL_BLOC; b = b->prev) |
| @@ -855,8 +851,8 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 855 | } | 851 | } |
| 856 | else /* size < 0 */ | 852 | else /* size < 0 */ |
| 857 | { | 853 | { |
| 858 | SIZE excess = (char *)first_heap->bloc_start | 854 | size_t excess = ((char *) first_heap->bloc_start |
| 859 | - ((char *)virtual_break_value + size); | 855 | - ((char *) virtual_break_value + size)); |
| 860 | 856 | ||
| 861 | address = virtual_break_value; | 857 | address = virtual_break_value; |
| 862 | 858 | ||
| @@ -864,7 +860,7 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 864 | { | 860 | { |
| 865 | excess -= extra_bytes; | 861 | excess -= extra_bytes; |
| 866 | first_heap->bloc_start | 862 | first_heap->bloc_start |
| 867 | = (POINTER) MEM_ROUNDUP ((char *)first_heap->bloc_start - excess); | 863 | = (void *) MEM_ROUNDUP ((char *) first_heap->bloc_start - excess); |
| 868 | 864 | ||
| 869 | relocate_blocs (first_bloc, first_heap, first_heap->bloc_start); | 865 | relocate_blocs (first_bloc, first_heap, first_heap->bloc_start); |
| 870 | 866 | ||
| @@ -876,14 +872,14 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 876 | } | 872 | } |
| 877 | } | 873 | } |
| 878 | 874 | ||
| 879 | if ((char *)virtual_break_value + size < (char *)first_heap->start) | 875 | if ((char *) virtual_break_value + size < (char *) first_heap->start) |
| 880 | { | 876 | { |
| 881 | /* We found an additional space below the first heap */ | 877 | /* We found an additional space below the first heap */ |
| 882 | first_heap->start = (POINTER) ((char *)virtual_break_value + size); | 878 | first_heap->start = (void *) ((char *) virtual_break_value + size); |
| 883 | } | 879 | } |
| 884 | } | 880 | } |
| 885 | 881 | ||
| 886 | virtual_break_value = (POINTER) ((char *)address + size); | 882 | virtual_break_value = (void *) ((char *) address + size); |
| 887 | break_value = (last_bloc | 883 | break_value = (last_bloc |
| 888 | ? (char *) last_bloc->data + last_bloc->size | 884 | ? (char *) last_bloc->data + last_bloc->size |
| 889 | : (char *) first_heap->bloc_start); | 885 | : (char *) first_heap->bloc_start); |
| @@ -905,10 +901,10 @@ r_alloc_sbrk (ptrdiff_t size) | |||
| 905 | If we can't allocate the necessary memory, set *PTR to zero, and | 901 | If we can't allocate the necessary memory, set *PTR to zero, and |
| 906 | return zero. */ | 902 | return zero. */ |
| 907 | 903 | ||
| 908 | POINTER | 904 | void * |
| 909 | r_alloc (POINTER *ptr, SIZE size) | 905 | r_alloc (void **ptr, size_t size) |
| 910 | { | 906 | { |
| 911 | register bloc_ptr new_bloc; | 907 | bloc_ptr new_bloc; |
| 912 | 908 | ||
| 913 | if (! r_alloc_initialized) | 909 | if (! r_alloc_initialized) |
| 914 | r_alloc_init (); | 910 | r_alloc_init (); |
| @@ -929,9 +925,9 @@ r_alloc (POINTER *ptr, SIZE size) | |||
| 929 | Store 0 in *PTR to show there's no block allocated. */ | 925 | Store 0 in *PTR to show there's no block allocated. */ |
| 930 | 926 | ||
| 931 | void | 927 | void |
| 932 | r_alloc_free (register POINTER *ptr) | 928 | r_alloc_free (void **ptr) |
| 933 | { | 929 | { |
| 934 | register bloc_ptr dead_bloc; | 930 | bloc_ptr dead_bloc; |
| 935 | 931 | ||
| 936 | if (! r_alloc_initialized) | 932 | if (! r_alloc_initialized) |
| 937 | r_alloc_init (); | 933 | r_alloc_init (); |
| @@ -962,10 +958,10 @@ r_alloc_free (register POINTER *ptr) | |||
| 962 | If more memory cannot be allocated, then leave *PTR unchanged, and | 958 | If more memory cannot be allocated, then leave *PTR unchanged, and |
| 963 | return zero. */ | 959 | return zero. */ |
| 964 | 960 | ||
| 965 | POINTER | 961 | void * |
| 966 | r_re_alloc (POINTER *ptr, SIZE size) | 962 | r_re_alloc (void **ptr, size_t size) |
| 967 | { | 963 | { |
| 968 | register bloc_ptr bloc; | 964 | bloc_ptr bloc; |
| 969 | 965 | ||
| 970 | if (! r_alloc_initialized) | 966 | if (! r_alloc_initialized) |
| 971 | r_alloc_init (); | 967 | r_alloc_init (); |
| @@ -1004,15 +1000,15 @@ r_re_alloc (POINTER *ptr, SIZE size) | |||
| 1004 | { | 1000 | { |
| 1005 | new_bloc->variable = ptr; | 1001 | new_bloc->variable = ptr; |
| 1006 | *ptr = new_bloc->data; | 1002 | *ptr = new_bloc->data; |
| 1007 | bloc->variable = (POINTER *) NIL; | 1003 | bloc->variable = NULL; |
| 1008 | } | 1004 | } |
| 1009 | else | 1005 | else |
| 1010 | return NIL; | 1006 | return NULL; |
| 1011 | } | 1007 | } |
| 1012 | else | 1008 | else |
| 1013 | { | 1009 | { |
| 1014 | if (! resize_bloc (bloc, MEM_ROUNDUP (size))) | 1010 | if (! resize_bloc (bloc, MEM_ROUNDUP (size))) |
| 1015 | return NIL; | 1011 | return NULL; |
| 1016 | } | 1012 | } |
| 1017 | } | 1013 | } |
| 1018 | return *ptr; | 1014 | return *ptr; |
| @@ -1052,27 +1048,27 @@ r_alloc_check (void) | |||
| 1052 | return; | 1048 | return; |
| 1053 | 1049 | ||
| 1054 | assert (first_heap); | 1050 | assert (first_heap); |
| 1055 | assert (last_heap->end <= (POINTER) sbrk (0)); | 1051 | assert (last_heap->end <= (void *) sbrk (0)); |
| 1056 | assert ((POINTER) first_heap < first_heap->start); | 1052 | assert ((void *) first_heap < first_heap->start); |
| 1057 | assert (first_heap->start <= virtual_break_value); | 1053 | assert (first_heap->start <= virtual_break_value); |
| 1058 | assert (virtual_break_value <= first_heap->end); | 1054 | assert (virtual_break_value <= first_heap->end); |
| 1059 | 1055 | ||
| 1060 | for (h = first_heap; h; h = h->next) | 1056 | for (h = first_heap; h; h = h->next) |
| 1061 | { | 1057 | { |
| 1062 | assert (h->prev == ph); | 1058 | assert (h->prev == ph); |
| 1063 | assert ((POINTER) ROUNDUP (h->end) == h->end); | 1059 | assert ((void *) ROUNDUP (h->end) == h->end); |
| 1064 | #if 0 /* ??? The code in ralloc.c does not really try to ensure | 1060 | #if 0 /* ??? The code in ralloc.c does not really try to ensure |
| 1065 | the heap start has any sort of alignment. | 1061 | the heap start has any sort of alignment. |
| 1066 | Perhaps it should. */ | 1062 | Perhaps it should. */ |
| 1067 | assert ((POINTER) MEM_ROUNDUP (h->start) == h->start); | 1063 | assert ((void *) MEM_ROUNDUP (h->start) == h->start); |
| 1068 | #endif | 1064 | #endif |
| 1069 | assert ((POINTER) MEM_ROUNDUP (h->bloc_start) == h->bloc_start); | 1065 | assert ((void *) MEM_ROUNDUP (h->bloc_start) == h->bloc_start); |
| 1070 | assert (h->start <= h->bloc_start && h->bloc_start <= h->end); | 1066 | assert (h->start <= h->bloc_start && h->bloc_start <= h->end); |
| 1071 | 1067 | ||
| 1072 | if (ph) | 1068 | if (ph) |
| 1073 | { | 1069 | { |
| 1074 | assert (ph->end < h->start); | 1070 | assert (ph->end < h->start); |
| 1075 | assert (h->start <= (POINTER)h && (POINTER)(h+1) <= h->bloc_start); | 1071 | assert (h->start <= (void *) h && (void *) (h + 1) <= h->bloc_start); |
| 1076 | } | 1072 | } |
| 1077 | 1073 | ||
| 1078 | if (h->bloc_start <= break_value && break_value <= h->end) | 1074 | if (h->bloc_start <= break_value && break_value <= h->end) |
| @@ -1087,8 +1083,8 @@ r_alloc_check (void) | |||
| 1087 | for (b = first_bloc; b; b = b->next) | 1083 | for (b = first_bloc; b; b = b->next) |
| 1088 | { | 1084 | { |
| 1089 | assert (b->prev == pb); | 1085 | assert (b->prev == pb); |
| 1090 | assert ((POINTER) MEM_ROUNDUP (b->data) == b->data); | 1086 | assert ((void *) MEM_ROUNDUP (b->data) == b->data); |
| 1091 | assert ((SIZE) MEM_ROUNDUP (b->size) == b->size); | 1087 | assert ((size_t) MEM_ROUNDUP (b->size) == b->size); |
| 1092 | 1088 | ||
| 1093 | ph = 0; | 1089 | ph = 0; |
| 1094 | for (h = first_heap; h; h = h->next) | 1090 | for (h = first_heap; h; h = h->next) |
| @@ -1137,7 +1133,7 @@ r_alloc_check (void) | |||
| 1137 | is checked to ensure that memory corruption does not occur due to | 1133 | is checked to ensure that memory corruption does not occur due to |
| 1138 | misuse. */ | 1134 | misuse. */ |
| 1139 | void | 1135 | void |
| 1140 | r_alloc_reset_variable (POINTER *old, POINTER *new) | 1136 | r_alloc_reset_variable (void **old, void **new) |
| 1141 | { | 1137 | { |
| 1142 | bloc_ptr bloc = first_bloc; | 1138 | bloc_ptr bloc = first_bloc; |
| 1143 | 1139 | ||
| @@ -1192,8 +1188,8 @@ r_alloc_init (void) | |||
| 1192 | first_heap = last_heap = &heap_base; | 1188 | first_heap = last_heap = &heap_base; |
| 1193 | first_heap->next = first_heap->prev = NIL_HEAP; | 1189 | first_heap->next = first_heap->prev = NIL_HEAP; |
| 1194 | first_heap->start = first_heap->bloc_start | 1190 | first_heap->start = first_heap->bloc_start |
| 1195 | = virtual_break_value = break_value = (*real_morecore) (0); | 1191 | = virtual_break_value = break_value = real_morecore (0); |
| 1196 | if (break_value == NIL) | 1192 | if (break_value == NULL) |
| 1197 | emacs_abort (); | 1193 | emacs_abort (); |
| 1198 | 1194 | ||
| 1199 | extra_bytes = ROUNDUP (50000); | 1195 | extra_bytes = ROUNDUP (50000); |
| @@ -1218,7 +1214,7 @@ r_alloc_init (void) | |||
| 1218 | #endif | 1214 | #endif |
| 1219 | 1215 | ||
| 1220 | #ifndef SYSTEM_MALLOC | 1216 | #ifndef SYSTEM_MALLOC |
| 1221 | first_heap->end = (POINTER) ROUNDUP (first_heap->start); | 1217 | first_heap->end = (void *) ROUNDUP (first_heap->start); |
| 1222 | 1218 | ||
| 1223 | /* The extra call to real_morecore guarantees that the end of the | 1219 | /* The extra call to real_morecore guarantees that the end of the |
| 1224 | address space is a multiple of page_size, even if page_size is | 1220 | address space is a multiple of page_size, even if page_size is |
| @@ -1226,7 +1222,7 @@ r_alloc_init (void) | |||
| 1226 | which page_size is stored. This allows a binary to be built on a | 1222 | which page_size is stored. This allows a binary to be built on a |
| 1227 | system with one page size and run on a system with a smaller page | 1223 | system with one page size and run on a system with a smaller page |
| 1228 | size. */ | 1224 | size. */ |
| 1229 | (*real_morecore) ((char *) first_heap->end - (char *) first_heap->start); | 1225 | real_morecore ((char *) first_heap->end - (char *) first_heap->start); |
| 1230 | 1226 | ||
| 1231 | /* Clear the rest of the last page; this memory is in our address space | 1227 | /* Clear the rest of the last page; this memory is in our address space |
| 1232 | even though it is after the sbrk value. */ | 1228 | even though it is after the sbrk value. */ |
diff --git a/src/vm-limit.c b/src/vm-limit.c index 9dbb1b884b7..fc7a253325a 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c | |||
| @@ -31,14 +31,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 31 | enum warnlevel { not_warned, warned_75, warned_85, warned_95 }; | 31 | enum warnlevel { not_warned, warned_75, warned_85, warned_95 }; |
| 32 | static enum warnlevel warnlevel; | 32 | static enum warnlevel warnlevel; |
| 33 | 33 | ||
| 34 | typedef void *POINTER; | ||
| 35 | |||
| 36 | /* Function to call to issue a warning; | 34 | /* Function to call to issue a warning; |
| 37 | 0 means don't issue them. */ | 35 | 0 means don't issue them. */ |
| 38 | static void (*warn_function) (const char *); | 36 | static void (*warn_function) (const char *); |
| 39 | 37 | ||
| 40 | /* Start of data space; can be changed by calling malloc_init. */ | 38 | /* Start of data space; can be changed by calling malloc_init. */ |
| 41 | static POINTER data_space_start; | 39 | static void *data_space_start; |
| 42 | 40 | ||
| 43 | /* Number of bytes of writable memory we can expect to be able to get. */ | 41 | /* Number of bytes of writable memory we can expect to be able to get. */ |
| 44 | static size_t lim_data; | 42 | static size_t lim_data; |
| @@ -123,11 +121,11 @@ static void | |||
| 123 | check_memory_limits (void) | 121 | check_memory_limits (void) |
| 124 | { | 122 | { |
| 125 | #ifdef REL_ALLOC | 123 | #ifdef REL_ALLOC |
| 126 | extern POINTER (*real_morecore) (ptrdiff_t); | 124 | extern void *(*real_morecore) (ptrdiff_t); |
| 127 | #endif | 125 | #endif |
| 128 | extern POINTER (*__morecore) (ptrdiff_t); | 126 | extern void *(*__morecore) (ptrdiff_t); |
| 129 | 127 | ||
| 130 | register POINTER cp; | 128 | void *cp; |
| 131 | size_t five_percent; | 129 | size_t five_percent; |
| 132 | size_t data_size; | 130 | size_t data_size; |
| 133 | enum warnlevel new_warnlevel; | 131 | enum warnlevel new_warnlevel; |
| @@ -215,9 +213,9 @@ start_of_data (void) | |||
| 215 | { | 213 | { |
| 216 | #ifdef BSD_SYSTEM | 214 | #ifdef BSD_SYSTEM |
| 217 | extern char etext; | 215 | extern char etext; |
| 218 | return (POINTER)(&etext); | 216 | return (void *) &etext; |
| 219 | #elif defined DATA_START | 217 | #elif defined DATA_START |
| 220 | return ((POINTER) DATA_START); | 218 | return (void *) DATA_START; |
| 221 | #elif defined ORDINARY_LINK | 219 | #elif defined ORDINARY_LINK |
| 222 | /* | 220 | /* |
| 223 | * This is a hack. Since we're not linking crt0.c or pre_crt0.c, | 221 | * This is a hack. Since we're not linking crt0.c or pre_crt0.c, |
| @@ -225,10 +223,10 @@ start_of_data (void) | |||
| 225 | * is known to live at or near the start of the system crt0.c, and | 223 | * is known to live at or near the start of the system crt0.c, and |
| 226 | * we don't sweat the handful of bytes that might lose. | 224 | * we don't sweat the handful of bytes that might lose. |
| 227 | */ | 225 | */ |
| 228 | return ((POINTER) &environ); | 226 | return (void *) &environ; |
| 229 | #else | 227 | #else |
| 230 | extern int data_start; | 228 | extern int data_start; |
| 231 | return ((POINTER) &data_start); | 229 | return (void *) &data_start; |
| 232 | #endif | 230 | #endif |
| 233 | } | 231 | } |
| 234 | #endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */ | 232 | #endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */ |
| @@ -238,7 +236,7 @@ start_of_data (void) | |||
| 238 | WARNFUN specifies the function to call to issue a warning. */ | 236 | WARNFUN specifies the function to call to issue a warning. */ |
| 239 | 237 | ||
| 240 | void | 238 | void |
| 241 | memory_warnings (POINTER start, void (*warnfun) (const char *)) | 239 | memory_warnings (void *start, void (*warnfun) (const char *)) |
| 242 | { | 240 | { |
| 243 | extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ | 241 | extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ |
| 244 | 242 | ||
| @@ -7822,47 +7822,26 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact) | |||
| 7822 | ssize_t | 7822 | ssize_t |
| 7823 | emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz) | 7823 | emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz) |
| 7824 | { | 7824 | { |
| 7825 | int n, sc, err; | 7825 | int n, err; |
| 7826 | SELECT_TYPE fdset; | 7826 | SELECT_TYPE fdset; |
| 7827 | EMACS_TIME timeout; | 7827 | EMACS_TIME timeout; |
| 7828 | struct Lisp_Process *process = (struct Lisp_Process *)p; | 7828 | struct Lisp_Process *process = (struct Lisp_Process *)p; |
| 7829 | int fd = process->infd; | 7829 | int fd = process->infd; |
| 7830 | 7830 | ||
| 7831 | for (;;) | 7831 | n = sys_read (fd, (char*)buf, sz); |
| 7832 | { | ||
| 7833 | n = sys_read (fd, (char*)buf, sz); | ||
| 7834 | 7832 | ||
| 7835 | if (n >= 0) | 7833 | if (n >= 0) |
| 7836 | return n; | 7834 | return n; |
| 7837 | 7835 | ||
| 7838 | err = errno; | 7836 | err = errno; |
| 7839 | 7837 | ||
| 7840 | if (err == EWOULDBLOCK) | 7838 | /* Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN. */ |
| 7841 | { | 7839 | if (err == EWOULDBLOCK) |
| 7842 | /* Set a small timeout. */ | 7840 | err = EAGAIN; |
| 7843 | timeout = make_emacs_time (1, 0); | ||
| 7844 | FD_ZERO (&fdset); | ||
| 7845 | FD_SET ((int)fd, &fdset); | ||
| 7846 | |||
| 7847 | /* Use select with the timeout to poll the selector. */ | ||
| 7848 | sc = select (fd + 1, &fdset, (SELECT_TYPE *)0, (SELECT_TYPE *)0, | ||
| 7849 | &timeout, NULL); | ||
| 7850 | |||
| 7851 | if (sc > 0) | ||
| 7852 | continue; /* Try again. */ | ||
| 7853 | |||
| 7854 | /* Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN. | ||
| 7855 | Also accept select return 0 as an indicator to EAGAIN. */ | ||
| 7856 | if (sc == 0 || errno == EWOULDBLOCK) | ||
| 7857 | err = EAGAIN; | ||
| 7858 | else | ||
| 7859 | err = errno; /* Other errors are just passed on. */ | ||
| 7860 | } | ||
| 7861 | 7841 | ||
| 7862 | emacs_gnutls_transport_set_errno (process->gnutls_state, err); | 7842 | emacs_gnutls_transport_set_errno (process->gnutls_state, err); |
| 7863 | 7843 | ||
| 7864 | return -1; | 7844 | return -1; |
| 7865 | } | ||
| 7866 | } | 7845 | } |
| 7867 | 7846 | ||
| 7868 | ssize_t | 7847 | ssize_t |