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


C++ GetU16函數代碼示例

本文整理匯總了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;
}
開發者ID:PrzemolKing,項目名稱:wedoserver,代碼行數:8,代碼來源:networkmessage.cpp

示例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 ) );
}
開發者ID:Azarien,項目名稱:open-watcom-v2,代碼行數:11,代碼來源:fcio.c

示例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();
	}
開發者ID:cskilbeck,項目名稱:MakeTheWords,代碼行數:49,代碼來源:Dictionary.cpp

示例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 ] );
    }
}
開發者ID:ABratovic,項目名稱:open-watcom-v2,代碼行數:29,代碼來源:fcdata.c

示例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;
}
開發者ID:ABratovic,項目名稱:open-watcom-v2,代碼行數:28,代碼來源:fcdata.c

示例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
}
開發者ID:ABratovic,項目名稱:open-watcom-v2,代碼行數:28,代碼來源:fcdata.c

示例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 ) );
}
開發者ID:Azarien,項目名稱:open-watcom-v2,代碼行數:25,代碼來源:fclogic.c

示例8: FCMulMixCX

void    FCMulMixCX( void ) {
//====================

// Multiply a complex by a scalar.

    XMulDivMix( O_TIMES, true, GetU16() );
}
開發者ID:Azarien,項目名稱:open-watcom-v2,代碼行數:7,代碼來源:fccmplx.c

示例9: FCCat

void    FCCat( void ) {
//===============

// Do concatenation operation.

    XPush( Concat( GetU16(), XPop() ) );
}
開發者ID:Ukusbobra,項目名稱:open-watcom-v2,代碼行數:7,代碼來源:fcstring.c

示例10: FCFreeLabel

void    FCFreeLabel( void ) {
//=====================

// Free specified label since it will no longer be referenced.

    DoneLabel( GetU16() );
}
開發者ID:bhanug,項目名稱:open-watcom-v2,代碼行數:7,代碼來源:fcflow.c

示例11: FCMulMixXC

void    FCMulMixXC( void ) {
//====================

// Multiply a scalar by a complex.

    XMulDivMix( O_TIMES, false, GetU16() );
}
開發者ID:Azarien,項目名稱:open-watcom-v2,代碼行數:7,代碼來源:fccmplx.c

示例12: FCDivMixCX

void    FCDivMixCX( void ) {
//====================

// Divide a complex by a scalar.

    XMulDivMix( O_DIV, true, GetU16() );
}
開發者ID:Azarien,項目名稱:open-watcom-v2,代碼行數:7,代碼來源:fccmplx.c

示例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
}
開發者ID:Azarien,項目名稱:open-watcom-v2,代碼行數:17,代碼來源:fccmplx.c

示例14: DtUMinus

void    DtUMinus( void ) {
//==================

// Negate constant.

    DXPush( -DXPop() );
    GetU16();   // skip typing information
}
開發者ID:ABratovic,項目名稱:open-watcom-v2,代碼行數:8,代碼來源:fcdata.c

示例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() ) );
}
開發者ID:bhanug,項目名稱:open-watcom-v2,代碼行數:17,代碼來源:fcflow.c


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