本文整理汇总了C++中LoadVar函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadVar函数的具体用法?C++ LoadVar怎么用?C++ LoadVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadVar函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadWString
static TString* LoadWString(LoadState* S)
{
size_t size;
LoadVar(S,size);
if (size==0)
return NULL;
else
{
lua_WChar* s=(lua_WChar*)luaZ_openspace(S->L,S->b,size*2);
LoadVector(S,s,size,2);
return luaS_newlwstr(S->L,s,size-1); /* remove trailing '\0' */
}
}
示例2: LoadString
static TString* LoadString(LoadState* S)
{
size_t size;
LoadVar(S,size);
if (size==0)
return NULL;
else
{
char* s=luaZ_openspace(S->L,S->b,size);
LoadBlock(S,s,size);
return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
}
}
示例3: Factor
void Factor() {
if(Look == '(') {
Match('(');
BoolExpression();
Match(')');
}
else if(IsAlpha(Look)) {
GetName();
LoadVar(Value);
} else {
LoadConst(GetNum());
}
}
示例4: LoadNumber
static lua_Number LoadNumber(LoadState* S)
{
lua_Number x;
if(S->toflt)
{
switch(S->numsize)
{
case 1: {
int8_t y;
LoadVar(S,y);
x = (lua_Number)y;
} break;
case 2: {
int16_t y;
LoadVar(S,y);
x = (lua_Number)y;
} break;
case 4: {
int32_t y;
LoadVar(S,y);
x = (lua_Number)y;
} break;
case 8: {
int64_t y;
LoadVar(S,y);
x = (lua_Number)y;
} break;
default: lua_assert(0);
}
}
else
{
LoadVar(S,x); /* should probably handle more cases for float here... */
}
return x;
}
示例5: LoadByte
static TString *LoadString (LoadState *S) {
size_t size = LoadByte(S);
if (size == 0xFF)
LoadVar(S, size);
if (size == 0)
return NULL;
else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */
char buff[LUAI_MAXSHORTLEN];
LoadVector(S, buff, size);
return luaS_newlstr(S->L, buff, size);
}
else { /* long string */
TString *ts = luaS_createlngstrobj(S->L, size);
LoadVector(S, getstr(ts), size); /* load directly in final place */
return ts;
}
}
示例6: LoadString
static TString* LoadString(LoadState* S)
{
size_t size = 0;
if ( sizeof(size_t) <= SIZE_T_PRECOMPILED_CHUNK )
LoadVar(S,size);
else
LoadMem(S,&size,1,SIZE_T_PRECOMPILED_CHUNK);
if (size==0)
return NULL;
else
{
char* s=luaZ_openspace(S->L,S->b,size);
LoadBlock(S,s,size);
return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
}
}
示例7: Factor
void Factor()
{
if (Token == '(') {
Next();
BoolExpression();
MatchString(")");
} else {
if (Token == 'x') {
LoadVar(Value);
} else if (Token == '#') {
LoadConst(Value);
} else {
Expected("Math Factor");
}
Next();
}
}
示例8: LoadString
static TString* LoadString(LoadState* S)
{
int32_t size;
LoadVar(S,size);
if (size==0)
return NULL;
else
{
char* s;
if (!luaZ_direct_mode(S->Z)) {
s = luaZ_openspace(S->L,S->b,size);
LoadBlock(S,s,size);
return luaS_newlstr(S->L,s,size-1); /* remove trailing zero */
} else {
s = (char*)luaZ_get_crt_address(S->Z);
LoadBlock(S,NULL,size);
return luaS_newrolstr(S->L,s,size-1);
}
}
}
示例9: LoadNumber
static lua_Number LoadNumber(LoadState* S)
{
lua_Number x;
LoadVar(S,x);
return x;
}
示例10: LoadChar
static int LoadChar(LoadState* S)
{
char x;
LoadVar(S,x);
return x;
}
示例11: LoadInteger
static lua_Integer LoadInteger(LoadState* S)
{
lua_Integer x;
LoadVar(S,x);
return x;
}
示例12: LoadInt
static int LoadInt (LoadState *S) {
int x;
LoadVar(S, x);
return x;
}
示例13: LoadByte
static lu_byte LoadByte (LoadState *S) {
lu_byte x;
LoadVar(S, x);
return x;
}
示例14: LoadNumber
static killa_Number LoadNumber(LoadState* S)
{
killa_Number x;
LoadVar(S,x);
return x;
}