[DEV] remove 32 bits options
This commit is contained in:
parent
ab2fc34e1c
commit
05107dc711
@ -119,8 +119,12 @@ rabbit::Result rabbit::std::format(rabbit::VirtualMachine* v,int64_t nformatstri
|
|||||||
addlen = (sq_getsize(v,nparam)*sizeof(char))+((w+1)*sizeof(char));
|
addlen = (sq_getsize(v,nparam)*sizeof(char))+((w+1)*sizeof(char));
|
||||||
valtype = 's';
|
valtype = 's';
|
||||||
break;
|
break;
|
||||||
case 'i': case 'd': case 'o': case 'u': case 'x': case 'X':
|
case 'i':
|
||||||
#ifdef _SQ64
|
case 'd':
|
||||||
|
case 'o':
|
||||||
|
case 'u':
|
||||||
|
case 'x':
|
||||||
|
case 'X':
|
||||||
{
|
{
|
||||||
size_t flen = strlen(fmt);
|
size_t flen = strlen(fmt);
|
||||||
int64_t fpos = flen - 1;
|
int64_t fpos = flen - 1;
|
||||||
@ -132,7 +136,6 @@ rabbit::Result rabbit::std::format(rabbit::VirtualMachine* v,int64_t nformatstri
|
|||||||
fmt[fpos++] = f;
|
fmt[fpos++] = f;
|
||||||
fmt[fpos++] = '\0';
|
fmt[fpos++] = '\0';
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
case 'c':
|
case 'c':
|
||||||
if(SQ_FAILED(sq_getinteger(v,nparam,&ti)))
|
if(SQ_FAILED(sq_getinteger(v,nparam,&ti)))
|
||||||
return sq_throwerror(v,"integer expected for the specified format");
|
return sq_throwerror(v,"integer expected for the specified format");
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#include <rabbit/sqopcodes.hpp>
|
#include <rabbit/sqopcodes.hpp>
|
||||||
#include <rabbit/squtils.hpp>
|
#include <rabbit/squtils.hpp>
|
||||||
|
|
||||||
|
#define UINT_MINUS_ONE (0xFFFFFFFFFFFFFFFF)
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG_DUMP
|
#ifdef _DEBUG_DUMP
|
||||||
rabbit::InstructionDesc g_InstrDesc[]={
|
rabbit::InstructionDesc g_InstrDesc[]={
|
||||||
{"_OP_LINE"},
|
{"_OP_LINE"},
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#define RABBIT_OBJ_REF_TYPE_INSTANCIATE(type,_class,sym) \
|
#define RABBIT_OBJ_REF_TYPE_INSTANCIATE(type,_class,sym) \
|
||||||
rabbit::ObjectPtr::ObjectPtr(_class * x) \
|
rabbit::ObjectPtr::ObjectPtr(_class * x) \
|
||||||
{ \
|
{ \
|
||||||
SQ_OBJECT_RAWINIT() \
|
_unVal.raw = 0; \
|
||||||
_type=type; \
|
_type=type; \
|
||||||
_unVal.sym = x; \
|
_unVal.sym = x; \
|
||||||
assert(_unVal.pTable); \
|
assert(_unVal.pTable); \
|
||||||
@ -25,7 +25,7 @@
|
|||||||
tOldType=_type; \
|
tOldType=_type; \
|
||||||
unOldVal=_unVal; \
|
unOldVal=_unVal; \
|
||||||
_type = type; \
|
_type = type; \
|
||||||
SQ_REFOBJECT_INIT() \
|
_unVal.raw = 0; \
|
||||||
_unVal.sym = x; \
|
_unVal.sym = x; \
|
||||||
_unVal.pRefCounted->refCountIncrement(); \
|
_unVal.pRefCounted->refCountIncrement(); \
|
||||||
__release(tOldType,unOldVal); \
|
__release(tOldType,unOldVal); \
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#define RABBIT_SCALAR_TYPE_INSTANCIATE(type,_class,sym) \
|
#define RABBIT_SCALAR_TYPE_INSTANCIATE(type,_class,sym) \
|
||||||
rabbit::ObjectPtr::ObjectPtr(_class x) \
|
rabbit::ObjectPtr::ObjectPtr(_class x) \
|
||||||
{ \
|
{ \
|
||||||
SQ_OBJECT_RAWINIT() \
|
_unVal.raw = 0; \
|
||||||
_type=type; \
|
_type=type; \
|
||||||
_unVal.sym = x; \
|
_unVal.sym = x; \
|
||||||
} \
|
} \
|
||||||
@ -43,7 +43,7 @@
|
|||||||
{ \
|
{ \
|
||||||
__release(_type,_unVal); \
|
__release(_type,_unVal); \
|
||||||
_type = type; \
|
_type = type; \
|
||||||
SQ_OBJECT_RAWINIT() \
|
_unVal.raw = 0; \
|
||||||
_unVal.sym = x; \
|
_unVal.sym = x; \
|
||||||
return *this; \
|
return *this; \
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ RABBIT_SCALAR_TYPE_INSTANCIATE(rabbit::OT_USERPOINTER, rabbit::UserPointer, pUse
|
|||||||
|
|
||||||
|
|
||||||
rabbit::ObjectPtr::ObjectPtr() {
|
rabbit::ObjectPtr::ObjectPtr() {
|
||||||
SQ_OBJECT_RAWINIT()
|
_unVal.raw = 0;
|
||||||
_type = rabbit::OT_NULL;
|
_type = rabbit::OT_NULL;
|
||||||
_unVal.pUserPointer = NULL;
|
_unVal.pUserPointer = NULL;
|
||||||
}
|
}
|
||||||
@ -88,14 +88,14 @@ rabbit::ObjectPtr::ObjectPtr(const rabbit::Object& _obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rabbit::ObjectPtr::ObjectPtr(bool _value) {
|
rabbit::ObjectPtr::ObjectPtr(bool _value) {
|
||||||
SQ_OBJECT_RAWINIT()
|
_unVal.raw = 0;
|
||||||
_type = rabbit::OT_BOOL;
|
_type = rabbit::OT_BOOL;
|
||||||
_unVal.nInteger = _value?1:0;
|
_unVal.nInteger = _value?1:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
rabbit::ObjectPtr& rabbit::ObjectPtr::operator=(bool _value) {
|
rabbit::ObjectPtr& rabbit::ObjectPtr::operator=(bool _value) {
|
||||||
__release(_type,_unVal);
|
__release(_type,_unVal);
|
||||||
SQ_OBJECT_RAWINIT()
|
_unVal.raw = 0;
|
||||||
_type = rabbit::OT_BOOL;
|
_type = rabbit::OT_BOOL;
|
||||||
_unVal.nInteger = _value?1:0;
|
_unVal.nInteger = _value?1:0;
|
||||||
return *this;
|
return *this;
|
||||||
@ -133,7 +133,7 @@ void rabbit::ObjectPtr::Null() {
|
|||||||
rabbit::ObjectType tOldType = _type;
|
rabbit::ObjectType tOldType = _type;
|
||||||
rabbit::ObjectValue unOldVal = _unVal;
|
rabbit::ObjectValue unOldVal = _unVal;
|
||||||
_type = rabbit::OT_NULL;
|
_type = rabbit::OT_NULL;
|
||||||
_unVal.raw = (rabbit::RawObjectVal)NULL;
|
_unVal.raw = 0;
|
||||||
__release(tOldType ,unOldVal);
|
__release(tOldType ,unOldVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,11 +14,6 @@
|
|||||||
#include <rabbit/Object.hpp>
|
#include <rabbit/Object.hpp>
|
||||||
|
|
||||||
namespace rabbit {
|
namespace rabbit {
|
||||||
#if defined(SQUSEDOUBLE) && !defined(_SQ64) || !defined(SQUSEDOUBLE) && defined(_SQ64)
|
|
||||||
#define SQ_REFOBJECT_INIT() SQ_OBJECT_RAWINIT()
|
|
||||||
#else
|
|
||||||
#define SQ_REFOBJECT_INIT()
|
|
||||||
#endif
|
|
||||||
#define RABBIT_OBJ_REF_TYPE_DECLARE(type,_class,sym) \
|
#define RABBIT_OBJ_REF_TYPE_DECLARE(type,_class,sym) \
|
||||||
ObjectPtr(_class * x); \
|
ObjectPtr(_class * x); \
|
||||||
ObjectPtr& operator=(_class *x);
|
ObjectPtr& operator=(_class *x);
|
||||||
|
@ -33,7 +33,7 @@ namespace rabbit {
|
|||||||
rabbit::Array* pArray;
|
rabbit::Array* pArray;
|
||||||
rabbit::UserData* pUserData;
|
rabbit::UserData* pUserData;
|
||||||
|
|
||||||
rabbit::RawObjectVal raw;
|
uint64_t raw;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,7 @@
|
|||||||
rabbit::WeakRef * rabbit::RefCounted::getWeakRef(rabbit::ObjectType type) {
|
rabbit::WeakRef * rabbit::RefCounted::getWeakRef(rabbit::ObjectType type) {
|
||||||
if(!_weakref) {
|
if(!_weakref) {
|
||||||
sq_new(_weakref, WeakRef);
|
sq_new(_weakref, WeakRef);
|
||||||
#if defined(SQUSEDOUBLE) && !defined(_SQ64)
|
_weakref->_obj._unVal.raw = 0; //clean the whole union
|
||||||
_weakref->_obj._unVal.raw = 0; //clean the whole union on 32 bits with double
|
|
||||||
#endif
|
|
||||||
_weakref->_obj._type = type;
|
_weakref->_obj._type = type;
|
||||||
_weakref->_obj._unVal.pRefCounted = this;
|
_weakref->_obj._unVal.pRefCounted = this;
|
||||||
}
|
}
|
||||||
|
@ -676,11 +676,7 @@ bool rabbit::VirtualMachine::IsFalse(rabbit::ObjectPtr &o)
|
|||||||
{
|
{
|
||||||
if(((sq_type(o) & SQOBJECT_CANBEFALSE)
|
if(((sq_type(o) & SQOBJECT_CANBEFALSE)
|
||||||
&& ( ((sq_type(o) == rabbit::OT_FLOAT) && (_float(o) == float_t(0.0))) ))
|
&& ( ((sq_type(o) == rabbit::OT_FLOAT) && (_float(o) == float_t(0.0))) ))
|
||||||
#if !defined(SQUSEDOUBLE) || (defined(SQUSEDOUBLE) && defined(_SQ64))
|
|
||||||
|| (_integer(o) == 0) ) //rabbit::OT_NULL|OT_INTEGER|OT_BOOL
|
|| (_integer(o) == 0) ) //rabbit::OT_NULL|OT_INTEGER|OT_BOOL
|
||||||
#else
|
|
||||||
|| (((type(o) != rabbit::OT_FLOAT) && (_integer(o) == 0))) ) //OT_NULL|OT_INTEGER|OT_BOOL
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -733,11 +729,7 @@ exception_restore:
|
|||||||
case _OP_LINE: if (_debughook) callDebugHook('l',arg1); continue;
|
case _OP_LINE: if (_debughook) callDebugHook('l',arg1); continue;
|
||||||
case _OP_LOAD: TARGET = ci->_literals[arg1]; continue;
|
case _OP_LOAD: TARGET = ci->_literals[arg1]; continue;
|
||||||
case _OP_LOADINT:
|
case _OP_LOADINT:
|
||||||
#ifndef _SQ64
|
|
||||||
TARGET = (int64_t)arg1; continue;
|
|
||||||
#else
|
|
||||||
TARGET = (int64_t)((int32_t)arg1); continue;
|
TARGET = (int64_t)((int32_t)arg1); continue;
|
||||||
#endif
|
|
||||||
case _OP_LOADFLOAT: TARGET = *((const float_t *)&arg1); continue;
|
case _OP_LOADFLOAT: TARGET = *((const float_t *)&arg1); continue;
|
||||||
case _OP_DLOAD: TARGET = ci->_literals[arg1]; STK(arg2) = ci->_literals[arg3];continue;
|
case _OP_DLOAD: TARGET = ci->_literals[arg1]; STK(arg2) = ci->_literals[arg3];continue;
|
||||||
case _OP_TAILCALL:{
|
case _OP_TAILCALL:{
|
||||||
@ -932,11 +924,7 @@ exception_restore:
|
|||||||
val = ci->_literals[arg1]; break;
|
val = ci->_literals[arg1]; break;
|
||||||
case AAT_INT:
|
case AAT_INT:
|
||||||
val._type = rabbit::OT_INTEGER;
|
val._type = rabbit::OT_INTEGER;
|
||||||
#ifndef _SQ64
|
|
||||||
val._unVal.nInteger = (int64_t)arg1;
|
|
||||||
#else
|
|
||||||
val._unVal.nInteger = (int64_t)((int32_t)arg1);
|
val._unVal.nInteger = (int64_t)((int32_t)arg1);
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case AAT_FLOAT:
|
case AAT_FLOAT:
|
||||||
val._type = rabbit::OT_FLOAT;
|
val._type = rabbit::OT_FLOAT;
|
||||||
|
@ -11,12 +11,6 @@
|
|||||||
#include _SQ_CONFIG_INCLUDE
|
#include _SQ_CONFIG_INCLUDE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(_WIN64) || defined(_LP64))
|
|
||||||
#ifndef _SQ64
|
|
||||||
#define _SQ64
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "sqconfig.hpp"
|
#include "sqconfig.hpp"
|
||||||
|
|
||||||
#define RABBIT_VERSION "Rabbit 0.1 un-stable"
|
#define RABBIT_VERSION "Rabbit 0.1 un-stable"
|
||||||
|
@ -15,16 +15,6 @@ typedef double float_t;
|
|||||||
typedef float float_t;
|
typedef float float_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace rabbit {
|
|
||||||
#if defined(SQUSEDOUBLE) && !defined(_SQ64) || !defined(SQUSEDOUBLE) && defined(_SQ64)
|
|
||||||
using RawObjectVal = uint64_t; //must be 64bits
|
|
||||||
#define SQ_OBJECT_RAWINIT() { _unVal.raw = 0; }
|
|
||||||
#else
|
|
||||||
using RawObjectVal = uint64_t; //is 32 bits on 32 bits builds and 64 bits otherwise
|
|
||||||
#define SQ_OBJECT_RAWINIT()
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef SQ_ALIGNMENT
|
#ifndef SQ_ALIGNMENT
|
||||||
#define SQ_ALIGNMENT 8
|
#define SQ_ALIGNMENT 8
|
||||||
#endif
|
#endif
|
||||||
@ -48,12 +38,6 @@ namespace rabbit {
|
|||||||
#define SQFalse (0)
|
#define SQFalse (0)
|
||||||
|
|
||||||
|
|
||||||
#ifdef _SQ64
|
|
||||||
#define UINT_MINUS_ONE (0xFFFFFFFFFFFFFFFF)
|
|
||||||
#else
|
|
||||||
#define UINT_MINUS_ONE (0xFFFFFFFF)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace rabbit {
|
namespace rabbit {
|
||||||
class UserData;
|
class UserData;
|
||||||
class Array;
|
class Array;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user