64bit safety fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32731 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-29 08:16:02 +00:00
parent 2e1b6bafcb
commit c0979f8d17
10 changed files with 121 additions and 91 deletions

View file

@ -49,13 +49,13 @@
/*
* Setup for inline operation of pointer map tables.
*/
#define GSI_MAP_KTYPES GSUNION_PTR | GSUNION_OBJ | GSUNION_CLS | GSUNION_INT
#define GSI_MAP_VTYPES GSUNION_PTR | GSUNION_OBJ | GSUNION_CLS | GSUNION_INT
#define GSI_MAP_KTYPES GSUNION_PTR | GSUNION_OBJ | GSUNION_CLS | GSUNION_NSINT
#define GSI_MAP_VTYPES GSUNION_PTR | GSUNION_OBJ | GSUNION_CLS | GSUNION_NSINT
#define GSI_MAP_RETAIN_KEY(M, X)
#define GSI_MAP_RELEASE_KEY(M, X)
#define GSI_MAP_RETAIN_VAL(M, X)
#define GSI_MAP_RELEASE_VAL(M, X)
#define GSI_MAP_HASH(M, X) ((X).uint)
#define GSI_MAP_HASH(M, X) ((X).nsu)
#define GSI_MAP_EQUAL(M, X,Y) ((X).ptr == (Y).ptr)
#define GSI_MAP_NOCLEAN 1
@ -1298,7 +1298,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
return;
}
if (node == 0 || node->value.uint == 0)
if (node == 0 || node->value.nsu == 0)
{
Class cls;
id obj;
@ -1310,7 +1310,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
}
else
{
node->value.uint = ++_xRefO;
node->value.nsu = ++_xRefO;
}
obj = [anObject replacementObjectForPortCoder: self];
@ -1320,20 +1320,20 @@ static IMP _xRefImp; /* Serialize a crossref. */
* If the object we have been given is actually a class,
* we encode it as a special case.
*/
(*_xRefImp)(_dst, xRefSel, _GSC_CID, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_CID, node->value.nsu);
(*_eValImp)(self, eValSel, @encode(Class), &obj);
}
else
{
cls = [obj classForPortCoder];
(*_xRefImp)(_dst, xRefSel, _GSC_ID, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_ID, node->value.nsu);
(*_eValImp)(self, eValSel, @encode(Class), &cls);
[obj encodeWithCoder: self];
}
}
else
{
(*_xRefImp)(_dst, xRefSel, _GSC_ID | _GSC_XREF, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_ID | _GSC_XREF, node->value.nsu);
}
}
}
@ -1465,7 +1465,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
(*_eValImp)(self, eValSel, type, buf);
}
}
else if (node == 0 || node->value.uint == 0)
else if (node == 0 || node->value.nsu == 0)
{
/*
* Second pass, unwritten pointer - write it.
@ -1477,9 +1477,9 @@ static IMP _xRefImp; /* Serialize a crossref. */
}
else
{
node->value.uint = ++_xRefP;
node->value.nsu = ++_xRefP;
}
(*_xRefImp)(_dst, xRefSel, _GSC_PTR, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_PTR, node->value.nsu);
type++;
buf = *(char**)buf;
(*_eValImp)(self, eValSel, type, buf);
@ -1490,7 +1490,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
* Second pass, write a cross-reference number.
*/
(*_xRefImp)(_dst, xRefSel, _GSC_PTR|_GSC_XREF,
node->value.uint);
node->value.nsu);
}
}
return;
@ -1524,7 +1524,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
if (node != 0)
{
(*_xRefImp)(_dst, xRefSel, _GSC_CLASS | _GSC_XREF,
node->value.uint);
node->value.nsu);
return;
}
while (done == NO)
@ -1543,7 +1543,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
/*
* Encode tag and crossref number.
*/
(*_xRefImp)(_dst, xRefSel, _GSC_CLASS, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_CLASS, node->value.nsu);
/*
* Encode class, and version.
*/
@ -1590,7 +1590,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
{
node = GSIMapAddPair(_ptrMap,
(GSIMapKey)(void*)s, (GSIMapVal)++_xRefP);
(*_xRefImp)(_dst, xRefSel, _GSC_SEL, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_SEL, node->value.nsu);
/*
* Encode selector.
*/
@ -1599,7 +1599,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
else
{
(*_xRefImp)(_dst, xRefSel, _GSC_SEL|_GSC_XREF,
node->value.uint);
node->value.nsu);
}
}
return;
@ -1621,13 +1621,13 @@ static IMP _xRefImp; /* Serialize a crossref. */
{
node = GSIMapAddPair(_ptrMap,
(GSIMapKey)*(char**)buf, (GSIMapVal)++_xRefP);
(*_xRefImp)(_dst, xRefSel, _GSC_CHARPTR, node->value.uint);
(*_xRefImp)(_dst, xRefSel, _GSC_CHARPTR, node->value.nsu);
(*_eSerImp)(_dst, eSerSel, buf, type, nil);
}
else
{
(*_xRefImp)(_dst, xRefSel, _GSC_CHARPTR|_GSC_XREF,
node->value.uint);
node->value.nsu);
}
}
return;