]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/data.h
cppbind: disable special handling of 'parents' for ghost.
[simgear.git] / simgear / nasal / data.h
index 8f1715a332a9ce020103ba48aaf483fabcb67d55..5453d39171e1a4367b6c09478a6a8d0526aa9346 100644 (file)
 
 // On 32 bit systems where the pointer is half the width of the
 // double, we store a special magic number in the structure to make
-// the double a NaN.  This must appear in the top bits of the double,
+// the double a qNaN.  This must appear in the top bits of the double,
 // which is why the structure layout is endianness-dependent.
+// qNaN (quiet NaNs) use range 0x7ff80000-0x7fffffff
 
-#define NASAL_REFTAG 0x7ff56789 // == 2,146,789,257 decimal
+#define NASAL_REFTAG 0x7fff6789 // == 2,147,444,617 decimal
 #define IS_REF(r) ((r).ref.reftag == NASAL_REFTAG)
 #define PTR(r) ((r).ref.ptr)
 
@@ -95,7 +96,7 @@ struct naObj {
 #define MAX_STR_EMBLEN 15
 struct naStr {
     GC_HEADER;
-    char emblen; /* [0-15], or -1 to indicate "not embedded" */
+    signed char emblen; /* [0-15], or -1 to indicate "not embedded" */
     unsigned int hashcode;
     union {
         unsigned char buf[16];
@@ -159,7 +160,15 @@ struct naFunc {
 
 struct naCCode {
     GC_HEADER;
-    naCFunction fptr;
+    union {
+        naCFunction fptr; //<! pointer to simple callback function. Invalid if
+                          //   fptru is not NULL.
+        struct {
+            void* user_data;
+            void(*destroy)(void*);
+            naCFunctionU fptru;
+        };
+    };
 };
 
 struct naGhost {