当前位置: 首页>>代码示例>>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;未经允许,请勿转载。