parent
397246d2f1
commit
e7b78be8e5
164
engine/vm.c
164
engine/vm.c
|
@ -414,7 +414,7 @@ PH7_PRIVATE sxi32 PH7_VmEmitInstr(
|
||||||
sInstr.iP2 = iP2;
|
sInstr.iP2 = iP2;
|
||||||
sInstr.p3 = p3;
|
sInstr.p3 = p3;
|
||||||
sInstr.iLine = 1;
|
sInstr.iLine = 1;
|
||||||
if (pVm->sCodeGen.pEnd && pVm->sCodeGen.pEnd->nLine > 0) {
|
if(pVm->sCodeGen.pEnd && pVm->sCodeGen.pEnd->nLine > 0) {
|
||||||
sInstr.iLine = pVm->sCodeGen.pEnd->nLine;
|
sInstr.iLine = pVm->sCodeGen.pEnd->nLine;
|
||||||
}
|
}
|
||||||
if(pIndex) {
|
if(pIndex) {
|
||||||
|
@ -8284,13 +8284,13 @@ PH7_PRIVATE void PH7_VmRandomString(ph7_vm *pVm, char *zBuf, int nLen) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PH7_PRIVATE void PH7_VmRandomBytes(ph7_vm *pVm, unsigned char *zBuf, int nLen) {
|
PH7_PRIVATE void PH7_VmRandomBytes(ph7_vm *pVm, unsigned char *zBuf, int nLen) {
|
||||||
sxu32 iDx;
|
sxu32 iDx;
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < nLen; ++i) {
|
for(i = 0; i < nLen; ++i) {
|
||||||
iDx = PH7_VmRandomNum(pVm);
|
iDx = PH7_VmRandomNum(pVm);
|
||||||
iDx %= 255;
|
iDx %= 255;
|
||||||
zBuf[i] = (unsigned char)iDx;
|
zBuf[i] = (unsigned char)iDx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* int rand()
|
* int rand()
|
||||||
|
@ -8395,25 +8395,24 @@ static int vm_builtin_rand_str(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
||||||
* by te SQLite3 library.
|
* by te SQLite3 library.
|
||||||
*/
|
*/
|
||||||
static int vm_builtin_random_int(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
static int vm_builtin_random_int(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
||||||
sxu32 iNum, iMin, iMax;
|
sxu32 iNum, iMin, iMax;
|
||||||
if(nArg != 2) {
|
if(nArg != 2) {
|
||||||
ph7_context_throw_error(pCtx, PH7_CTX_ERR, "Expecting min and max arguments");
|
ph7_context_throw_error(pCtx, PH7_CTX_ERR, "Expecting min and max arguments");
|
||||||
return SXERR_INVALID;
|
return SXERR_INVALID;
|
||||||
}
|
}
|
||||||
iNum = PH7_VmRandomNum(pCtx->pVm);
|
iNum = PH7_VmRandomNum(pCtx->pVm);
|
||||||
iMin = (sxu32)ph7_value_to_int(apArg[0]);
|
iMin = (sxu32)ph7_value_to_int(apArg[0]);
|
||||||
iMax = (sxu32)ph7_value_to_int(apArg[1]);
|
iMax = (sxu32)ph7_value_to_int(apArg[1]);
|
||||||
if(iMin < iMax) {
|
if(iMin < iMax) {
|
||||||
sxu32 iDiv = iMax + 1 - iMin;
|
sxu32 iDiv = iMax + 1 - iMin;
|
||||||
if(iDiv > 0) {
|
if(iDiv > 0) {
|
||||||
iNum = (iNum % iDiv) + iMin;
|
iNum = (iNum % iDiv) + iMin;
|
||||||
}
|
}
|
||||||
} else if(iMax > 0) {
|
} else if(iMax > 0) {
|
||||||
iNum %= iMax;
|
iNum %= iMax;
|
||||||
}
|
}
|
||||||
|
ph7_result_int64(pCtx, (ph7_int64)iNum);
|
||||||
ph7_result_int64(pCtx, (ph7_int64)iNum);
|
return SXRET_OK;
|
||||||
return SXRET_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8429,21 +8428,21 @@ static int vm_builtin_random_int(ph7_context *pCtx, int nArg, ph7_value **apArg)
|
||||||
* by te SQLite3 library.
|
* by te SQLite3 library.
|
||||||
*/
|
*/
|
||||||
static int vm_builtin_random_bytes(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
static int vm_builtin_random_bytes(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
||||||
sxu32 iLen;
|
sxu32 iLen;
|
||||||
unsigned char *zBuf;
|
unsigned char *zBuf;
|
||||||
if (nArg != 1) {
|
if(nArg != 1) {
|
||||||
ph7_context_throw_error(pCtx, PH7_CTX_ERR, "Expecting length argument");
|
ph7_context_throw_error(pCtx, PH7_CTX_ERR, "Expecting length argument");
|
||||||
return SXERR_INVALID;
|
return SXERR_INVALID;
|
||||||
}
|
}
|
||||||
iLen = (sxu32)ph7_value_to_int(apArg[0]);
|
iLen = (sxu32)ph7_value_to_int(apArg[0]);
|
||||||
zBuf = SyMemBackendPoolAlloc(&pCtx->pVm->sAllocator, iLen);
|
zBuf = SyMemBackendPoolAlloc(&pCtx->pVm->sAllocator, iLen);
|
||||||
if (zBuf == 0) {
|
if(zBuf == 0) {
|
||||||
ph7_context_throw_error(pCtx, PH7_CTX_ERR, "PH7 is running out of memory while creating buffer");
|
ph7_context_throw_error(pCtx, PH7_CTX_ERR, "PH7 is running out of memory while creating buffer");
|
||||||
return SXERR_MEM;
|
return SXERR_MEM;
|
||||||
}
|
}
|
||||||
PH7_VmRandomBytes(pCtx->pVm, zBuf, iLen);
|
PH7_VmRandomBytes(pCtx->pVm, zBuf, iLen);
|
||||||
ph7_result_string(pCtx, (char *)zBuf, iLen);
|
ph7_result_string(pCtx, (char *)zBuf, iLen);
|
||||||
return SXRET_OK;
|
return SXRET_OK;
|
||||||
}
|
}
|
||||||
#ifndef PH7_DISABLE_BUILTIN_FUNC
|
#ifndef PH7_DISABLE_BUILTIN_FUNC
|
||||||
#if !defined(PH7_DISABLE_HASH_FUNC)
|
#if !defined(PH7_DISABLE_HASH_FUNC)
|
||||||
|
@ -9427,18 +9426,22 @@ static int vm_builtin_debug_backtrace(ph7_context *pCtx, int nArg, ph7_value **a
|
||||||
return PH7_OK;
|
return PH7_OK;
|
||||||
}
|
}
|
||||||
/* Dump running function name and it's arguments */
|
/* Dump running function name and it's arguments */
|
||||||
if(pVm->pFrame->pParent) {
|
while(pVm->pFrame) {
|
||||||
|
ph7_value *pArraySub;
|
||||||
VmFrame *pFrame = pVm->pFrame;
|
VmFrame *pFrame = pVm->pFrame;
|
||||||
ph7_vm_func *pFunc;
|
ph7_vm_func *pFunc;
|
||||||
ph7_value *pArg;
|
ph7_value *pArg;
|
||||||
while(pFrame->pParent && (pFrame->iFlags & VM_FRAME_EXCEPTION)) {
|
|
||||||
/* Safely ignore the exception frame */
|
|
||||||
pFrame = pFrame->pParent;
|
|
||||||
}
|
|
||||||
pFunc = (ph7_vm_func *)pFrame->pUserData;
|
pFunc = (ph7_vm_func *)pFrame->pUserData;
|
||||||
if(pFrame->pParent && pFunc) {
|
if(!pFunc || (pFrame->iFlags & VM_FRAME_EXCEPTION)) {
|
||||||
|
goto rollFrame;
|
||||||
|
}
|
||||||
|
pArraySub = ph7_context_new_array(pCtx);
|
||||||
|
if(!pArraySub) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(pFrame->pParent) {
|
||||||
ph7_value_string(pValue, pFunc->sName.zString, (int)pFunc->sName.nByte);
|
ph7_value_string(pValue, pFunc->sName.zString, (int)pFunc->sName.nByte);
|
||||||
ph7_array_add_strkey_elem(pArray, "function", pValue);
|
ph7_array_add_strkey_elem(pArraySub, "function", pValue);
|
||||||
ph7_value_reset_string_cursor(pValue);
|
ph7_value_reset_string_cursor(pValue);
|
||||||
}
|
}
|
||||||
/* Function arguments */
|
/* Function arguments */
|
||||||
|
@ -9456,39 +9459,42 @@ static int vm_builtin_debug_backtrace(ph7_context *pCtx, int nArg, ph7_value **a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Save the array */
|
/* Save the array */
|
||||||
ph7_array_add_strkey_elem(pArray, "args", pArg);
|
ph7_array_add_strkey_elem(pArraySub, "args", pArg);
|
||||||
}
|
}
|
||||||
if (pFunc) {
|
if(pFunc) {
|
||||||
for (sxi32 i = (SySetUsed(pVm->pByteContainer) - 1); i >= 0 ; i--) {
|
SySet *aByteCode = &pFunc->aByteCode;
|
||||||
VmInstr *cInstr = (VmInstr *)SySetAt(pVm->pByteContainer, i);
|
for(sxi32 i = (SySetUsed(aByteCode) - 1); i >= 0 ; i--) {
|
||||||
if (cInstr->iP2) {
|
VmInstr *cInstr = (VmInstr *)SySetAt(aByteCode, i);
|
||||||
iLine = cInstr->iLine;
|
if(cInstr->iP2) {
|
||||||
break;
|
iLine = cInstr->iLine;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if(iLine != -1) {
|
||||||
|
ph7_value_int(pValue, iLine);
|
||||||
if (iLine != -1) {
|
/* Append the current line (which is always 1 since PH7 does not track
|
||||||
ph7_value_int(pValue, iLine);
|
* line numbers at run-time. )
|
||||||
/* Append the current line (which is always 1 since PH7 does not track
|
*/
|
||||||
* line numbers at run-time. )
|
ph7_array_add_strkey_elem(pArraySub, "line", pValue);
|
||||||
*/
|
}
|
||||||
ph7_array_add_strkey_elem(pArray, "line", pValue);
|
/* Current processed script */
|
||||||
}
|
pFile = (SyString *)SySetPeek(&pVm->aFiles);
|
||||||
/* Current processed script */
|
if(pFile) {
|
||||||
pFile = (SyString *)SySetPeek(&pVm->aFiles);
|
ph7_value_string(pValue, pFile->zString, (int)pFile->nByte);
|
||||||
if(pFile) {
|
ph7_array_add_strkey_elem(pArraySub, "file", pValue);
|
||||||
ph7_value_string(pValue, pFile->zString, (int)pFile->nByte);
|
ph7_value_reset_string_cursor(pValue);
|
||||||
ph7_array_add_strkey_elem(pArray, "file", pValue);
|
}
|
||||||
ph7_value_reset_string_cursor(pValue);
|
/* Top class */
|
||||||
}
|
pClass = PH7_VmPeekTopClass(pVm);
|
||||||
/* Top class */
|
if(pClass) {
|
||||||
pClass = PH7_VmPeekTopClass(pVm);
|
ph7_value_reset_string_cursor(pValue);
|
||||||
if(pClass) {
|
ph7_value_string(pValue, pClass->sName.zString, (int)pClass->sName.nByte);
|
||||||
ph7_value_reset_string_cursor(pValue);
|
ph7_array_add_strkey_elem(pArraySub, "class", pValue);
|
||||||
ph7_value_string(pValue, pClass->sName.zString, (int)pClass->sName.nByte);
|
}
|
||||||
ph7_array_add_strkey_elem(pArray, "class", pValue);
|
ph7_array_add_elem(pArray, 0, pArraySub);
|
||||||
|
rollFrame:
|
||||||
|
pVm->pFrame = pVm->pFrame->pParent;
|
||||||
}
|
}
|
||||||
/* Return the freshly created array */
|
/* Return the freshly created array */
|
||||||
ph7_result_value(pCtx, pArray);
|
ph7_result_value(pCtx, pArray);
|
||||||
|
|
|
@ -167,32 +167,32 @@ typedef struct ph7 ph7;
|
||||||
#if !defined(SYMISC_STANDARD_DEFS)
|
#if !defined(SYMISC_STANDARD_DEFS)
|
||||||
#define SYMISC_STANDARD_DEFS
|
#define SYMISC_STANDARD_DEFS
|
||||||
#if defined (_WIN32) || defined (WIN32) || defined(__MINGW32__) || defined (_MSC_VER) || defined (_WIN32_WCE)
|
#if defined (_WIN32) || defined (WIN32) || defined(__MINGW32__) || defined (_MSC_VER) || defined (_WIN32_WCE)
|
||||||
/* Windows Systems */
|
/* Windows Systems */
|
||||||
#if !defined(__WINNT__)
|
#if !defined(__WINNT__)
|
||||||
#define __WINNT__
|
#define __WINNT__
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* By default we will assume that we are compiling on a UNIX systems.
|
* By default we will assume that we are compiling on a UNIX systems.
|
||||||
* Otherwise the OS_OTHER directive must be defined.
|
* Otherwise the OS_OTHER directive must be defined.
|
||||||
*/
|
*/
|
||||||
#if !defined(OS_OTHER)
|
#if !defined(OS_OTHER)
|
||||||
#if !defined(__UNIXES__)
|
#if !defined(__UNIXES__)
|
||||||
#define __UNIXES__
|
#define __UNIXES__
|
||||||
#endif /* __UNIXES__ */
|
#endif /* __UNIXES__ */
|
||||||
#else
|
#else
|
||||||
#endif /* OS_OTHER */
|
#endif /* OS_OTHER */
|
||||||
#endif /* __WINNT__/__UNIXES__ */
|
#endif /* __WINNT__/__UNIXES__ */
|
||||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||||
typedef signed __int64 sxi64; /* 64 bits(8 bytes) signed int64 */
|
typedef signed __int64 sxi64; /* 64 bits(8 bytes) signed int64 */
|
||||||
typedef unsigned __int64 sxu64; /* 64 bits(8 bytes) unsigned int64 */
|
typedef unsigned __int64 sxu64; /* 64 bits(8 bytes) unsigned int64 */
|
||||||
#else
|
#else
|
||||||
typedef signed long long int sxi64; /* 64 bits(8 bytes) signed int64 */
|
typedef signed long long int sxi64; /* 64 bits(8 bytes) signed int64 */
|
||||||
typedef unsigned long long int sxu64; /* 64 bits(8 bytes) unsigned int64 */
|
typedef unsigned long long int sxu64; /* 64 bits(8 bytes) unsigned int64 */
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
/* Solaris additions */
|
/* Solaris additions */
|
||||||
#ifndef MAP_FILE
|
#ifndef MAP_FILE
|
||||||
#define MAP_FILE 0
|
#define MAP_FILE 0
|
||||||
#endif
|
#endif
|
||||||
/* Signature of the consumer routine */
|
/* Signature of the consumer routine */
|
||||||
typedef int (*ProcConsumer)(const void *, unsigned int, void *);
|
typedef int (*ProcConsumer)(const void *, unsigned int, void *);
|
||||||
|
@ -283,11 +283,11 @@ struct SyMutexMethods {
|
||||||
void (*xLeave)(SyMutex *); /* [Required:] Leave a locked mutex */
|
void (*xLeave)(SyMutex *); /* [Required:] Leave a locked mutex */
|
||||||
};
|
};
|
||||||
#if defined (_MSC_VER) || defined (__MINGW32__) || defined (__GNUC__) && defined (__declspec)
|
#if defined (_MSC_VER) || defined (__MINGW32__) || defined (__GNUC__) && defined (__declspec)
|
||||||
#define SX_APIIMPORT __declspec(dllimport)
|
#define SX_APIIMPORT __declspec(dllimport)
|
||||||
#define SX_APIEXPORT __declspec(dllexport)
|
#define SX_APIEXPORT __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define SX_APIIMPORT
|
#define SX_APIIMPORT
|
||||||
#define SX_APIEXPORT
|
#define SX_APIEXPORT
|
||||||
#endif
|
#endif
|
||||||
/* Standard return values from Symisc public interfaces */
|
/* Standard return values from Symisc public interfaces */
|
||||||
#define SXRET_OK 0 /* Not an error */
|
#define SXRET_OK 0 /* Not an error */
|
||||||
|
@ -342,9 +342,9 @@ struct SyMutexMethods {
|
||||||
* support, substitute integer for floating-point.
|
* support, substitute integer for floating-point.
|
||||||
*/
|
*/
|
||||||
#ifdef PH7_OMIT_FLOATING_POINT
|
#ifdef PH7_OMIT_FLOATING_POINT
|
||||||
typedef sxi64 ph7_real;
|
typedef sxi64 ph7_real;
|
||||||
#else
|
#else
|
||||||
typedef double ph7_real;
|
typedef double ph7_real;
|
||||||
#endif
|
#endif
|
||||||
typedef sxi64 ph7_int64;
|
typedef sxi64 ph7_int64;
|
||||||
#define PH7_APIEXPORT SX_APIEXPORT
|
#define PH7_APIEXPORT SX_APIEXPORT
|
||||||
|
|
|
@ -1728,11 +1728,11 @@ PH7_PRIVATE void *PH7_ExportStdout(ph7_vm *pVm);
|
||||||
PH7_PRIVATE void *PH7_ExportStderr(ph7_vm *pVm);
|
PH7_PRIVATE void *PH7_ExportStderr(ph7_vm *pVm);
|
||||||
/* lib.c function prototypes */
|
/* lib.c function prototypes */
|
||||||
#ifndef PH7_DISABLE_BUILTIN_FUNC
|
#ifndef PH7_DISABLE_BUILTIN_FUNC
|
||||||
PH7_PRIVATE sxi32 SyArchiveInit(SyArchive *pArch, SyMemBackend *pAllocator, ProcHash xHash, ProcRawStrCmp xCmp);
|
PH7_PRIVATE sxi32 SyArchiveInit(SyArchive *pArch, SyMemBackend *pAllocator, ProcHash xHash, ProcRawStrCmp xCmp);
|
||||||
PH7_PRIVATE sxi32 SyArchiveRelease(SyArchive *pArch);
|
PH7_PRIVATE sxi32 SyArchiveRelease(SyArchive *pArch);
|
||||||
PH7_PRIVATE sxi32 SyArchiveResetLoopCursor(SyArchive *pArch);
|
PH7_PRIVATE sxi32 SyArchiveResetLoopCursor(SyArchive *pArch);
|
||||||
PH7_PRIVATE sxi32 SyArchiveGetNextEntry(SyArchive *pArch, SyArchiveEntry **ppEntry);
|
PH7_PRIVATE sxi32 SyArchiveGetNextEntry(SyArchive *pArch, SyArchiveEntry **ppEntry);
|
||||||
PH7_PRIVATE sxi32 SyZipExtractFromBuf(SyArchive *pArch, const char *zBuf, sxu32 nLen);
|
PH7_PRIVATE sxi32 SyZipExtractFromBuf(SyArchive *pArch, const char *zBuf, sxu32 nLen);
|
||||||
#endif /* PH7_DISABLE_BUILTIN_FUNC */
|
#endif /* PH7_DISABLE_BUILTIN_FUNC */
|
||||||
#ifndef PH7_DISABLE_BUILTIN_FUNC
|
#ifndef PH7_DISABLE_BUILTIN_FUNC
|
||||||
PH7_PRIVATE sxi32 SyBinToHexConsumer(const void *pIn, sxu32 nLen, ProcConsumer xConsumer, void *pConsumerData);
|
PH7_PRIVATE sxi32 SyBinToHexConsumer(const void *pIn, sxu32 nLen, ProcConsumer xConsumer, void *pConsumerData);
|
||||||
|
|
|
@ -500,7 +500,6 @@ static int PH7_builtin_ctype_upper(ph7_context *pCtx, int nArg, ph7_value **apAr
|
||||||
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
||||||
sxi32 rc;
|
sxi32 rc;
|
||||||
sxu32 n;
|
sxu32 n;
|
||||||
|
|
||||||
desc->zString = MODULE_DESC;
|
desc->zString = MODULE_DESC;
|
||||||
*ver = MODULE_VER;
|
*ver = MODULE_VER;
|
||||||
for(n = 0; n < SX_ARRAYSIZE(ctypeFuncList); ++n) {
|
for(n = 0; n < SX_ARRAYSIZE(ctypeFuncList); ++n) {
|
||||||
|
|
|
@ -16,10 +16,9 @@ int psharp_dummy_function(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
||||||
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
||||||
sxi32 rc;
|
sxi32 rc;
|
||||||
sxu32 n;
|
sxu32 n;
|
||||||
|
|
||||||
desc->zString = MODULE_DESC;
|
desc->zString = MODULE_DESC;
|
||||||
*ver = MODULE_VER;
|
*ver = MODULE_VER;
|
||||||
for(n = 0; n < SX_ARRAYSIZE(dummyConstList); ++n) {
|
for(n = 0; n < SX_ARRAYSIZE(dummyConstList); ++n) {
|
||||||
rc = ph7_create_constant(&(*pVm), dummyConstList[n].zName, dummyConstList[n].xExpand, &(*pVm));
|
rc = ph7_create_constant(&(*pVm), dummyConstList[n].zName, dummyConstList[n].xExpand, &(*pVm));
|
||||||
if(rc != SXRET_OK) {
|
if(rc != SXRET_OK) {
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -889,7 +889,6 @@ static int vm_builtin_json_decode(ph7_context *pCtx, int nArg, ph7_value **apArg
|
||||||
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
||||||
sxi32 rc;
|
sxi32 rc;
|
||||||
sxu32 n;
|
sxu32 n;
|
||||||
|
|
||||||
desc->zString = MODULE_DESC;
|
desc->zString = MODULE_DESC;
|
||||||
*ver = MODULE_VER;
|
*ver = MODULE_VER;
|
||||||
for(n = 0; n < SX_ARRAYSIZE(jsonConstList); ++n) {
|
for(n = 0; n < SX_ARRAYSIZE(jsonConstList); ++n) {
|
||||||
|
|
|
@ -625,13 +625,12 @@ static int PH7_builtin_hypot(ph7_context *pCtx, int nArg, ph7_value **apArg) {
|
||||||
return PH7_OK;
|
return PH7_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc){
|
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
||||||
sxi32 rc;
|
sxi32 rc;
|
||||||
sxu32 n;
|
sxu32 n;
|
||||||
|
|
||||||
desc->zString = MODULE_DESC;
|
desc->zString = MODULE_DESC;
|
||||||
*ver = MODULE_VER;
|
*ver = MODULE_VER;
|
||||||
for(n = 0; n < SX_ARRAYSIZE(mathConstList); ++n) {
|
for(n = 0; n < SX_ARRAYSIZE(mathConstList); ++n) {
|
||||||
rc = ph7_create_constant(&(*pVm), mathConstList[n].zName, mathConstList[n].xExpand, &(*pVm));
|
rc = ph7_create_constant(&(*pVm), mathConstList[n].zName, mathConstList[n].xExpand, &(*pVm));
|
||||||
if(rc != SXRET_OK) {
|
if(rc != SXRET_OK) {
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -1464,7 +1464,6 @@ static int vm_builtin_xml_error_string(ph7_context *pCtx, int nArg, ph7_value **
|
||||||
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc) {
|
||||||
sxi32 rc;
|
sxi32 rc;
|
||||||
sxu32 n;
|
sxu32 n;
|
||||||
|
|
||||||
desc->zString = MODULE_DESC;
|
desc->zString = MODULE_DESC;
|
||||||
*ver = MODULE_VER;
|
*ver = MODULE_VER;
|
||||||
for(n = 0; n < SX_ARRAYSIZE(xmlConstList); ++n) {
|
for(n = 0; n < SX_ARRAYSIZE(xmlConstList); ++n) {
|
||||||
|
|
Loading…
Reference in New Issue