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


C++ LoadByte函数代码示例

本文整理汇总了C++中LoadByte函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadByte函数的具体用法?C++ LoadByte怎么用?C++ LoadByte使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LoadByte函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadConstants

static void LoadConstants (LoadState *S, Proto *f) {
  int i;
  int n = LoadInt(S);
  f->k = luaM_newvector(S->L, n, TValue);
  f->sizek = n;
  for (i = 0; i < n; i++)
    setnilvalue(&f->k[i]);
  for (i = 0; i < n; i++) {
    TValue *o = &f->k[i];
    int t = LoadByte(S);
    switch (t) {
    case LUA_TNIL:
      setnilvalue(o);
      break;
    case LUA_TBOOLEAN:
      setbvalue(o, LoadByte(S));
      break;
    case LUA_TNUMFLT:
      setfltvalue(o, LoadNumber(S));
      break;
    case LUA_TNUMINT:
      setivalue(o, LoadInteger(S));
      break;
    case LUA_TSHRSTR:
    case LUA_TLNGSTR:
      setsvalue2n(S->L, o, LoadString(S));
      break;
    default:
      lua_assert(0);
    }
  }
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:32,代码来源:lundump.c

示例2: LoadHeader

static void LoadHeader (LoadState* S)
{
 int version;
 lua_Number x,tx=TEST_NUMBER;
 LoadSignature(S);
 version=LoadByte(S);
 if (version>VERSION)
  luaG_runerror(S->L,"%s too new: "
    "read version %d.%d; expected at most %d.%d",
    S->name,V(version),V(VERSION));
 if (version<VERSION0)                /* check last major change */
  luaG_runerror(S->L,"%s too old: "
    "read version %d.%d; expected at least %d.%d",
    S->name,V(version),V(VERSION0));
 S->swap=(luaU_endianness()!=LoadByte(S));    /* need to swap bytes? */
 TESTSIZE(sizeof(int),"int");
 TESTSIZE(sizeof(size_t), "size_t");
 TESTSIZE(sizeof(Instruction), "Instruction");
 TESTSIZE(SIZE_OP, "OP");
 TESTSIZE(SIZE_A, "A");
 TESTSIZE(SIZE_B, "B");
 TESTSIZE(SIZE_C, "C");
 TESTSIZE(sizeof(lua_Number), "number");
 x=LoadNumber(S);
 if ((long)x!=(long)tx)        /* disregard errors in last bits of fraction */
  luaG_runerror(S->L,"unknown number format in %s",S->name);
}
开发者ID:terrordrummer,项目名称:safebikesimframework,代码行数:27,代码来源:lundump.c

示例3: LoadFunction

static Proto * LoadFunction(LoadState * S, TString * p)
{
	Proto* f;

	if(++S->L->nCcalls > LUAI_MAXCCALLS)
		error(S,"code too deep");

	f=luaF_newproto(S->L);
	setptvalue2s(S->L,S->L->top,f); incr_top(S->L);

	f->source=LoadString(S);
	if(f->source==NULL)
		f->source=p;
	f->linedefined=LoadInt(S);
	f->lastlinedefined=LoadInt(S);
	f->nups=LoadByte(S);
	f->numparams=LoadByte(S);
	f->is_vararg=LoadByte(S);
	f->maxstacksize=LoadByte(S);
	LoadCode(S,f);
	LoadConstants(S,f);
	LoadDebug(S,f);
	IF (!luaG_checkcode(f), "bad code");
	S->L->top--;
	S->L->nCcalls--;
	return f;
}
开发者ID:rharter,项目名称:xboot-clone,代码行数:27,代码来源:lundump.c

示例4: LoadUpvalues

static void LoadUpvalues (LoadState *S, Proto *f) {
  int i, n;
  n = LoadInt(S);
  f->upvalues = luaM_newvector(S->L, n, Upvaldesc);
  f->sizeupvalues = n;
  for (i = 0; i < n; i++)
    f->upvalues[i].name = NULL;
  for (i = 0; i < n; i++) {
    f->upvalues[i].instack = LoadByte(S);
    f->upvalues[i].idx = LoadByte(S);
  }
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:12,代码来源:lundump.c

示例5: LoadFunction

static void LoadFunction(LoadState* S, Proto* f)
{
 f->linedefined=LoadInt(S);
 f->lastlinedefined=LoadInt(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadCode(S,f);
 LoadConstants(S,f);
 LoadUpvalues(S,f);
 LoadDebug(S,f);
}
开发者ID:RBACS,项目名称:KnightOnline-Projectv1886,代码行数:12,代码来源:lundump.c

示例6: LoadFunction

static void LoadFunction (LoadState *S, Proto *f, TString *psource) {
  f->source = LoadString(S);
  if (f->source == NULL)  /* no source in dump? */
    f->source = psource;  /* reuse parent's source */
  f->linedefined = LoadInt(S);
  f->lastlinedefined = LoadInt(S);
  f->numparams = LoadByte(S);
  f->is_vararg = LoadByte(S);
  f->maxstacksize = LoadByte(S);
  LoadCode(S, f);
  LoadConstants(S, f);
  LoadUpvalues(S, f);
  LoadProtos(S, f);
  LoadDebug(S, f);
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:15,代码来源:lundump.c

示例7: LoadFunction

static Proto* LoadFunction(LoadState* S)
{
 Proto* f=luaF_newproto(S->L);
 setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
 f->linedefined=LoadInt(S);
 f->lastlinedefined=LoadInt(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadCode(S,f);
 LoadConstants(S,f);
 LoadUpvalues(S,f);
 LoadDebug(S,f);
 S->L->top--;
 return f;
}
开发者ID:2or3,项目名称:PlaygroundOSS,代码行数:16,代码来源:lundump.c

示例8: TestSize

static void TestSize (LoadState* S, int s, const char* what)
{
 int r=LoadByte(S);
 if (r!=s)
  luaG_runerror(S->L,"virtual machine mismatch in %s: "
    "size of %s is %d but read %d",S->name,what,s,r);
}
开发者ID:terrordrummer,项目名称:safebikesimframework,代码行数:7,代码来源:lundump.c

示例9: TiffField

TiffUintField::TiffUintField(IFDEntry &entry, BPositionIO &io, swap_action swp)
	: TiffField(entry)
{
	if (entry.count > 0) {
		switch (entry.fieldType) {
			case TIFF_BYTE:
				fpByte = NULL;
				LoadByte(entry, io, swp);
				break;
				
			case TIFF_SHORT:
				fpShort = NULL;
				LoadShort(entry, io, swp);
				break;
				
			case TIFF_LONG:
				fpLong = NULL;
				LoadLong(entry, io, swp);
				break;
			
			default:
				finitStatus = B_BAD_TYPE;
				break;
		}
	} else
		finitStatus = B_BAD_VALUE;
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:27,代码来源:TiffUintField.cpp

示例10: LoadConstants

static void LoadConstants (LoadState* S, Proto* f)
{
 int i,n;
 n=LoadInt(S);
 f->k=luaM_newvector(S->L,n,TObject);
 f->sizek=n;
 for (i=0; i<n; i++)
 {
  TObject* o=&f->k[i];
  int t=LoadByte(S);
  switch (t)
  {
   case LUA_TNUMBER:
    setnvalue(o,LoadNumber(S));
    break;
   case LUA_TSTRING:
    setsvalue2n(o,LoadString(S));
    break;
   case LUA_TNIL:
       setnilvalue(o);
    break;
   default:
    luaG_runerror(S->L,"bad constant type (%d) in %s",t,S->name);
    break;
  }
 }
 n=LoadInt(S);
 f->p=luaM_newvector(S->L,n,Proto*);
 f->sizep=n;
 for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source);
}
开发者ID:terrordrummer,项目名称:safebikesimframework,代码行数:31,代码来源:lundump.c

示例11: i8080_hal_io_input

int i8080_hal_io_input(int port)
{
    if (use_io_space)
        return LoadPort(port);
    else
        return LoadByte((port & 0xff)<<8 | (port & 0xff));
}
开发者ID:timtashpulatov,项目名称:emu80,代码行数:7,代码来源:i8080_hal.cpp

示例12: checkHeader

static void checkHeader (LoadState *S) {
  checkliteral(S, LUA_SIGNATURE + 1, "not a");  /* 1st char already checked */
  if (LoadByte(S) != LUAC_VERSION)
    error(S, "version mismatch in");
  if (LoadByte(S) != LUAC_FORMAT)
    error(S, "format mismatch in");
  checkliteral(S, LUAC_DATA, "corrupted");
  checksize(S, int);
  checksize(S, size_t);
  checksize(S, Instruction);
  checksize(S, lua_Integer);
  checksize(S, lua_Number);
  if (LoadInteger(S) != LUAC_INT)
    error(S, "endianness mismatch in");
  if (LoadNumber(S) != LUAC_NUM)
    error(S, "float format mismatch in");
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:17,代码来源:lundump.c

示例13: LoadFunction

static Proto* LoadFunction (LoadState* S, TString* p)
{
 Proto* f=luaF_newproto(S->L);
 f->source=LoadString(S); if (f->source==NULL) f->source=p;
 f->lineDefined=LoadInt(S);
 f->nups=LoadByte(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadLines(S,f);
 LoadLocals(S,f);
 LoadUpvalues(S,f);
 LoadConstants(S,f);
 LoadCode(S,f);
#ifndef TRUST_BINARIES
 if (!luaG_checkcode(f)) luaG_runerror(S->L,"bad code in %s",S->name);
#endif
 return f;
}
开发者ID:terrordrummer,项目名称:safebikesimframework,代码行数:19,代码来源:lundump.c

示例14: LoadFunction

static Proto* LoadFunction(LoadState* S, TString* p)
{
 Proto* f=luaF_newproto(S->L);
 setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
 f->source=LoadString(S); if (f->source==NULL) f->source=p;
 f->linedefined=LoadInt(S);
 f->lastlinedefined=LoadInt(S);
 f->nups=LoadByte(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadLines(S,f);
 LoadLocals(S,f);
 LoadUpvalues(S,f);
 LoadConstants(S,f);
 LoadCode(S,f);
 IF (!luaG_checkcode(f), "bad code");
 S->L->top--;
 return f;
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:20,代码来源:lundump.c

示例15: LoadByte

static TString *LoadString (LoadState *S) {
  size_t size = LoadByte(S);
  if (size == 0xFF)
    LoadVar(S, size);
  if (size == 0)
    return NULL;
  else {
    char *s = luaZ_openspace(S->L, S->b, --size);
    LoadVector(S, s, size);
    return luaS_newlstr(S->L, s, size);
  }
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:12,代码来源:lundump.c


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