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


C++ BitSet函數代碼示例

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


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

示例1: ReadImageDesc

static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifScreen)
{
    unsigned char buf[16];
    if (!ReadOK (area, buf, 9)) {
        _MG_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
        return -1;
    }

    ImageDesc->Top = LM_to_uint (buf[0], buf[1]);
    ImageDesc->Left = LM_to_uint (buf[2], buf[3]);
    ImageDesc->Width = LM_to_uint (buf[4], buf[5]);
    ImageDesc->Height = LM_to_uint (buf[6], buf[7]);
    ImageDesc->haveColorMap = BitSet (buf[8], LOCALCOLORMAP);

    ImageDesc->bitPixel = 1 << ((buf[8] & 0x07) + 1);

    ImageDesc->interlace = BitSet(buf[8], INTERLACE);

    if (ImageDesc->haveColorMap) {
        _MG_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
        if (ReadColorMap (area, ImageDesc->bitPixel, ImageDesc->ColorMap) < 0) {
            _MG_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
            return -1;
        }
    } else {
        memcpy (ImageDesc->ColorMap, GifScreen->ColorMap, MAXCOLORMAPSIZE*sizeof (RGB));
    }

    return 0;
}
開發者ID:Trietptm-on-Coding-Algorithms,項目名稱:CodeLibrary,代碼行數:30,代碼來源:gif89a.c

示例2: BitsSet

/*
 * Set the bit string.
 *	Set the width bits from the position of specified bit.
 */
EXPORT void BitsSet( VP base, W offset, W width )
{
    UB	*bp;
    INT	n;

    n = offset / TSD_BST_N_8;
    bp = (UB*)base + n;

    n = (W)((UW)offset & TSD_BST_MSK_7);
    if ( n > 0 ) {
        for ( ; n < TSD_BST_N_8; ++n ) {
            if ( --width < 0 ) {
                return;
            }
            BitSet(bp, (UW)n);
        }
        bp++;
    }

    n = width / TSD_BST_N_8;
    if ( n > 0 ) {
        memset(bp, TSD_BST_VAL_0XFF, (size_t)n);
    }
    bp += n;
    width -= n * TSD_BST_N_8;

    for ( n = 0; n < width; ++n ) {
        BitSet(bp, (UW)n);
    }
}
開發者ID:Ninals-GitHub,項目名稱:TRON,代碼行數:34,代碼來源:bitsset.c

示例3: if

BitSet* ChainedFilter::bits( IndexReader* reader, int logic )
{
	BitSet* bts = NULL;
	
	Filter** filter = filters;
	
	// see discussion at top of file
	if( *filter ) {
		BitSet* tmp = (*filter)->bits( reader );
		if ( (*filter)->shouldDeleteBitSet(tmp) ) //if we are supposed to delete this BitSet, then 
			bts = tmp; //we can safely call it our own
		else if ( tmp == NULL ){
			int32_t len = reader->maxDoc();
			bts = _CLNEW BitSet( len ); //bitset returned null, which means match _all_
			for (int32_t i=0;i<len;i++ )
				bts->set(i);
		}else{
			bts = tmp->clone(); //else it is probably cached, so we need to copy it before using it.
		}
		filter++;
	}
	else
		bts = _CLNEW BitSet( reader->maxDoc() );
	
	while( *filter ) {
		doChain( bts, reader, logic, *filter );
		filter++;
	}
	
	return bts;
}
開發者ID:Afreeca,項目名稱:qt,代碼行數:31,代碼來源:ChainedFilter.cpp

示例4: BitsSet

/*
 * Set the bit string.
 *	Set the width bits from the position of specified bit.
 */
EXPORT void BitsSet( void *base, W offset, W width )
{
    UB	*bp;
    INT	n;

    n = offset / 8;
    bp = (UB*)base + n;

    n = (W)((UW)offset & 7U);
    if ( n > 0 ) {
        for ( ; n < 8; ++n ) {
            if ( --width < 0 ) {
                return;
            }
            BitSet(bp, (UW)n);
        }
        bp++;
    }

    n = width / 8;
    if ( n > 0 ) {
        MEMSET(bp, 0xffU, (size_t)n);
    }
    bp += n;
    width -= n * 8;

    for ( n = 0; n < width; ++n ) {
        BitSet(bp, (UW)n);
    }
}
開發者ID:accordo,項目名稱:tkernel_source,代碼行數:34,代碼來源:bitsset.c

示例5: SetPopSub

//==================================================================================
void SetPopSub(U8 _pth, U8 _pos_x, U8 _pos_y, U8 _lngth, U8 _hght, U8 _main_mn_pos_crnt)
{
//	_lngth = 0;			//... temporal
//	_hght = 0;			//... temporal
	CreateBoxPopFrame(_pth,BOX_POP_SB,_pos_x,_pos_y,_lngth,_hght);
//	IfBitSet(_pth,PTH_X)	SetPopSubOSD(PTH_X,_pos_x,_pos_y, _main_mn_pos_crnt);
//	IfBitSet(_pth,PTH_Y)	SetPopSubOSD(PTH_Y,_pos_x,_pos_y, _main_mn_pos_crnt);
	if(BitSet(_pth,PTH_X))	SetPopSubOSD(PTH_X,_pos_x,_pos_y, _main_mn_pos_crnt);
	if(BitSet(_pth,PTH_Y))	SetPopSubOSD(PTH_Y,_pos_x,_pos_y, _main_mn_pos_crnt);
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:11,代碼來源:wndw_pop.c

示例6: SetPopMain

//==================================================================================
void SetPopMain(U8 _pth, U8 _pos_x, U8 _pos_y, U8 _lngth, U8 _hght)
{
//	_lngth = 0;			//... temporal
//	_hght = 0;			//... temporal
	CreateBoxPopFrame(_pth,BOX_POP_MN,_pos_x,_pos_y,_lngth,_hght);
//	IfBitSet(_pth,PTH_X)	SetPopMainOSD(PTH_X,_pos_x,_pos_y);
//	IfBitSet(_pth,PTH_Y)	SetPopMainOSD(PTH_Y,_pos_x,_pos_y);
	if(BitSet(_pth,PTH_X))	SetPopMainOSD(PTH_X,_pos_x,_pos_y);
	if(BitSet(_pth,PTH_Y))	SetPopMainOSD(PTH_Y,_pos_x,_pos_y);
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:11,代碼來源:wndw_pop.c

示例7: bitmanip

int bitmanip(int word)
{
printf("fresh %d\n",word);
      word = BitSet(word, 2);
printf("set 2 %d\n",word);
      word = BitSet(word, 7);
printf("set 7 %d\n",word);
      word = BitClr(word, 3);
printf("clr 3 %d\n",word);
      word = BitFlp(word, 9);
printf("flip 9 %d\n",word);
      return word;
}
開發者ID:ssajjan,項目名稱:reference,代碼行數:13,代碼來源:bit.c

示例8: SetObjectVisible

void SetObjectVisible (ObjectRecHdl ObjectHdl, Boolean VisibleFlag)
{
	short	objectFlags;
	
	objectFlags = (**ObjectHdl).objectFlags;
	if (VisibleFlag)
		BitSet (&objectFlags, kVisibleMask);
	else
		BitSet (&objectFlags, kVisibleMask);
	(**ObjectHdl).objectFlags = objectFlags;

	return;
}
開發者ID:JamesMakela-NOAA,項目名稱:PyGnome,代碼行數:13,代碼來源:ObjectUtils.cpp

示例9: DisableBox

//==================================================================================
//						Box function description
//==================================================================================
//void SetBox3DEffect(U8 tgl_dim, U8 tgl_emp)
//{
//	U8	r_box_mode;
//	
//	r_box_mode = ReadAsicByte(MASTER,DVC_PG2,REG_BOX_MODE);
//	if(tgl_dim == ON)	SetBit(r_box_mode,BOX_TYPE);
//	else	ClearBit(r_box_mode,BOX_TYPE);
//	if(tgl_emp == ON)	SetBit(r_box_mode,BOX_EMP);
//	else	ClearBit(r_box_mode,BOX_EMP);
//	WriteAsicByte(MASTER,DVC_PG2,REG_BOX_MODE,r_box_mode);
//}
////==================================================================================
//void SetBoxPlaneCol(U8 _box_strt, U8 _box_end, U8 _col)
//{
//	U8	_rdat_;
//	U8	_t1_, _t2_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCOL10+(_t1_>>1));
//		_t2_ = (_t1_&0x01)<<2;														//... _t2_ = 0 or _t2_ = 4
//		_rdat_ = (_rdat_ & (0xf0>>_t2_))|_col<<_t2_;
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCOL10+(_t1_>>1),_rdat_);
//	}
//}
////==================================================================================
//void SetBoxPlane(U8 _box_strt, U8 _box_end, U8 tgl_pln)
//{
//	U8	_rdat_;
//	U8 _t1_;
//	
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		if(tgl_pln == ON)	SetBit(_rdat_,BOX_PLN_EN);
//		else	ClearBit(_rdat_,BOX_PLN_EN);
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_rdat_);
//	}
//}
////==================================================================================
//void EnableBox(U8 _pth, U8 _box_num)//U8 _box_strt, U8 _box_end)
//{
////	U8	_rdat_;
////	U8 _t1_=0;
////
////	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
////		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
////		ClearBit(_rdat_,BOX_EN_X|BOX_EN_Y);
////		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_pth|_rdat_);
////	}
//
//	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT0,BIT0);
//	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT3,BIT3);
//}
////==================================================================================
void DisableBox(U8 _pth, U8 _box_num)//, U8 _box_strt, U8 _box_end)
{
//	U8	_rdat_;
//	U8 _t1_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,(~ _pth) & _rdat_);
//	}

	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT1|BIT0,0x00);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT4|BIT3,0x00);
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:69,代碼來源:box.c

示例10: SetBoxPln

//==================================================================================
void SetBoxPln(U8 _pth, U8 _box_num, U8 _tgl)//U8 _box_strt, U8 _box_end
{
//	U8	_rdat_
//	U8 _t1_=0
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++)
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_)
//		ClearBit(_rdat_,BOX_EN_X|BOX_EN_Y)
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_pth|_rdat_)
//	

	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT0,_tgl);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT3,_tgl<<3);
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:15,代碼來源:box.c

示例11: SetBoxMix

//==================================================================================
void SetBoxMix(U8 _pth, U8 _box_num, U8 _tgl)//U8 _box_strt, U8 _box_end, U8 tgl_ht)
{
//	U8	_rdat_;
//	U8	_t1_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		if(tgl_ht == ON)	SetBit(_rdat_,BOX_PLN_MIX);
//		else	ClearBit(_rdat_,BOX_PLN_MIX);
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_rdat_);
//	}
	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT2,_tgl<<2);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT5,_tgl<<5);
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:15,代碼來源:box.c

示例12: LCD_NYB

//--------------------------------------------------------------------------------//
void LCD_NYB(unsigned char nyb,unsigned char type){
    //SEND DATA LINE THE INFO 
    LCD_PORT->BSRRH |= 0x0F;
    LCD_PORT->BSRRL |= (nyb & 0x0F);

    if(type == CMD){
        BitClr(LCD_RS);             //COMMAND MODE
    } else {
        BitSet(LCD_RS);             //CHARACTER/DATA MODE
    }

    BitSet(LCD_E);         //ENABLE LCD DATA LINE
    DelayMS(1);                 //SMALL DELAY
    BitClr(LCD_E);         //DISABLE LCD DATA LINE
}
開發者ID:rotrials,項目名稱:Proiect_PTSD,代碼行數:16,代碼來源:lcd.c

示例13: SetBoxPos

//==================================================================================
void SetBoxPos(U8 _box_num, U16 _boxhl, U16 _boxvt)
{
	U8	_rdat_;

	_rdat_ = ReadAsicByte(MASTER,DVC_PG2,0x21+_box_num*6);

	if(BitSet(_boxhl, BIT0))	SetBit(_rdat_, BIT3);
	else	ClearBit(_rdat_, BIT3);
	if(BitSet(_boxvt, BIT0))	SetBit(_rdat_, BIT1);
	else	ClearBit(_rdat_, BIT1);

	WriteAsicByte(MASTER,DVC_PG2,0x21+_box_num*6,_rdat_);
	WriteAsicByte(MASTER,DVC_PG2,0x22+_box_num*6,(U8)(_boxhl>>1));
	WriteAsicByte(MASTER,DVC_PG2,0x24+_box_num*6,(U8)(_boxvt>>1));
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:16,代碼來源:box.c

示例14: SetBoxBnd

//==================================================================================
void SetBoxBnd(U8 _pth, U8 _box_num, U8 _tgl)//U8 _box_strt, U8 _box_end, U8 boundary)
{	//... single box boundary is generated same as channel boundary structure.
	//... that is, boxhl/boxvt is inside of box area, boxhw/boxvw is outside of box area.
//	U8	_rdat_;
//	U8	_t1_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		ClearBit(_rdat_,(BOX_OBND|BOX_IBND));
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_rdat_|boundary);
//	}

	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT1,_tgl<<1);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT4,_tgl<<4);
}
開發者ID:zonesan,項目名稱:ucos,代碼行數:16,代碼來源:box.c

示例15: Enabled

// Fairness Checker implementation
FairnessChecker::FairnessChecker(const LTSFairSetRef& FairSet,
                                 SystemIndexSet* SysIdxSet,
                                 const vector<GCmdRef>& GuardedCommands,
                                 LTSChecker* Checker)
    : Enabled(false), Disabled(false), Executed(false),
      FairSet(FairSet), NumInstances(FairSet->GetNumInstances()),
      IsStrong(FairSet->GetFairnessType() == FairSetFairnessType::Strong),
      SysIdxSet(SysIdxSet), ClassID(FairSet->GetClassID()),
      GCmdsToRespondTo(NumInstances, BitSet(GuardedCommands.size(), false)),
      GCmdIDsToRespondTo(NumInstances),
      Checker(Checker),
      EnabledPerInstance(NumInstances, false),
      ExecutedPerInstance(NumInstances, false),
      DisabledPerInstance(NumInstances, false),
      SatisfiedInTrace(NumInstances, false)
{
    for (u32 Instance = 0; Instance < NumInstances; ++Instance) {
        const u32 NumGuardedCommands = GuardedCommands.size();
        for (u32 i = 0; i < NumGuardedCommands; ++i) {
            auto const& Cmd = GuardedCommands[i];
            auto const& FairObjs = Cmd->GetFairnessObjsSatisfied();
            for (auto const& FairObj : FairObjs) {
                if (FairObj->GetFairnessSet() == FairSet &&
                    FairObj->GetInstanceNumber() == Instance) {
                    GCmdsToRespondTo[Instance].Set(i);
                    GCmdIDsToRespondTo[Instance].insert(i);
                }
            }
        }
    }
}
開發者ID:abhishekudupa,項目名稱:kinara,代碼行數:32,代碼來源:LTSCheckerUtils.cpp


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