本文整理汇总了C++中LoadBlock函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadBlock函数的具体用法?C++ LoadBlock怎么用?C++ LoadBlock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadBlock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h);
LoadBlock(S,s,LUAC_HEADERSIZE);
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:drkvogel,项目名称:retrasst,代码行数:8,代码来源:lundump.c
示例2: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h, '=');
LoadBlock(S,s,LUAC_HEADERSIZE);
S->swap=(s[6]!=h[6]); s[6]=h[6];
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:CSE380Skulls,项目名称:ForceOfReaction,代码行数:9,代码来源:lundump.c
示例3: LoadMem
static void LoadMem (LoadState* S, void* b, int n, size_t size)
{
LoadBlock(S,b,n*size);
if (S->swap && b)
{
char* p=(char*) b;
char c;
switch (size)
{
case 1:
break;
case 2:
while (n--)
{
c=p[0];
p[0]=p[1];
p[1]=c;
p+=2;
}
break;
case 4:
while (n--)
{
c=p[0];
p[0]=p[3];
p[3]=c;
c=p[1];
p[1]=p[2];
p[2]=c;
p+=4;
}
break;
case 8:
while (n--)
{
c=p[0];
p[0]=p[7];
p[7]=c;
c=p[1];
p[1]=p[6];
p[6]=c;
c=p[2];
p[2]=p[5];
p[5]=c;
c=p[3];
p[3]=p[4];
p[4]=c;
p+=8;
}
break;
default:
IF(1, "bad size");
break;
}
}
}
开发者ID:CobooGuo,项目名称:elua,代码行数:56,代码来源:lundump.c
示例4: XERROR
BOOL XBaseProp::Load( LPCTSTR szFilename, XE::xtENCODING encode )
{
CToken token;
if( token.LoadFile( szFilename, XE::TXT_UTF16 ) == xFAIL )
{
XERROR( "%s 읽기 실패", szFilename );
return FALSE;
}
return LoadBlock( token, NULL, NULL );
}
开发者ID:xahgo,项目名称:tama,代码行数:10,代码来源:XBaseProp.cpp
示例5: fin
void BufferManager::LoadTable(Table table){
string filename=table.name+".table";
fstream fin(filename.c_str(),ios::in);
for(int i=0;i<table.blockNum;i++)
if(IfinBuffer(filename,i)==-1){
int bufferID=GetEmptyBlockExcept(filename);
LoadBlock(filename,i,bufferID);
}
fin.close();
}
开发者ID:Adward-R,项目名称:MiniSQL,代码行数:10,代码来源:BufferManager.cpp
示例6: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h);
if ( h[8] > SIZE_T_PRECOMPILED_CHUNK )
h[8] = SIZE_T_PRECOMPILED_CHUNK;
LoadBlock(S,s,LUAC_HEADERSIZE);
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:AdiBoy,项目名称:mtasa-blue,代码行数:10,代码来源:lundump.c
示例7: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h);
LoadBlock(S,s,LUAC_HEADERSIZE);
S->flip = h[ENDIAN_OFFSET] != s[ENDIAN_OFFSET];
s[ENDIAN_OFFSET] = h[ENDIAN_OFFSET];
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:goofwear,项目名称:stepmania,代码行数:10,代码来源:lundump.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: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h);
LoadBlock(S,s,LUAC_HEADERSIZE);
#ifdef LUAC_SWAP_ON_LOAD
S->swap=(s[6]!=h[6]); s[6]=h[6];
#endif
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:11,代码来源:lundump.c
示例10: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h);
LoadBlock(S,s,LUAC_HEADERSIZE);
if (memcmp(h,s,N0)==0) return;
if (memcmp(h,s,N1)!=0) error(S,"not a");
if (memcmp(h,s,N2)!=0) error(S,"version mismatch in");
if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted");
}
开发者ID:BackupTheBerlios,项目名称:rsxplusplus-svn,代码行数:11,代码来源:lundump.c
示例11: LoadString
static TString* LoadString(LoadState* S)
{
int size=LoadInt(S);
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:goofwear,项目名称:stepmania,代码行数:12,代码来源:lundump.c
示例12: LoadString
static TString* LoadString (lua_State* L, ZIO* Z, int swap)
{
size_t size=LoadSize(L,Z,swap);
if (size==0)
return NULL;
else
{
char* s=luaO_openspace(L,size);
LoadBlock(L,s,size,Z,0);
return luaS_newlstr(L,s,size-1); /* remove trailing '\0' */
}
}
开发者ID:rparet,项目名称:darkpawns,代码行数:12,代码来源:lundump.c
示例13: LoadDebug
static void LoadDebug(LoadState* S, Proto* f)
{
int i,n;
n=LoadInt(S);
Align4(S);
#ifdef LUA_OPTIMIZE_DEBUG
if(n) {
if (!luaZ_direct_mode(S->Z)) {
f->packedlineinfo=luaM_newvector(S->L,n,unsigned char);
LoadBlock(S,f->packedlineinfo,n);
} else {
开发者ID:3dot3,项目名称:nodemcu-firmware,代码行数:12,代码来源:lundump.c
示例14: LoadHeader
static void LoadHeader(LoadState* S)
{
lu_byte h[LUAC_HEADERSIZE];
lu_byte s[LUAC_HEADERSIZE];
luaU_header(h);
memcpy(s,h,sizeof(char)); /* first char already read */
LoadBlock(S,s+sizeof(char),LUAC_HEADERSIZE-sizeof(char));
if (memcmp(h,s,N0)==0) return;
if (memcmp(h,s,N1)!=0) error(S,"not a");
if (memcmp(h,s,N2)!=0) error(S,"version mismatch in");
if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted");
}
开发者ID:2or3,项目名称:PlaygroundOSS,代码行数:12,代码来源:lundump.c
示例15: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
int intck = (((lua_Number)0.5)==0); /* 0=float, 1=int */
luaU_header(h);
LoadBlock(S,s,LUAC_HEADERSIZE);
S->swap=(s[6]!=h[6]); s[6]=h[6]; /* Check if byte-swapping is needed */
S->numsize=h[10]=s[10]; /* length of lua_Number */
S->toflt=(s[11]>intck); /* check if conversion from int lua_Number to flt is needed */
if(S->toflt) s[11]=h[11];
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:BackupTheBerlios,项目名称:elua-svn,代码行数:13,代码来源:lundump.c
示例16: LoadString
static killa_TString* LoadString(LoadState* S)
{
size_t size;
LoadVar(S,size);
if (size==0)
return NULL;
else
{
char* s=killaZ_openspace(S->L,S->b,size);
LoadBlock(S,s,size*sizeof(char));
return killaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
}
}
开发者ID:caivega,项目名称:Killa,代码行数:13,代码来源:kundump.c
示例17: LoadString
static TString* LoadString(LoadState* S)
{
size_t size;
LoadVar(S,size);
if (size==0)
return nullptr;
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:Isaacssv552,项目名称:ufoai,代码行数:13,代码来源:lundump.cpp
示例18: GetBlocks
vector<Block> GetBlocks(const LocatorHashes& locators, const HashValue& hashStop) override {
vector<Block> r;
int idx = locators.FindIndexInMainChain();
EXT_LOCK (MtxSqlite) {
SqliteCommand cmd(EXT_STR("SELECT id, hash, data, txhashes FROM blocks WHERE id>" << idx << " ORDER BY id LIMIT " << 2000 + locators.DistanceBack), m_db);
for (DbDataReader dr = cmd.ExecuteReader(); dr.Read();) {
Block block = LoadBlock(dr);
r.push_back(block);
if (Hash(block) == hashStop)
break;
}
}
return r;
}
开发者ID:sirmax1,项目名称:coin,代码行数:14,代码来源:backend-sqlite.cpp
示例19: LoadHeader
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
LuaDumpConfig config;
config.endianness = (luaU_getHostOrder() == WWS_LUA_LITTLE_ENDIAN) ? 1 : 0;
config.sizeof_int = sizeof(int);
config.sizeof_size_t = sizeof(size_t);
config.sizeof_lua_Number = sizeof(lua_Number);
luaU_header(h, &config);
LoadBlock(S,s,LUAC_HEADERSIZE);
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
开发者ID:arsaccol,项目名称:SLED,代码行数:15,代码来源:lundump.c
示例20: 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
注:本文中的LoadBlock函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论