當前位置: 首頁>>代碼示例>>C++>>正文


C++ DumpVar函數代碼示例

本文整理匯總了C++中DumpVar函數的典型用法代碼示例。如果您正苦於以下問題:C++ DumpVar函數的具體用法?C++ DumpVar怎麽用?C++ DumpVar使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DumpVar函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DumpString

static void DumpString(const killa_TString* s, DumpState* D)
{
 if (s==NULL)
 {
  size_t size=0;
  DumpVar(size,D);
 }
 else
 {
  size_t size=s->tsv.len+1;		/* include trailing '\0' */
  DumpVar(size,D);
  DumpBlock(killa_getstr(s),size*sizeof(char),D);
 }
}
開發者ID:caivega,項目名稱:Killa,代碼行數:14,代碼來源:kdump.c

示例2: DumpString

static void DumpString(const LuaString* s, DumpState* D)
{
 if (s==NULL)
 {
  size_t size=0;
  DumpVar(size,D);
 }
 else
 {
  size_t size=s->getLen()+1;		/* include trailing '\0' */
  DumpVar(size,D);
  DumpBlock(s->c_str(),size*sizeof(char),D);
 }
}
開發者ID:aappleby,項目名稱:Lumina,代碼行數:14,代碼來源:ldump.cpp

示例3: DumpString

static void DumpString(const TString* s, DumpState* D)
{
 if (s==NULL || getstr(s)==NULL)
 {
  size_t size=0;
  DumpVar(size,D);
 }
 else
 {
  size_t size=s->tsv.len+1;        /* include trailing '\0' */
  DumpVar(size,D);
  DumpBlock(getstr(s),size,D);
 }
}
開發者ID:catyguan,項目名稱:gamedev.platform,代碼行數:14,代碼來源:ldump.c

示例4: DumpString

static void DumpString(const TString* s, DumpState* D)
{
 if (s==NULL || getstr(s)==NULL)
 {
  // LOOM: This was using size_t whereas the LoadString in undump is using in32_t, this
  // will break bytecode compiled under 64 bit
  int32_t size=0;
  DumpVar(size,D);
 }
 else
 {
  // LOOM: This was using size_t whereas the LoadString in undump is using in32_t, this
  // will break bytecode compiled under 64 bit  
  int32_t size=s->tsv.len+1;		/* include trailing '\0' */
  DumpVar(size,D);
  DumpBlock(getstr(s),size,D);
 }
}
開發者ID:24BitGames,項目名稱:LoomSDK,代碼行數:18,代碼來源:ldump.c

示例5: DumpNumber

static void DumpNumber(lua_Number x, DumpState* D)
{
#if defined( LUA_NUMBER_INTEGRAL ) && !defined( LUA_CROSS_COMPILER )
  DumpIntWithSize(x,D->target.sizeof_lua_Number,D);
#else // #if defined( LUA_NUMBER_INTEGRAL ) && !defined( LUA_CROSS_COMPILER )
 if (D->target.lua_Number_integral)
 {
  if (((float)(int)x)!=x) D->status=LUA_ERR_CC_NOTINTEGER;
  DumpIntWithSize(x,D->target.sizeof_lua_Number,D);
 }
 else
 {
  switch(D->target.sizeof_lua_Number)
  {
   /* do we need bounds checking? */
   case 4: {
    float y=x;
    MaybeByteSwap((char*)&y,4,D);
    DumpVar(y,D);
   } break;
   case 8: {
    double y=x;
    // ARM FPA mode: keep endianness, but swap high and low parts of the 
    // memory representation. This is the default compilation mode for ARM 
    // targets with non-EABI gcc
    if(D->target.is_arm_fpa)
    {
      char *pnum=(char*)&y, temp[4];
      memcpy(temp,pnum,4);
      memcpy(pnum,pnum+4,4);
      memcpy(pnum+4,temp,4);
    }    
    MaybeByteSwap((char*)&y,8,D);
    DumpVar(y,D);
   } break;
   default: lua_assert(0);
  }
 }
#endif // #if defined( LUA_NUMBER_INTEGRAL ) && !defined( LUA_CROSS_COMPILER )
}
開發者ID:01org,項目名稱:incubator-mynewt-core,代碼行數:40,代碼來源:ldump.c

示例6: DumpWString

static void DumpWString(TString* s, DumpState* D)
{
 if (s==NULL || getwstr(s)==NULL)
 {
  size_t size=0;
  DumpVar(size,D);
 }
 else
 {
  size_t size=s->tsv.len+1;		/* include trailing '\0' */
  DumpVector(getwstr(s),size,2,D);
 }
}
開發者ID:LTears,項目名稱:rktotal,代碼行數:13,代碼來源:ldump.c

示例7: DumpString

static void DumpString (const TString *s, DumpState *D) {
  if (s == NULL)
    DumpByte(0, D);
  else {
    size_t size = s->len + 1;  /* include trailing '\0' */
    if (size < 0xFF)
      DumpByte(cast_int(size), D);
    else {
      DumpByte(0xFF, D);
      DumpVar(size, D);
    }
    DumpVector(getstr(s), size - 1, D);  /* no need to save '\0' */
  }
}
開發者ID:141141,項目名稱:nodemcu-firmware-lua5.3.0,代碼行數:14,代碼來源:ldump.c

示例8: DumpSize

static void DumpSize(uint32_t x, DumpState* D)
{
 /* dump unsigned integer */
 switch(D->target.sizeof_strsize_t) {
  case 1: {
   if (x>0xFF) D->status=LUA_ERR_CC_INTOVERFLOW; 
   DumpChar(x,D);
  } break;
  case 2: {
   if (x>0xFFFF) D->status=LUA_ERR_CC_INTOVERFLOW;
   uint16_t y=(uint16_t)x;
   MaybeByteSwap((char*)&y,2,D);
   DumpVar(y,D);
  } break;
  case 4: {
   /* Reduce bounds to avoid messing 32-bit compilers up */
   if (x>0xFFFFFFFE) D->status=LUA_ERR_CC_INTOVERFLOW;
   uint32_t y=x;
   MaybeByteSwap((char*)&y,4,D);
   DumpVar(y,D);
  } break;
  default: lua_assert(0);
 }
}
開發者ID:01org,項目名稱:incubator-mynewt-core,代碼行數:24,代碼來源:ldump.c

示例9: DumpIntWithSize

static void DumpIntWithSize(int x, int sizeof_int, DumpState* D)
{
 /* dump signed integer */
 switch(sizeof_int) {
  case 1: {
   if (x>0x7F || x<(-0x80)) D->status=LUA_ERR_CC_INTOVERFLOW; 
   DumpChar(x,D);
  } break;
  case 2: {
   if (x>0x7FFF || x<(-0x8000)) D->status=LUA_ERR_CC_INTOVERFLOW; 
   int16_t y=(int16_t)x;
   MaybeByteSwap((char*)&y,2,D);
   DumpVar(y,D);
  } break;
  case 4: {
   /* Need to reduce bounds by 1 to avoid messing 32-bit compilers up */
   if (x>0x7FFFFFFE || x<(-0x7FFFFFFF)) D->status=LUA_ERR_CC_INTOVERFLOW; 
   int32_t y=(int32_t)x;
   MaybeByteSwap((char*)&y,4,D);
   DumpVar(y,D);
  } break;
  default: lua_assert(0);
 }
}
開發者ID:01org,項目名稱:incubator-mynewt-core,代碼行數:24,代碼來源:ldump.c

示例10: DumpInteger

static void DumpInteger (lua_Integer x, DumpState *D) {
  DumpVar(x, D);
}
開發者ID:ezEngine,項目名稱:ezEngine,代碼行數:3,代碼來源:ldump.c

示例11: DumpNumber

static void DumpNumber (lua_Number x, DumpState *D) {
  DumpVar(x, D);
}
開發者ID:ezEngine,項目名稱:ezEngine,代碼行數:3,代碼來源:ldump.c

示例12: DumpInt

static void DumpInt (int x, DumpState *D) {
  DumpVar(x, D);
}
開發者ID:ezEngine,項目名稱:ezEngine,代碼行數:3,代碼來源:ldump.c

示例13: DumpByte

static void DumpByte (int y, DumpState *D) {
  lu_byte x = (lu_byte)y;
  DumpVar(x, D);
}
開發者ID:ezEngine,項目名稱:ezEngine,代碼行數:4,代碼來源:ldump.c

示例14: DumpChar

static void DumpChar(int y, DumpState* D)
{
    char x=(char)y;
    DumpVar(x,D);
}
開發者ID:luiseduardohdbackup,項目名稱:lua4wince,代碼行數:5,代碼來源:ldump.c

示例15: DumpNumber

static void DumpNumber(ktap_number x, DumpState *D)
{
	DumpVar(x,D);
}
開發者ID:atmark-techno,項目名稱:linux-3.14-at,代碼行數:4,代碼來源:dump.c


注:本文中的DumpVar函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。