本文整理汇总了C++中GetU16函数的典型用法代码示例。如果您正苦于以下问题:C++ GetU16函数的具体用法?C++ GetU16怎么用?C++ GetU16使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetU16函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetU16
Position NetworkMessage::GetPosition()
{
Position pos;
pos.x = GetU16();
pos.y = GetU16();
pos.z = GetByte();
return pos;
}
示例2: FCPassLabel
void FCPassLabel( void ) {
//=====================
// Pass label to run-time routine.
call_handle handle;
handle = InitCall( GetU16() );
CGAddParm( handle, CGBackName( (back_handle)GetLabel( GetU16() ), TY_POINTER ), TY_POINTER );
CGDone( CGCall( handle ) );
}
示例3: mDefinition
Dictionary::Dictionary(char const *filename) : mDefinition(null)
{
mFile = LoadFile("english.dictionary", &mFileSize);
if(mFile != null)
{
uint8 const *p = mFile;
uint8 const *bufferEnd = p + mFileSize;
char const *id = (char const *)p;
if(strncmp(id, "dictionary", 10) == 0)
{
p += 10;
mVersion = GetU16(p);
mNumWords = GetU32(p);
mWord = (char *)p;
p += mNumWords * 8;
mDefinition = new char *[mNumWords];
int wordIndex = 0;
while(p < bufferEnd)
{
mDefinition[wordIndex] = (char *)p;
uint16 definitionMask = GetU16(p);
for(int i = 0; i < eWordType::kNumWordTypes; ++i)
{
if((definitionMask & (1 << i)) != 0)
{
if(*p++ == eReferenceType::kNone)
{
p += strlen((char *)p) + 1;
}
else
{
p += 3;
}
}
}
++wordIndex;
}
}
}
SaveAsJSON();
}
示例4: DtFieldSubstring
void DtFieldSubstring( void ) {
//==========================
// Data initialize a substring character item within a structure.
sym_id fd;
intstar4 base;
intstar4 first;
intstar4 last;
char name[MAX_SYMLEN+1];
base = DXPop();
first = DXPop();
fd = GetPtr();
last = GetInt();
if( last != 0 ) {
last += first - 1;
} else {
last = DXPop();
}
GetU16(); // skip typing information
if( DoSubstring( first, last, fd->u.fd.xt.size ) ) {
DXPush( base + first - 1 );
DtItemSize = last - first + 1;
} else {
STFieldName( fd, name );
Error( EV_SSTR_INVALID, name, StmtKeywords[ PR_DATA ] );
}
}
示例5: DtSubstring
void DtSubstring( void ) {
//=====================
// Data initialize a character substring.
intstar4 first;
intstar4 last;
sym_id cv;
cv = GetPtr();
GetU16(); // skip typing information
first = DXPop();
if( cv != NULL ) {
if( DtFlags & DT_SS_NO_HIGH ) {
last = cv->u.ns.xt.size;
DtFlags &= ~DT_SS_NO_HIGH;
} else {
last = DXPop();
}
} else {
last = first + GetInt() - 1;
}
if( !DoSubstring( first, last, InitVar->u.ns.xt.size ) ) {
NameStmtErr( EV_SSTR_INVALID, InitVar, PR_DATA );
}
DtOffset += first - 1;
DtItemSize = last - first + 1;
}
示例6: DtExp
void DtExp( void ) {
//===============
// Exponentiate constants.
intstar4 op2;
intstar4 op1;
intstar4 result;
op1 = DXPop();
op2 = DXPop();
if( op1 == 0 ) {
if( op2 <= 0 ) {
Error( EX_Z_2_NOT_POS );
}
DXPush( 0 );
} else if( op2 < 0 ) {
DXPush( 0 );
} else {
result = 1;
while( op2 != 0 ) {
result *= op1;
--op2;
}
DXPush( result );
}
GetU16(); // skip typing information
}
示例7: Equivalent
static void Equivalent( cg_op op_code ) {
//===========================================
cg_name op1;
cg_name op2;
unsigned_16 typ_info;
cg_type typ1;
cg_type typ2;
typ_info = GetU16();
typ1 = GetType1( typ_info );
typ2 = GetType2( typ_info );
op1 = XPopValue( typ1 );
op2 = XPopValue( typ2 );
typ1 = CGType( op1 );
if( typ1 != TY_BOOLEAN ) {
op1 = CGCompare( O_NE, op1, CGInteger( 0, typ1 ), typ1 );
}
typ2 = CGType( op2 );
if( typ2 != TY_BOOLEAN ) {
op2 = CGCompare( O_NE, op2, CGInteger( 0, typ2 ), typ2 );
}
XPush( CGCompare( op_code, op1, op2, TY_UINT_1 ) );
}
示例8: FCMulMixCX
void FCMulMixCX( void ) {
//====================
// Multiply a complex by a scalar.
XMulDivMix( O_TIMES, true, GetU16() );
}
示例9: FCCat
void FCCat( void ) {
//===============
// Do concatenation operation.
XPush( Concat( GetU16(), XPop() ) );
}
示例10: FCFreeLabel
void FCFreeLabel( void ) {
//=====================
// Free specified label since it will no longer be referenced.
DoneLabel( GetU16() );
}
示例11: FCMulMixXC
void FCMulMixXC( void ) {
//====================
// Multiply a scalar by a complex.
XMulDivMix( O_TIMES, false, GetU16() );
}
示例12: FCDivMixCX
void FCDivMixCX( void ) {
//====================
// Divide a complex by a scalar.
XMulDivMix( O_DIV, true, GetU16() );
}
示例13: FCMulCmplx
void FCMulCmplx( void ) {
//====================
// Multiply one complex number by another.
#if _CPU == 8086 || _CPU == 386
if( CPUOpts & CPUOPT_FPC ) {
// generate call to runtime complex multiply
XCmplxOp( RT_C8MUL );
} else {
// do multiplication inline
InLineMulCC( GetU16() );
}
#else
// For risc we just inline the entire code
InLineMulCC( GetU16() );
#endif
}
示例14: DtUMinus
void DtUMinus( void ) {
//==================
// Negate constant.
DXPush( -DXPop() );
GetU16(); // skip typing information
}
示例15: FCJmpFalse
void FCJmpFalse( void ) {
//====================
unsigned_16 typ_info;
cg_type typ;
cg_name bool_expr;
typ_info = GetU16();
typ = GetType( typ_info );
if( IntType( typ_info ) ) {
bool_expr = CGCompare( O_NE, XPopValue( typ ),
CGInteger( 0, typ ), typ );
} else {
bool_expr = XPopValue( typ );
}
CGControl( O_IF_FALSE, bool_expr, GetLabel( GetU16() ) );
}