当前位置: 首页>>代码示例>>C++>>正文


C++ DASSERT函数代码示例

本文整理汇总了C++中DASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ DASSERT函数的具体用法?C++ DASSERT怎么用?C++ DASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetPeer

void AwtMenuItem::DoCommand()
{
    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);

    // peer is sun.awt.windows.WMenuItemPeer
    jobject peer = GetPeer(env);

    if (IsCheckbox()) {
        UINT nState = ::GetMenuState(GetMenuContainer()->GetHMenu(),
                                     GetID(), MF_BYCOMMAND);
        DASSERT(nState != 0xFFFFFFFF);
        DoCallback("handleAction", "(Z)V", ((nState & MF_CHECKED) == 0));
    } else {
        DoCallback("handleAction", "(JI)V", TimeHelper::getMessageTimeUTC(),
                   (jint)AwtComponent::GetJavaModifiers());
    }
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:17,代码来源:awt_MenuItem.cpp

示例2: DASSERT

void BubOpenMouthFallingAnimator::OnStopFalling(Sprite * sprite){
	DASSERT( sprite == this->GetSprite() );
	REMOVE_FROM_ACTION_ANIMATOR( this );

	MovingAnimation *fra= (MovingAnimation*)AnimationsParser::GetAnimation("BubStand");
	Sprite *n_sprite=new Sprite(this->GetSprite()->GetX(),this->GetSprite()->GetY(),
		this->GetSprite()->IsGravityAddicted(),AnimationFilmHolder::GetFilm("BubWalk"), 
						Terrain::GetActionLayer(), this->GetSprite()->GoesLeft());
	n_sprite->SetIsBub(this->GetSprite()->IsBub());
	BubStandAnimator *frtor=new BubStandAnimator();
	frtor->RegistCollitions(n_sprite);
	START_ANIMATOR( frtor, n_sprite, fra, GetGameTime() );
	DESTROY_ANIMATOR( this );

	//logic
	REFRESH_KILLED_ENEMIES_COUNTER();
}
开发者ID:AngelKyriako,项目名称:PROJECT-HY454-2012,代码行数:17,代码来源:BubAnimator.cpp

示例3: SCState

SCState* CompStates::getState(int index)
{
    s_it it = states.find(index);
    if(it!=states.end())
    {
        return it->second;
    }
    else
    {
        pair<s_it, bool> ret = states.insert(pair<int, SCState*>(index, new SCState(parent)));
        DASSERT(ret.second);
        return ret.first->second;
    }
   
   
    return NULL;
}
开发者ID:tenso,项目名称:subphonic,代码行数:17,代码来源:m_state.cpp

示例4: GetMenuContainer

void AwtMenuItem::SetState(BOOL isChecked)
{
    AwtMenu* menu = GetMenuContainer();
    /* Fix for bug 4257944 by [email protected]
    * check parent
    */
    if (menu == NULL) return;
    DASSERT(menu != NULL && GetID() >= 0);
    VERIFY(::CheckMenuItem(menu->GetHMenu(), GetID(),
                           MF_BYCOMMAND | (isChecked ? MF_CHECKED : MF_UNCHECKED))
           != 0xFFFFFFFF);

    // Redraw menu bar if it was affected.
    if (menu->GetMenuBar() == menu) {
        ::DrawMenuBar(menu->GetOwnerHWnd());
    }
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:17,代码来源:awt_MenuItem.cpp

示例5: DLTRACEIN

// ---------------------------------------------------------------------------
// Decides whether the download can start or not
// ---------------------------------------------------------------------------
//
TInt CCatalogsHttpDownloadManager::StartOperation(
    MCatalogsHttpOperation* aOperation )
{
    DLTRACEIN(( "" ));
    DASSERT( aOperation );
    TInt err = iManager.StartOperation( aOperation, EFalse );
    if ( err == KErrNone || err == KCatalogsHttpOperationQueued )
    {
        TInt err2 = MoveRestoredDlToCurrentDls( *aOperation );
        // Check for unwanted errors
        if ( err2 != KErrNone && err2 != KErrNotFound )
        {
            return err2;
        }
    }
    return err;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:21,代码来源:catalogshttpdownloadmanagerimpl.cpp

示例6: DASSERT

	const string MultiPlayerMenu::cellText(int server_id, int col_id) const {
		DASSERT(server_id >= 0 && server_id < (int)m_servers.size());
		const auto &row = m_servers[server_id];

		if(col_id == 0)
			return row.server_name;
		else if(col_id == 1)
			return row.map_name;
		else if(col_id == 2)
			return format("% / %", row.num_players, row.max_players);
		else if(col_id == 3)
			return toString(row.game_mode);
		else if(col_id == 4)
			return format("%", row.ping);

		return string();
	}
开发者ID:nadult,项目名称:FreeFT,代码行数:17,代码来源:multi_player_menu.cpp

示例7: DASSERT

void GOctScale::setState(SoundCompEvent* e)
{
    DASSERT(e!=NULL);
    if(e->empty())return;
    if(e->getSize()!=sizeof(State))
    {
        DERROR("size missmatch");
        if(e->getSize() < sizeof(State))return;
	
        DERROR("trying to read...");
    }
    const State* s = (const State*)e->getData();
   
    ns->setValue(s->noct);
   
    update();
}
开发者ID:tenso,项目名称:subphonic,代码行数:17,代码来源:g_octscale.cpp

示例8: DLTRACEIN

void CNcdNodeContentInfoProxy::InternalizeDataL( RReadStream& aStream )
    {
    DLTRACEIN((""));

    // First read the class id. Because, it is the first thing in the stream.
    TInt classId( aStream.ReadInt32L() );
    
    if ( classId != NcdNodeClassIds::ENcdNodeContentInfoClassId )
        {
        // classId is not recognized
        DLERROR(("Class id was not recognized!"));
        // For testing purposes assert here
        DASSERT( EFalse );
        
        // Otherwise leave is adequate
        User::Leave( KErrCorrupt );
        }

    iPurpose = aStream.ReadUint16L();
    DLINFO(( "Purpose: %u", iPurpose ));
    
    InternalizeDesL( iMimeType, aStream );    
    DLINFO(( _L("Mime: %S"), iMimeType ));
    
    //The Internalization here must be consistant with the externalization in CNcdNodeContentInfo
    if ( iMimeType->Compare( KMimeTypeMatchWidget ) == 0 )
        {
        //widget
        InternalizeDesL( iIdentifier, aStream );
        }
    else
        {
        //sis
        iUid.iUid = aStream.ReadInt32L();   
        DLINFO(( "Uid: %x", iUid.iUid )); 
        }
   
    InternalizeDesL( iVersion, aStream );    
    DLINFO(( _L("Version: %S"), iVersion ));

    iSize = aStream.ReadInt32L();
    DLINFO(( _L("Size: %d"), iSize ));
    
    DLTRACEOUT((""));
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:45,代码来源:ncdnodecontentinfoproxy.cpp

示例9: file_get_page

page_hdr_t* file_get_page(file_t* file, page_id_t pageid)
{
    page_hdr_t* page;
    page_id_t oldid;
    void* oldptr;
    
#if !defined(NDEBUG)
    if (pageid >= file->size) {
        fprintf(stderr, "file_get_page: requested page %u, file has %u pages\n",
                pageid, file->size);
        DASSERT(0);
    }
#endif /* !defined(NDEBUG) */

    /* Try to find an already mapped page in the cache. */
    page = (page_hdr_t*)cache_get_page(&file->cache, pageid);
    if (page != NULL)
        return page;

    /* Page was not found in the cache, need to map it. */
    page = (page_hdr_t*)os_get_page(file->handle, pageid);
    if (page == NULL) {
        file_dump_info(file);
        return NULL;
    }

    file->stats.mapped++;
    DPRINT("get_page: mapped page %u (%p)\n", pageid, page);
    
    /* Update the cache. */
    if (cache_replace(&file->cache, pageid, page, &oldid, &oldptr) == 0) {
        if (oldptr != NULL) {
            DPRINT("get_page: unmapping cached page %u (%p)\n", oldid,
                   oldptr);
            if (os_put_page(file->handle, oldptr) == 0)
                file->stats.unmapped++;
        }
    }
    else {
        /* Page could not be placed in the cache. */
        file->stats.ncmapped++;
    }

    return page;
}
开发者ID:acampbell,项目名称:kscope,代码行数:45,代码来源:file.c

示例10: DASSERT

void TypeSetConstraint::format(FormatStream & out) const {
  static int recursionCheck = 0;
  ++recursionCheck;
  DASSERT(recursionCheck < 50);

  QualifiedTypeSet expansion;
  expandImpl(expansion, 0);
  out << "{";
  for (QualifiedTypeSet::iterator it = expansion.begin(); it != expansion.end(); ++it) {
    if (it != expansion.begin()) {
      out << "|";
    }

    out << *it;
  }
  out << "}";
  --recursionCheck;
}
开发者ID:afrog33k,项目名称:tart,代码行数:18,代码来源:TypeConstraint.cpp

示例11: DASSERT

void AwtObjectList::Cleanup()
{
    DASSERT(GetCurrentThreadId() == AwtToolkit::MainThread());

    CriticalSection::Lock l(theAwtObjectList.m_lock);

    AwtObjectListItem* item = theAwtObjectList.m_head;
    if (item != NULL) {
	while (item != NULL) {
            // The AwtObject's destructor will call AwtObjectList::Remove(),
            // which will delete the item structure.
	    AwtObjectListItem* next = item->next;
            delete item->obj;
	    item = next;
	}
    }
    theAwtObjectList.m_head = NULL;
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:18,代码来源:ObjectList.cpp

示例12: DASSERT

	ImageButtonProto::ImageButtonProto(const char *back_tex, const char *up_tex, const char *down_tex, const char *font_name, FRect text_area) {
		DASSERT(up_tex && down_tex);

		if(back_tex)
			back = DTexture::gui_mgr[back_tex];

		up = DTexture::gui_mgr[up_tex];
		down = DTexture::gui_mgr[down_tex];
		if(font_name)
			font = Font::mgr[font_name];

		rect = IRect({0, 0}, back? back->size() : max(up->size(), down->size()));
		text_rect = text_area.isEmpty()? IRect::empty() :
			IRect(	lerp(float(rect.min.x), float(rect.max.x), text_area.min.x),
					lerp(float(rect.min.y), float(rect.max.y), text_area.min.y),
					lerp(float(rect.min.x), float(rect.max.x), text_area.max.x),
					lerp(float(rect.min.y), float(rect.max.y), text_area.max.y));
	}
开发者ID:dreamsxin,项目名称:FreeFT,代码行数:18,代码来源:image_button.cpp

示例13: rem

	/* Remove a tag and it's associated val from the list. Returns false
		if the tag wasn't found, or true if it was and was removed. */
	bool rem(const char *tag)
	{
		char *t, *v;

		int l = ta.length();
		for(int i = 0; i < l; i++)
		{
			t = (char *)ta.getTag(i);
			if(strcmp(t, tag) == 0)
			{
				v = (char *)ta.rem(i);
				DASSERT(v); 
				free(v);
				return true;
			}
		}
		return false;
	}
开发者ID:piter65,项目名称:spilldec,代码行数:20,代码来源:taglist.cpp

示例14: NOT

//==================================================================
void TokNode::ReplaceNode( TokNode *pOldNode )
{
	if NOT( pOldNode->mpParent )
		return;

	for (size_t i=0; i < pOldNode->mpParent->mpChilds.size(); ++i)
	{
		if ( pOldNode->mpParent->mpChilds[i] == pOldNode )
		{
			pOldNode->mpParent->mpChilds[i] = this;
			mpParent = pOldNode->mpParent;
			pOldNode->mpParent = NULL;
			return;
		}
	}

	DASSERT( 0 );
}
开发者ID:UIKit0,项目名称:RibTools,代码行数:19,代码来源:RSLC_Tree.cpp

示例15: DASSERT

void AwtMenuItem::DrawItem(DRAWITEMSTRUCT& drawInfo)
{
    DASSERT(drawInfo.CtlType == ODT_MENU);

    if (drawInfo.itemID != m_Id)
        return;

    /* Fixed bug 4349969. Since the problem occurs on Windows 98 and not on
       Windows NT, the fix is to check for Windows 95/98 and to check if the
       handle to the menu of the item to be drawn is the same as the handle to the
       menu of the menu object. If they're not the same, just return and don't do
       the drawing.
    */
    if ( IS_WIN95 && drawInfo.hwndItem != (HWND)this->m_menuContainer->GetHMenu()) {
        return;
    } else
        DrawSelf(drawInfo);
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:18,代码来源:awt_MenuItem.cpp


注:本文中的DASSERT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。