Hello,

please find attached a patch for:
  http://smalltalk.gnu.org/project/issue/647

I will also make this available as a pull request on github, along with
another cosmetic change.

Thanks,
Regards,

Thomas
fix issue #647

2012-06-14  Thomas Girard  <[email protected]>

	* libgst/cint.c: Add missing long long and
        unsigned long long types to _gst_c_type_size.
	* libgst/dict.inl: Add IS_C_LONGLONG and
	IS_C_ULONGLONG macros.
	* libgst/prims.def: Use these macros instead.

diff --git a/libgst/cint.c b/libgst/cint.c
index ce5455a..77c8f8c 100644
--- a/libgst/cint.c
+++ b/libgst/cint.c
@@ -749,6 +749,11 @@ _gst_c_type_size (int type)
     case CDATA_ULONG:
       return sizeof (unsigned long);
 
+    case CDATA_LONGLONG:
+      return sizeof (long long);
+    case CDATA_ULONGLONG:
+      return sizeof (unsigned long long);
+
     case CDATA_FLOAT:
       return sizeof (float);
     case CDATA_DOUBLE:
diff --git a/libgst/dict.inl b/libgst/dict.inl
index bafdb11..e4dfe7d 100644
--- a/libgst/dict.inl
+++ b/libgst/dict.inl
@@ -274,6 +274,8 @@ static inline uint64_t to_c_uint_64 (OOP oop);
 
 #define TO_C_INT(integer)	to_c_int_32(integer)
 #define IS_C_INT(oop)		is_c_int_32(oop)
+#define IS_C_LONGLONG(oop)	is_c_int_64(oop)
+#define IS_C_ULONGLONG(oop)	is_c_uint_64(oop)
 #define FROM_C_LONGLONG(integ)	from_c_int_64(integ)
 #define FROM_C_ULONGLONG(integ)	from_c_uint_64(integ)
 
diff --git a/libgst/prims.def b/libgst/prims.def
index 131dc8c..55ac5ae 100644
--- a/libgst/prims.def
+++ b/libgst/prims.def
@@ -4841,9 +4841,9 @@ primitive VMpr_CObject_atPut [succeed,fail]
 	    }
 	  break;
 
-       case CDATA_LONGLONG:            /* long */
-       case CDATA_ULONGLONG:           /* ulong */
-         if (IS_C_LONG (oop3))
+       case CDATA_LONGLONG:            /* long long */
+       case CDATA_ULONGLONG:           /* unsigned long long */
+         if (IS_C_LONGLONG (oop3) || IS_C_ULONGLONG (oop3))
            {
              *(long long *) addr = (long long) to_c_int_64 (oop3);
              PRIM_SUCCEEDED;
_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to