void DtPushConst( void ) { //===================== // Push constant. DXPush( IntegerValue( GetPtr() ) ); }
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 ] ); } }
PIMAGE_NT_HEADERS32 GetNTHeaders32(LPCVOID p, SIZE_T size) { try { PIMAGE_NT_HEADERS32 nt; PIMAGE_DOS_HEADER dos; if(size < sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS)) return NULL; dos = (PIMAGE_DOS_HEADER) p; if(dos->e_magic != IMAGE_DOS_SIGNATURE) return NULL; if(dos->e_lfanew + sizeof(IMAGE_NT_HEADERS) > size) return NULL; nt = (PIMAGE_NT_HEADERS32) GetPtr(dos, dos->e_lfanew); if(nt->Signature != IMAGE_NT_SIGNATURE) return NULL; if(nt->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) return NULL; return nt; } catch(...) { } return NULL; }
void DtDataDoLoop( void ) { //====================== // Process implied-DO for DATA statement. intstar4 e2; intstar4 e3; intstar4 iter_count; sym_id do_var; obj_ptr curr_fc; intstar4 e1; e3 = DXPop(); e2 = DXPop(); e1 = DXPop(); do_var = GetPtr(); do_var->u.ns.si.ms.u.value = &e1; iter_count = ( e2 - e1 + e3 ) / e3; curr_fc = FCodeTell( 0 ); while( iter_count > 0 ) { FCodeSeek( curr_fc ); FCodeSequence(); *do_var->u.ns.si.ms.u.value += e3; iter_count--; } }
void DtInpStruct( void ) { //===================== // Initialize a struct. StructInit( ((sym_id)GetPtr())->u.sd.fl.sym_fields ); }
//---------------------------------------------------------- void TContainerRise::Append( int size, char* p ) { int oldSize = mSizeUse; int newSize = mSizeUse + size; Realloc( newSize ); memcpy( GetPtr() + oldSize, p, size ); }
SReference& SReference::Cdr() const { INTELIB_ASSERT(GetPtr(), IntelibX_unexpected_unbound_value()); SExpressionCons *tp = DynamicCastGetPtr<SExpressionCons>(); INTELIB_ASSERT(tp, IntelibX_not_a_cons(*this)); return tp->Cdr(); }
PBYTE CInfoFishing::GetSendData(void) { int i, nCount; PBYTE pData, pDataTmp; DWORD dwSize; PINFOFISHINGPARAM pInfo; nCount = m_apParam.GetSize (); dwSize = GetSendDataSize (); pData = ZeroNew (dwSize); pDataTmp = pData; CopyMemoryRenew (pDataTmp, &m_dwFishingID, sizeof (m_dwFishingID), pDataTmp); /* 釣りID */ CopyMemoryRenew (pDataTmp, &m_nAverage, sizeof (m_nAverage), pDataTmp); /* 釣れる確率 */ strcpyRenew ((LPSTR)pDataTmp, m_strName, pDataTmp); /* 釣り場名 */ CopyMemoryRenew (pDataTmp, &nCount, sizeof (nCount), pDataTmp); /* 釣り情報パラメータ数 */ for (i = 0; i < nCount; i ++) { pInfo = GetPtr (i); CopyMemoryRenew (pDataTmp, &pInfo->dwItemTypeID, sizeof (pInfo->dwItemTypeID), pDataTmp); /* アイテム種別ID */ CopyMemoryRenew (pDataTmp, &pInfo->nAverage, sizeof (pInfo->nAverage), pDataTmp); /* 釣りきる確率 */ } return pData; }
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; }
RadioButton::RadioButton(Gui & mGui,int x,int y, std::string Txt) { Init(mGui); mText = new Text(Txt,x + mPositionTex[0].w,y); setPosition(x,y); mGui.AddClassGui(GetPtr()); }
PBYTE CInfoFishing::GetWriteData(int nNo, PDWORD pdwSize) { int i, nCount, *pnTmp; PBYTE pRet, pSrc; DWORD dwSize, *pdwTmp; PINFOFISHINGPARAM pInfo; pRet = NULL; pSrc = NULL; dwSize = GetDataSizeNo (nNo); *pdwSize = dwSize; nCount = m_apParam.GetSize (); if (dwSize == 0) { goto Exit; } pRet = new BYTE[dwSize]; switch (nNo) { case 0: pSrc = (PBYTE)&m_dwFishingID; break; /* 釣りID */ case 1: pSrc = (PBYTE)&m_nAverage; break; /* 釣れる確率 */ case 2: pSrc = (PBYTE)(LPCSTR)m_strName; break; /* 釣り場名 */ case 3: pSrc = (PBYTE)&nCount; break; /* 釣り情報パラメータ数 */ case 4: /* アイテム種別ID */ pdwTmp = (PDWORD)pRet; for (i = 0; i < nCount; i ++) { pInfo = GetPtr (i); pdwTmp[i] = pInfo->dwItemTypeID; } break; case 5: /* 釣りきる確率 */ pnTmp = (int *)pRet; for (i = 0; i < nCount; i ++) { pInfo = GetPtr (i); pnTmp[i] = pInfo->nAverage; } break; } if (pSrc) { CopyMemory (pRet, pSrc, dwSize); } Exit: return pRet; }
//---------------------------------------------------------- void TContainerRise::AddData(char*p, int size) { int oldSize = GetSize(); int newSize = oldSize + size; Realloc(newSize); char* pBound = GetPtr(); memcpy(pBound + oldSize, p, size); }
void CLibInfoCharCli::RenewMotionInfo(DWORD dwCharID) { int i, nCount; PCInfoCharCli pChar; if (dwCharID) { pChar = (PCInfoCharCli)GetPtr (dwCharID); RenewMotionInfo (pChar); } else { nCount = GetCount (); for (i = 0; i < nCount; i ++) { pChar = (PCInfoCharCli)GetPtr (i); RenewMotionInfo (pChar); } } }
CWord::SHomIt::SHomIt(const THomonymVector& homonyms) : Current(homonyms.begin()) , Begin(homonyms.begin()) , End(homonyms.end()) { if (Ok() && GetPtr()->IsDeleted()) operator++(); }
//----------------------------------------------------------------------------- // Name: CArrayList::Contains // Desc: Returns whether the list contains an entry identical to the // specified entry data. //----------------------------------------------------------------------------- bool CArrayList::Contains( void* pEntryData ) { for( UINT iEntry = 0; iEntry < m_NumEntries; iEntry++ ) { if( m_ArrayListType == AL_VALUE ) { if( memcmp( GetPtr(iEntry), pEntryData, m_BytesPerEntry ) == 0 ) return true; } else { if( GetPtr(iEntry) == pEntryData ) return true; } } return false; }
i32 CShaderManager::PrepareResource(ResourceWeakPtr *const ppRes) { xst_assert2( ppRes && (*ppRes).IsValid() ); auto pRes = *ppRes; Resources::IShader* pShader = (Resources::IShader*)pRes.GetPtr(); pShader->m_eProfile = this->m_eShaderProfile; pShader->m_eShaderLanguage = this->m_eShaderLang; pShader->m_eShaderType = this->m_eShaderType; if( XST_FAILED( m_pRenderSystem->GetShaderSystem()->PrepareResource( pRes.GetPtr() ) ) ) { return XST_FAIL; } //pRes->m_iResourceState = ResourceStates::PREPARED; pShader->m_iResourceState = Resources::ResourceStates::PREPARED; return XST_OK; }
PRInt64 nsAttrValue::SizeOf() const { PRInt64 size = sizeof(*this); switch (BaseType()) { case eStringBase: { // TODO: we might be counting the string size more than once. // This should be fixed with bug 677487. nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr()); size += str ? str->StorageSize() : 0; break; } case eOtherBase: { MiscContainer* container = GetMiscContainer(); if (!container) { break; } size += sizeof(*container); void* otherPtr = MISC_STR_PTR(container); // We only count the size of the object pointed by otherPtr if it's a // string. When it's an atom, it's counted separatly. if (otherPtr && static_cast<ValueBaseType>(container->mStringBits & NS_ATTRVALUE_BASETYPE_MASK) == eStringBase) { // TODO: we might be counting the string size more than once. // This should be fixed with bug 677487. nsStringBuffer* str = static_cast<nsStringBuffer*>(otherPtr); size += str ? str->StorageSize() : 0; } // TODO: mCSSStyleRule and mSVGValue might be owned by another object // which would make us count them twice, bug 677493. if (Type() == eCSSStyleRule && container->mCSSStyleRule) { // TODO: Add SizeOf() to StyleRule, bug 677503. size += sizeof(*container->mCSSStyleRule); } else if (Type() == eSVGValue && container->mSVGValue) { // TODO: Add SizeOf() to nsSVGValue, bug 677504. size += sizeof(*container->mSVGValue); } else if (Type() == eAtomArray && container->mAtomArray) { size += sizeof(container->mAtomArray) + sizeof(nsTArrayHeader); size += container->mAtomArray->Capacity() * sizeof(nsCOMPtr<nsIAtom>); // Don't count the size of each nsIAtom, they are counted separatly. } break; } case eAtomBase: // Atoms are counted separatly. case eIntegerBase: // The value is in mBits, nothing to do. break; } return size; }
void FCStmtDefineLabel( void ) { //=========================== sym_id sn; sn = GetPtr(); CGControl( O_LABEL, NULL, GetStmtLabel( sn ) ); RefStmtLabel( sn ); }
void FCStmtJmpAlways( void ) { //========================= sym_id sn; sn = GetPtr(); CGControl( O_GOTO, NULL, GetStmtLabel( sn ) ); RefStmtLabel( sn ); }
void FCOutStruct( void ) { //===================== // Output a structure. IORtnTable = OutRtn; TmpStructPtr = MkTmp( XPop(), TY_POINTER ); StructIO( ((sym_id)GetPtr())->u.sd.fl.fields ); }
intelib_integer_t SReference::GetInt() const { INTELIB_ASSERT(GetPtr(), IntelibX_unexpected_unbound_value()); SExpressionInt *si = DynamicCastGetPtr<SExpressionInt>(); if(si) return si->GetValue(); SExpressionFloat *sf = DynamicCastGetPtr<SExpressionFloat>(); if(sf) return (intelib_integer_t) (sf->GetValue()); throw IntelibX_not_a_number(*this); }
const char* SReference::GetString() const { INTELIB_ASSERT(GetPtr(), IntelibX_unexpected_unbound_value()); SExpressionString *ss = DynamicCastGetPtr<SExpressionString>(); if(ss) return ss->GetValue(); SExpressionChar *ch = DynamicCastGetPtr<SExpressionChar>(); if(ch) return ch->GetString(); throw IntelibX_not_a_string(*this); }
void DtInpArray( void ) { //==================== // Data initialize an array. sym_id fd; sym_id sym; sym = GetPtr(); fd = GetPtr(); if( fd == NULL ) { InitVar = sym; DtOffset = 0; InitArr( sym->u.ns.si.va.u.dim_ext, sym->u.ns.u1.s.typ, _SymSize( sym ) ); } else { // array field within structure InitArr( fd->u.fd.dim_ext, fd->u.fd.typ, fd->u.fd.xt.size ); } }
SReference SReference::CopyTree() const { if(!GetPtr()) return *this; SExpressionCons *cons = DynamicCastGetPtr<SExpressionCons>(); if(cons) return SReference(cons->Car().CopyTree(), cons->Cdr().CopyTree()); else return *this; }
void DtInpStructArray( void ) { //========================== // Data initialize an array of structures. InitVar = GetPtr(); DtOffset = 0; InitStructArr( InitVar->u.ns.xt.record->fl.sym_fields, InitVar->u.ns.si.va.u.dim_ext ); }
// データ削除 void pop(){ __int128 prev = 0; __int128 oldNode = 0; while(1){ oldNode = head; if(GetPtr(oldNode) == 0){ return; } prev = GetPtr(oldNode)->ptr; if(__sync_bool_compare_and_swap(&head, oldNode, prev)){ //SetPtr(GetPtr(oldNode), 0); //memset(GetPtr(oldNode), 0, sizeof(Node)); free(GetPtr(oldNode)); return; } } }
void FCInpStruct( void ) { //===================== // Input a structure. IORtnTable = InpRtn; TmpStructPtr = MkTmp( XPop(), TY_POINTER ); StructIO( ((sym_id)GetPtr())->sd.fl.fields ); }
// Map the colors of the DIB (using GetNearestPaletteIndex) to a palette //************************************************************************ void CDib::MapToPalette( HPALETTE hpal ) //************************************************************************ { int n, nDibColors; LPBYTE lpBits; LPRGBQUAD lpRgb; BYTE xlat[256]; DWORD SizeImage; BOOL bChanged; if ( !hpal ) return; if ( m_bmiHeader.biBitCount != 8 ) return; if ( GetColorTableType() == DIB_PAL_COLORS ) return; // build a xlat table. from the current DIB colors to the given palette nDibColors = GetNumColors(); lpRgb = GetColors(); bChanged = NO; for ( n=0; n<nDibColors; n++ ) { xlat[n] = (BYTE)GetNearestPaletteIndex( hpal, RGB(lpRgb->rgbRed, lpRgb->rgbGreen, lpRgb->rgbBlue) ); if ( xlat[n] != n ) bChanged = YES; lpRgb++; } if ( !bChanged ) { // Now reset the DIB color table to match the palette SetColorTable( hpal, DIB_RGB_COLORS ); return; } // translate the DIB bits lpBits = (LPBYTE)GetPtr(); SizeImage = GetSizeImage(); switch (m_bmiHeader.biCompression) { case BI_RLE8: xlatRle8(lpBits, SizeImage, xlat); break; case BI_RGB: xlatClut8(lpBits, SizeImage, xlat); break; } // Now reset the DIB color table to match the palette SetColorTable( hpal, DIB_RGB_COLORS ); }
bool GSpriteMgr::Delete(int iIndex) { GSprite* const pPoint = GetPtr(iIndex); if (pPoint) { pPoint->Release(); TMap.erase(iIndex); } return true; }
void CLibInfoCharCli::RenewGrpID(DWORD dwCharID) { int i, nCount; PCInfoCharBase pInfoChar; PCInfoItemTypeBase pInfoItemType; PCLibInfoItem pLibInfoItem; pLibInfoItem = m_pMgrData->GetLibInfoItem (); nCount = GetCount (); for (i = 0; i < nCount; i ++) { if (dwCharID == 0) { pInfoChar = (PCInfoCharBase)GetPtr (i); } else { pInfoChar = (PCInfoCharBase)GetPtr (dwCharID); if (pInfoChar == NULL) { break; } i = nCount; } /* 服 */ pInfoItemType = (PCInfoItemTypeBase)pLibInfoItem->GetItemTypePtr (pInfoChar->m_dwEquipItemIDCloth); if (pInfoItemType) { pInfoItemType->SetGrpID (&pInfoChar->m_wGrpIDCloth, &pInfoChar->m_wGrpIDSP); } /* アクセサリ */ pInfoItemType = (PCInfoItemTypeBase)pLibInfoItem->GetItemTypePtr (pInfoChar->m_dwEquipItemIDAcce1); if (pInfoItemType) { pInfoItemType->SetGrpID (&pInfoChar->m_wGrpIDAcce, NULL); } /* 持ち物 */ pInfoItemType = (PCInfoItemTypeBase)pLibInfoItem->GetItemTypePtr (pInfoChar->m_dwEquipItemIDArmsRight); if (pInfoItemType) { pInfoItemType->SetGrpID (&pInfoChar->m_wGrpIDArmsMain, &pInfoChar->m_wGrpIDArmsSub); } /* 盾 */ pInfoItemType = (PCInfoItemTypeBase)pLibInfoItem->GetItemTypePtr (pInfoChar->m_dwEquipItemIDArmsLeft); if (pInfoItemType) { pInfoItemType->SetGrpID (&pInfoChar->m_wGrpIDArmsLeftMain, &pInfoChar->m_wGrpIDArmsLeftSub); } } }