aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-21 09:47:56 -0700
committerPaul Eggert2011-06-21 09:47:56 -0700
commita9041e6caf73abe867602bc60f2f3d48601a908d (patch)
treeaa1e90adff88d8ee969184219019d49f2e716ac6
parent9e9de01439b2c57e79505ba0668894c9addc3bf1 (diff)
downloademacs-a9041e6caf73abe867602bc60f2f3d48601a908d.tar.gz
emacs-a9041e6caf73abe867602bc60f2f3d48601a908d.zip
Port to Sun C.
* composite.c (find_automatic_composition): Omit needless 'return 0;' that Sun C diagnosed. * fns.c (secure_hash): Fix pointer signedness issue. * intervals.c (static_offset_intervals): New function. (offset_intervals): Use it.
-rw-r--r--src/ChangeLog9
-rw-r--r--src/composite.c1
-rw-r--r--src/fns.c2
-rw-r--r--src/intervals.c17
4 files changed, 24 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 279bd1be381..48625bbf285 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12011-06-21 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port to Sun C.
4 * composite.c (find_automatic_composition): Omit needless 'return 0;'
5 that Sun C diagnosed.
6 * fns.c (secure_hash): Fix pointer signedness issue.
7 * intervals.c (static_offset_intervals): New function.
8 (offset_intervals): Use it.
9
12011-06-21 Leo Liu <sdl.web@gmail.com> 102011-06-21 Leo Liu <sdl.web@gmail.com>
2 11
3 * deps.mk (fns.o): 12 * deps.mk (fns.o):
diff --git a/src/composite.c b/src/composite.c
index 51b7669cb4f..6a4fe803804 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1676,7 +1676,6 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit,
1676 } 1676 }
1677 BACKWARD_CHAR (cur, stop); 1677 BACKWARD_CHAR (cur, stop);
1678 } 1678 }
1679 return 0;
1680} 1679}
1681 1680
1682/* Return the adjusted point provided that point is moved from LAST_PT 1681/* Return the adjusted point provided that point is moved from LAST_PT
diff --git a/src/fns.c b/src/fns.c
index 96b8a4ed7d9..cd7e67360ec 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4802,7 +4802,7 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_
4802 return digest; 4802 return digest;
4803 } 4803 }
4804 else 4804 else
4805 return make_unibyte_string (SDATA (digest), digest_size); 4805 return make_unibyte_string (SSDATA (digest), digest_size);
4806} 4806}
4807 4807
4808DEFUN ("md5", Fmd5, Smd5, 1, 5, 0, 4808DEFUN ("md5", Fmd5, Smd5, 1, 5, 0,
diff --git a/src/intervals.c b/src/intervals.c
index f9e9c864e13..4de001f2ffc 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1425,10 +1425,15 @@ adjust_intervals_for_deletion (struct buffer *buffer,
1425/* Make the adjustments necessary to the interval tree of BUFFER to 1425/* Make the adjustments necessary to the interval tree of BUFFER to
1426 represent an addition or deletion of LENGTH characters starting 1426 represent an addition or deletion of LENGTH characters starting
1427 at position START. Addition or deletion is indicated by the sign 1427 at position START. Addition or deletion is indicated by the sign
1428 of LENGTH. */ 1428 of LENGTH.
1429 1429
1430inline void 1430 The two inline functions (one static) pacify Sun C 5.8, a pre-C99
1431offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) 1431 compiler that does not allow calling a static function (here,
1432 adjust_intervals_for_deletion) from a non-static inline function. */
1433
1434static inline void
1435static_offset_intervals (struct buffer *buffer, EMACS_INT start,
1436 EMACS_INT length)
1432{ 1437{
1433 if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) 1438 if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0)
1434 return; 1439 return;
@@ -1441,6 +1446,12 @@ offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length)
1441 adjust_intervals_for_deletion (buffer, start, -length); 1446 adjust_intervals_for_deletion (buffer, start, -length);
1442 } 1447 }
1443} 1448}
1449
1450inline void
1451offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length)
1452{
1453 static_offset_intervals (buffer, start, length);
1454}
1444 1455
1445/* Merge interval I with its lexicographic successor. The resulting 1456/* Merge interval I with its lexicographic successor. The resulting
1446 interval is returned, and has the properties of the original 1457 interval is returned, and has the properties of the original