当前位置: 首页>>代码示例>>C++>>正文


C++ LoadVar函数代码示例

本文整理汇总了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' */
 }
}
开发者ID:CSE380Skulls,项目名称:ForceOfReaction,代码行数:13,代码来源:lundump.c

示例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' */
 }
}
开发者ID:TimofonicJunkRoom,项目名称:luabod-lunatik,代码行数:13,代码来源:lundump.c

示例3: Factor

void Factor() {
  if(Look == '(') {
    Match('(');
    BoolExpression();
    Match(')');
  }
  else if(IsAlpha(Look)) {
    GetName();
    LoadVar(Value);
  } else {
    LoadConst(GetNum());
  }
}
开发者ID:A-deLuna,项目名称:crenshaw-c-x86_64-compiler,代码行数:13,代码来源:main.c

示例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;
}
开发者ID:BackupTheBerlios,项目名称:elua-svn,代码行数:36,代码来源:lundump.c

示例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;
  }
}
开发者ID:1dao,项目名称:puss,代码行数:17,代码来源:lundump.c

示例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' */
 }
}
开发者ID:AdiBoy,项目名称:mtasa-blue,代码行数:17,代码来源:lundump.c

示例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();
    }
}
开发者ID:A-deLuna,项目名称:Let-s-build-a-compiler,代码行数:17,代码来源:main.c

示例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);
        }
    }
}
开发者ID:CobooGuo,项目名称:elua,代码行数:20,代码来源:lundump.c

示例9: LoadNumber

static lua_Number LoadNumber(LoadState* S)
{
 lua_Number x;
 LoadVar(S,x);
 return x;
}
开发者ID:alucard-dracula,项目名称:yggdrasil,代码行数:6,代码来源:lundump.c

示例10: LoadChar

static int LoadChar(LoadState* S)
{
 char x;
 LoadVar(S,x);
 return x;
}
开发者ID:alucard-dracula,项目名称:yggdrasil,代码行数:6,代码来源:lundump.c

示例11: LoadInteger

static lua_Integer LoadInteger(LoadState* S)
{
 lua_Integer x;
 LoadVar(S,x);
 return x;
}
开发者ID:Yui-Qi-Tang,项目名称:openwrtPKG,代码行数:6,代码来源:lundump.c

示例12: LoadInt

static int LoadInt (LoadState *S) {
  int x;
  LoadVar(S, x);
  return x;
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:5,代码来源:lundump.c

示例13: LoadByte

static lu_byte LoadByte (LoadState *S) {
  lu_byte x;
  LoadVar(S, x);
  return x;
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:5,代码来源:lundump.c

示例14: LoadNumber

static killa_Number LoadNumber(LoadState* S)
{
 killa_Number x;
 LoadVar(S,x);
 return x;
}
开发者ID:caivega,项目名称:Killa,代码行数:6,代码来源:kundump.c


注:本文中的LoadVar函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。