changeset 108604:3b0bab58a95f

* lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an rvalue. (bug#5916) (LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
author Ken Raeburn <raeburn@raeburn.org>
date Sat, 15 May 2010 17:19:05 -0400
parents 135d8ad190d8
children 425217da7e83
files src/ChangeLog src/lisp.h
diffstat 2 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat May 15 17:16:20 2010 -0400
+++ b/src/ChangeLog	Sat May 15 17:19:05 2010 -0400
@@ -1,5 +1,9 @@
 2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
 
+	* lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an
+	rvalue. (bug#5916)
+	(LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
+
 	* emacs.c (main): Initialize initial-environment and
 	process-environment before generating from env, not after.
 
--- a/src/lisp.h	Sat May 15 17:16:20 2010 -0400
+++ b/src/lisp.h	Sat May 15 17:19:05 2010 -0400
@@ -310,11 +310,10 @@
     return o;
 }
 #else
-/* This isn't quite right - it keeps the argument as an lvalue.
-   Making it const via casting would help avoid code actually
-   modifying the location in question, but the casting could cover
-   other type-related bugs.  */
-#define LISP_MAKE_RVALUE(o) (o)
+/* This is more portable to pre-C99 non-GCC compilers, but for
+   backwards compatibility GCC still accepts an old GNU extension
+   which caused this to only generate a warning.  */
+#define LISP_MAKE_RVALUE(o) (0 ? (o) : (o))
 #endif
 
 #else /* USE_LISP_UNION_TYPE */
@@ -1461,9 +1460,9 @@
   };
 
 #ifdef HIDE_LISP_IMPLEMENTATION
-#define XFLOAT_DATA(f)	(XFLOAT (f)->u.data_ + 0)
+#define XFLOAT_DATA(f)	(0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_)
 #else
-#define XFLOAT_DATA(f)	(XFLOAT (f)->u.data + 0)
+#define XFLOAT_DATA(f)	(0 ? XFLOAT (f)->u.data :  XFLOAT (f)->u.data)
 /* This should be used only in alloc.c, which always disables
    HIDE_LISP_IMPLEMENTATION.  */
 #define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n))