Permalink
Browse files

Revert "common/sclang: more integer type fixes"

This reverts commit c61c580.
  • Loading branch information...
1 parent c61c580 commit fbe8bceed862d61a72f75d86913a9f44cd05c998 @timblechmann timblechmann committed Sep 8, 2012
View
@@ -535,7 +535,7 @@ void* AllocPool::Realloc(void* inPtr, size_t inReqSize)
void AllocPool::LinkFree(AllocChunkPtr inChunk)
{
size_t size = inChunk->Size();
- size_t index = BinIndex(size);
+ int index = BinIndex(size);
AllocChunkPtr bin = mBins + index;
@@ -203,11 +203,11 @@ class AllocPool
return (bits << 3) + (inSize >> bits) ;
}
- void MarkBinBlock(size_t inIndex)
+ void MarkBinBlock(int inIndex)
{
- size_t word = inIndex >> 5;
- size_t bitPosition = inIndex & 31;
- size_t bitValue = 1L << bitPosition;
+ unsigned long word = inIndex >> 5;
+ unsigned long bitPosition = inIndex & 31;
+ unsigned long bitValue = 1L << bitPosition;
mBinBlocks[word] |= bitValue;
}
@@ -29,7 +29,7 @@ typedef unsigned char Byte;
typedef struct {
Byte *bytes;
Byte *ptr;
- size_t size;
+ long size;
} ByteCodeArray, *ByteCodes;
extern ByteCodes gCompilingByteCodes;
@@ -42,7 +42,7 @@ void copyByteCodes(Byte *dest, ByteCodes byteCodes);
ByteCodes getByteCodes();
ByteCodes saveByteCodeArray();
void restoreByteCodeArray(ByteCodes byteCodes);
-size_t byteCodeLength(ByteCodes byteCodes);
+int byteCodeLength(ByteCodes byteCodes);
void compileByteCodes(ByteCodes byteCodes);
ByteCodes allocByteCodes();
void reallocByteCodes(ByteCodes byteCodes);
@@ -128,7 +128,7 @@ void restoreByteCodeArray(ByteCodes byteCodes)
gCompilingByteCodes = byteCodes;
}
-size_t byteCodeLength(ByteCodes byteCodes)
+int byteCodeLength(ByteCodes byteCodes)
{
if (!byteCodes) return 0;
return (byteCodes->ptr - byteCodes->bytes);
@@ -176,12 +176,13 @@ ByteCodes allocByteCodes()
void reallocByteCodes(ByteCodes byteCodes)
{
Byte *newBytes;
+ int newLen;
if (byteCodes->size != (byteCodes->ptr - byteCodes->bytes)) {
error("reallocByteCodes called with size != byteCode len");
}
- size_t newLen = byteCodes->size << 1;
+ newLen = byteCodes->size << 1;
// pyrmalloc: I think that all bytecodes are copied to objects
// lifetime: kill after compile
newBytes = (Byte *)pyr_pool_compile->Alloc(newLen);
@@ -18,6 +18,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
#include "Opcodes.h"
#include "PyrInterpreter.h"
#include "PyrPrimitive.h"
@@ -199,7 +200,7 @@ PyrProcess* newPyrProcess(VMGlobals *g, PyrClass *procclassobj)
}
PyrSymbol * contextsym = getsym("functionCompileContext");
- size_t index = slotRawInt(&class_interpreter->classIndex) + contextsym->u.index;
+ int index = slotRawInt(&class_interpreter->classIndex) + contextsym->u.index;
PyrMethod * meth = gRowTable[index];
if (!meth || slotRawSymbol(&meth->name) != contextsym) {
error("compile context method 'functionCompileContext' not found.\n");
@@ -492,7 +493,7 @@ static inline void handleSendSpecialBinaryArithMsg(VMGlobals* g, PyrSlot *& sp,
static inline bool checkStackOverflow(VMGlobals* g, PyrSlot * sp)
{
PyrObject * stack = g->gc->Stack();
- size_t depth = sp - stack->slots;
+ int depth = sp - stack->slots;
return depth < slotRawInt(&g->thread->stackSize);
}
@@ -536,8 +537,7 @@ HOT void Interpret(VMGlobals *g)
// byte code values
unsigned char *ip;
unsigned char op1;
- size_t index;
- int op2, op3, tag;
+ int op2, op3, index, tag;
// interpreter globals
// temporary variables used in the interpreter
@@ -2754,6 +2754,7 @@ void DumpDetailedBackTrace(VMGlobals *g)
void DumpStack(VMGlobals *g, PyrSlot *sp)
{
+ int i;
PyrSlot *slot;
char str[128];
#if BCSTAT
@@ -2762,7 +2763,7 @@ void DumpStack(VMGlobals *g, PyrSlot *sp)
postfl("STACK:\n");
slot = sp - 64;
if (slot < g->gc->Stack()->slots) slot = g->gc->Stack()->slots;
- for (size_t i=slot - g->gc->Stack()->slots; slot<=sp; slot++, ++i) {
+ for (i=slot - g->gc->Stack()->slots; slot<=sp; slot++, ++i) {
slotString(slot, str);
post(" %2d %s\n", i, str);
}
@@ -27,7 +27,6 @@
#include "VMGlobals.h"
#include "Hash.h"
-
SC_DLLEXPORT_C PyrSymbol* getsym(const char *name)
{
PyrSymbol* symbol = gMainVMGlobals->symbolTable->Make(name);

0 comments on commit fbe8bce

Please sign in to comment.