aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog8
-rw-r--r--src/alloc.c4
-rw-r--r--src/dbusbind.c12
-rw-r--r--src/fns.c5
-rw-r--r--src/lisp.h7
5 files changed, 25 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d9b4984b4d4..9358387d116 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12009-08-17 Ken Raeburn <raeburn@raeburn.org> 12009-08-17 Ken Raeburn <raeburn@raeburn.org>
2 2
3 * lisp.h (XFLOAT_DATA): Produce an rvalue by adding 0 to the
4 value.
5 (XFLOAT_INIT): New macro for storing a float value.
6 * alloc.c (make_float, make_pure_float): Use XFLOAT_INIT.
7 * fns.c (sxhash): Copy out the value of a float in order to
8 examine its bytes.
9 * dbusbind.c (xd_append_arg): Likewise.
10
3 * emacs.c (main): Don't call syms_of_data twice. 11 * emacs.c (main): Don't call syms_of_data twice.
4 12
52009-08-16 Michael Albinus <michael.albinus@gmx.de> 132009-08-16 Michael Albinus <michael.albinus@gmx.de>
diff --git a/src/alloc.c b/src/alloc.c
index c150157ee05..157d768d69d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2643,7 +2643,7 @@ make_float (float_value)
2643 2643
2644 MALLOC_UNBLOCK_INPUT; 2644 MALLOC_UNBLOCK_INPUT;
2645 2645
2646 XFLOAT_DATA (val) = float_value; 2646 XFLOAT_INIT (val, float_value);
2647 eassert (!FLOAT_MARKED_P (XFLOAT (val))); 2647 eassert (!FLOAT_MARKED_P (XFLOAT (val)));
2648 consing_since_gc += sizeof (struct Lisp_Float); 2648 consing_since_gc += sizeof (struct Lisp_Float);
2649 floats_consed++; 2649 floats_consed++;
@@ -4850,7 +4850,7 @@ make_pure_float (num)
4850 4850
4851 p = (struct Lisp_Float *) pure_alloc (sizeof *p, Lisp_Float); 4851 p = (struct Lisp_Float *) pure_alloc (sizeof *p, Lisp_Float);
4852 XSETFLOAT (new, p); 4852 XSETFLOAT (new, p);
4853 XFLOAT_DATA (new) = num; 4853 XFLOAT_INIT (new, num);
4854 return new; 4854 return new;
4855} 4855}
4856 4856
diff --git a/src/dbusbind.c b/src/dbusbind.c
index a38a9944005..76b0da54205 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -475,11 +475,13 @@ xd_append_arg (dtype, object, iter)
475 } 475 }
476 476
477 case DBUS_TYPE_DOUBLE: 477 case DBUS_TYPE_DOUBLE:
478 XD_DEBUG_MESSAGE ("%c %f", dtype, XFLOAT_DATA (object)); 478 {
479 if (!dbus_message_iter_append_basic (iter, dtype, 479 double val = XFLOAT_DATA (object);
480 &XFLOAT_DATA (object))) 480 XD_DEBUG_MESSAGE ("%c %f", dtype, val);
481 XD_SIGNAL2 (build_string ("Unable to append argument"), object); 481 if (!dbus_message_iter_append_basic (iter, dtype, &val))
482 return; 482 XD_SIGNAL2 (build_string ("Unable to append argument"), object);
483 return;
484 }
483 485
484 case DBUS_TYPE_STRING: 486 case DBUS_TYPE_STRING:
485 case DBUS_TYPE_OBJECT_PATH: 487 case DBUS_TYPE_OBJECT_PATH:
diff --git a/src/fns.c b/src/fns.c
index 61abf32138d..562d493b59c 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4604,8 +4604,9 @@ sxhash (obj, depth)
4604 4604
4605 case Lisp_Float: 4605 case Lisp_Float:
4606 { 4606 {
4607 unsigned char *p = (unsigned char *) &XFLOAT_DATA (obj); 4607 double val = XFLOAT_DATA (obj);
4608 unsigned char *e = p + sizeof XFLOAT_DATA (obj); 4608 unsigned char *p = (unsigned char *) &val;
4609 unsigned char *e = p + sizeof val;
4609 for (hash = 0; p < e; ++p) 4610 for (hash = 0; p < e; ++p)
4610 hash = SXHASH_COMBINE (hash, *p); 4611 hash = SXHASH_COMBINE (hash, *p);
4611 break; 4612 break;
diff --git a/src/lisp.h b/src/lisp.h
index b71bf524d1e..15de8d9e74f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1377,9 +1377,12 @@ struct Lisp_Float
1377 }; 1377 };
1378 1378
1379#ifdef HIDE_LISP_IMPLEMENTATION 1379#ifdef HIDE_LISP_IMPLEMENTATION
1380#define XFLOAT_DATA(f) (XFLOAT (f)->u.data_) 1380#define XFLOAT_DATA(f) (XFLOAT (f)->u.data_ + 0)
1381#else 1381#else
1382#define XFLOAT_DATA(f) (XFLOAT (f)->u.data) 1382#define XFLOAT_DATA(f) (XFLOAT (f)->u.data + 0)
1383/* This should be used only in alloc.c, which always disables
1384 HIDE_LISP_IMPLEMENTATION. */
1385#define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n))
1383#endif 1386#endif
1384 1387
1385/* A character, declared with the following typedef, is a member 1388/* A character, declared with the following typedef, is a member