[Quipu-dev] quipu/quipu: Fix 32-bit builds

Back to archive index

scmno****@osdn***** scmno****@osdn*****
Fri Jun 15 00:49:49 JST 2018


changeset a54af9e55584 in quipu/quipu
details: http://hg.osdn.jp/view/quipu/quipu?cmd=changeset;node=a54af9e55584
user: Agustina Arzille <avarz****@riseu*****>
date: Thu Jun 14 12:49:39 2018 -0300
description: Fix 32-bit builds

diffstat:

 compiler.cpp |   4 ++--
 defs.h       |   2 +-
 floatp.cpp   |  18 ++++++++++--------
 3 files changed, 13 insertions(+), 11 deletions(-)

diffs (62 lines):

diff -r ecd20888911f -r a54af9e55584 compiler.cpp
--- a/compiler.cpp	Wed Jun 13 16:31:14 2018 -0300
+++ b/compiler.cpp	Thu Jun 14 12:49:39 2018 -0300
@@ -355,7 +355,7 @@
     {
       if (make_lform (cv[cv.size () - 2]) == OPX_(SETAL))
         {
-          cv[cv.size () - 2] += OP_SETAPOP - OP_SETA;
+          cv[cv.size () - 2] += intobj (OP_SETAPOP - OP_SETA);
           return;
         }
       else
@@ -2794,7 +2794,7 @@
 
 #undef GOTO_LABELS
 #undef U_PUSH
-#undef U_PREV_LC
+#undef r_stkend
 }
 
 static object
diff -r ecd20888911f -r a54af9e55584 defs.h
--- a/defs.h	Wed Jun 13 16:31:14 2018 -0300
+++ b/defs.h	Thu Jun 14 12:49:39 2018 -0300
@@ -109,7 +109,7 @@
     }
 
   // Encode a pointer into a varobject.
-  inline constexpr object encobj (const void *__ptr)
+  inline object encobj (const void *__ptr)
     {
       return ((object)__ptr | 3);
     }
diff -r ecd20888911f -r a54af9e55584 floatp.cpp
--- a/floatp.cpp	Wed Jun 13 16:31:14 2018 -0300
+++ b/floatp.cpp	Thu Jun 14 12:49:39 2018 -0300
@@ -441,15 +441,17 @@
        * This wastes some memory, but is preferable to
        * allocating a new object. */
 
+      fltval tmp;
+      tmp.link = src->link;
+      tmp.size = src->size;
+      tmp.full = src->full;
+      tmp.type = typecode::FLOAT;
+      tmp.val = sign ? -dbl : dbl;
+
+      memcpy (src, &tmp, sizeof (tmp));
+      interp->retval = src->as_obj ();
+
       src->type = typecode::FLOAT;
-
-#ifdef QP_ARCH_WIDE
-      ((fltval *)src)->val = dbl;
-      interp->retval = ptrtype (src, typecode::FLOAT) | (sign ? SIGN_BIT : 0);
-#else
-      ((fltval *)src)->val = sign ? -dbl : dbl;
-      interp->retval = src->as_obj ();
-#endif
     }
   else
   do_bigfloat:




More information about the Quipu-dev mailing list
Back to archive index