metakit-2.4.9.7-fix64bitbigendianfff484.diff at [a8386e13ed]

File mk4tcl/patches/all/metakit-2.4.9.7-fix64bitbigendianfff484.diff artifact 306a0cd2ca part of check-in a8386e13ed


diff -uNr metakit-2.4.9.7-orig/tcl/mk4tcl.cpp metakit-2.4.9.7-rsk/tcl/mk4tcl.cpp
--- metakit-2.4.9.7-orig/tcl/mk4tcl.cpp	2007-06-18 16:05:24.000000000 -0500
+++ metakit-2.4.9.7-rsk/tcl/mk4tcl.cpp	2010-02-22 18:30:05.000000000 -0600
@@ -1043,11 +1043,11 @@
   return *(MkPath*)obj_->internalRep.twoPtrValue.ptr2;
 }
 
-int &AsIndex(Tcl_Obj *obj_) {
+long &AsIndex(Tcl_Obj *obj_) {
   d4_assert(obj_->typePtr ==  &mkCursorType);
   d4_assert(obj_->internalRep.twoPtrValue.ptr2 != 0);
 
-  return (int &)obj_->internalRep.twoPtrValue.ptr1;
+  return (long &)obj_->internalRep.twoPtrValue.ptr1;
 }
 
 static void FreeCursorInternalRep(Tcl_Obj *cursorPtr) {
@@ -1110,7 +1110,7 @@
   EnterMutex(path._ws->_interp);
   c4_String s = path._path;
 
-  int index = AsIndex(cursorPtr);
+  long index = AsIndex(cursorPtr);
   if (index >= 0) {
     char buf[20];
     sprintf(buf, "%s%d", s.IsEmpty() ? "" : "!", index);
@@ -1455,7 +1455,7 @@
   return AsPath(obj_)._view;
 }
 
-int &MkTcl::changeIndex(Tcl_Obj *obj_) {
+long &MkTcl::changeIndex(Tcl_Obj *obj_) {
   SetCursorFromAny(interp, obj_);
   Tcl_InvalidateStringRep(obj_);
   return AsIndex(obj_);
@@ -1463,7 +1463,7 @@
 
 c4_RowRef MkTcl::asRowRef(Tcl_Obj *obj_, int type_) {
   c4_View view = asView(obj_);
-  int index = AsIndex(obj_);
+  long index = AsIndex(obj_);
   int size = view.GetSize();
 
   switch (type_) {
@@ -1621,7 +1621,7 @@
           return _error;
 
         c4_View view = row.Container();
-        int index = AsIndex(objv[2]);
+        long index = AsIndex(objv[2]);
 
         int count = objc > 3 ? tcl_GetIntFromObj(objv[3]): 1;
         if (count > view.GetSize() - index)
@@ -1641,7 +1641,7 @@
           return _error;
 
         c4_View view = toRow.Container();
-        int n = AsIndex(objv[2]);
+        long n = AsIndex(objv[2]);
 
         int count = objc > 3 ? tcl_GetIntFromObj(objv[3]): 1;
         if (count >= 1) {
@@ -2206,7 +2206,7 @@
   if (objc <= 3) {
     if (id == 1)
      { // position without value returns current value
-      Tcl_SetIntObj(tcl_GetObjResult(), AsIndex(var));
+      Tcl_SetLongObj(tcl_GetObjResult(), AsIndex(var));
       return _error;
     }
 
@@ -2338,7 +2338,7 @@
 int MkTcl::ChannelCmd() {
   c4_RowRef row = asRowRef(objv[1]);
   MkPath &path = AsPath(objv[1]);
-  int index = AsIndex(objv[1]);
+  long index = AsIndex(objv[1]);
 
   if (_error)
     return _error;
diff -uNr metakit-2.4.9.7-orig/tcl/mk4tcl.h metakit-2.4.9.7-rsk/tcl/mk4tcl.h
--- metakit-2.4.9.7-orig/tcl/mk4tcl.h	2007-06-15 18:26:40.000000000 -0500
+++ metakit-2.4.9.7-rsk/tcl/mk4tcl.h	2010-02-22 18:30:33.000000000 -0600
@@ -274,7 +274,7 @@
 //  Cursors in Tcl are implemented as a pointer to an MkPath plus an index.
 
 MkPath &AsPath(Tcl_Obj *obj_);
-int &AsIndex(Tcl_Obj *obj_);
+long &AsIndex(Tcl_Obj *obj_);
 int SetCursorFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
 
 // 24nov02: added to support releasing mutex lock during loop eval's
@@ -367,7 +367,7 @@
     ~MkTcl();
 
     c4_View asView(Tcl_Obj *obj_);
-    int &changeIndex(Tcl_Obj *obj_);
+    long &changeIndex(Tcl_Obj *obj_);
     c4_RowRef asRowRef(Tcl_Obj *obj_, int type_ = kExistingRow);
     int GetCmd();
     int SetValues(const c4_RowRef &row_, int objc, Tcl_Obj *const * objv);