changeset 8907:f7de8b4cb1b8

(validate_interval_range, property_value, Fget_char_property, Fnext_property_change, Fnext_single_property_change, Fprevious_property_change, Fprevious_single_property_change): Fix Lisp_Object vs. int problems.
author Karl Heuer <kwzh@gnu.org>
date Mon, 19 Sep 1994 00:18:27 +0000
parents 93f3d6f5753c
children 25d8b804abd3
files src/textprop.c
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/textprop.c	Mon Sep 19 00:17:55 1994 +0000
+++ b/src/textprop.c	Mon Sep 19 00:18:27 1994 +0000
@@ -102,7 +102,7 @@
 
   /* If we are asked for a point, but from a subr which operates
      on a range, then return nothing. */
-  if (*begin == *end && begin != end)
+  if (EQ (*begin, *end) && begin != end)
     return NULL_INTERVAL;
 
   if (XINT (*begin) > XINT (*end))
@@ -248,7 +248,7 @@
 
 /* Return the value of PROP in property-list PLIST, or Qunbound if it
    has none.  */
-static int
+static Lisp_Object
 property_value (plist, prop)
      Lisp_Object plist, prop;
 {
@@ -529,7 +529,7 @@
   if (WINDOWP (object))
     {
       w = XWINDOW (object);
-      XSET (object, Lisp_Buffer, w->buffer);
+      object = w->buffer;
     }
   if (BUFFERP (object))
     {
@@ -603,7 +603,8 @@
   if (! NILP (limit) && !(next->position < XFASTINT (limit)))
     return limit;
 
-  return next->position - (XTYPE (object) == Lisp_String);
+  XFASTINT (pos) = next->position - (XTYPE (object) == Lisp_String);
+  return pos;
 }
 
 /* Return 1 if there's a change in some property between BEG and END.  */
@@ -677,7 +678,8 @@
   if (! NILP (limit) && !(next->position < XFASTINT (limit)))
     return limit;
 
-  return next->position - (XTYPE (object) == Lisp_String);
+  XFASTINT (pos) = next->position - (XTYPE (object) == Lisp_String);
+  return pos;
 }
 
 DEFUN ("previous-property-change", Fprevious_property_change,
@@ -720,8 +722,9 @@
       && !(previous->position + LENGTH (previous) > XFASTINT (limit)))
     return limit;
 
-  return (previous->position + LENGTH (previous)
-	  - (XTYPE (object) == Lisp_String));
+  XFASTINT (pos) = (previous->position + LENGTH (previous)
+		    - (XTYPE (object) == Lisp_String));
+  return pos;
 }
 
 DEFUN ("previous-single-property-change", Fprevious_single_property_change,
@@ -769,8 +772,9 @@
       && !(previous->position + LENGTH (previous) > XFASTINT (limit)))
     return limit;
 
-  return (previous->position + LENGTH (previous)
-	  - (XTYPE (object) == Lisp_String));
+  XFASTINT (pos) = (previous->position + LENGTH (previous)
+		    - (XTYPE (object) == Lisp_String));
+  return pos;
 }
 
 DEFUN ("add-text-properties", Fadd_text_properties,