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


C++ GETBIT函数代码示例

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


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

示例1: GETBIT

void BookExt_Conditional12::load(CFRecord& record)
{
	unsigned char flags;
	record >> flags;
	fPublishedBookItems = GETBIT(flags, 1);
	fShowPivotChartFilter = GETBIT(flags, 2);
}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:7,代码来源:BookExt_Conditional12.cpp

示例2: closest_in_range

/*
 * Finds the closest used position in the packed memory
 * array (including index) within a range (non-inclusive). 
 * Returns -1 on failure.
 */
int closest_in_range(PMA* pma, int index, int b_lim, int t_lim){
	int closest = -1;
	int radius = 0;
	int fail = 0;

	while (!fail && closest == -1){
		fail = 1;

		if (t_lim > index + radius){
			fail = 0;
			if (GETBIT(pma->bitmap, index + radius)){
				closest = index + radius;
			}
		}

		if (b_lim < index - radius){
			fail = 0;
			if (GETBIT(pma->bitmap, index - radius)){
				closest = index - radius;
			}
		}

		radius++;
	}

	return closest;
}
开发者ID:encyclopedea,项目名称:PackedMemoryArray,代码行数:32,代码来源:pkd_mem_arr.c

示例3: GETBIT

void SortData::readFields(CFRecord& record)
{
	unsigned short flags;

	record >> frtHeader >> flags;

	fCol			= GETBIT(flags, 0);
	fCaseSensitive	= GETBIT(flags, 1);
	fAltMethod		= GETBIT(flags, 2);
	sfp				= GETBITS(flags, 3, 5);
	
	RFX rfx_orig;
	record >> rfx_orig >> cconditions;
	rfx = static_cast<std::wstring >(rfx_orig);
	
	record >> idParent;
	
	std::list<CFRecordPtr>& recs = continue_records[rt_ContinueFrt12];
	while(!recs.empty())
	{
		record.appendRawData(recs.front()->getData() + 12, recs.front()->getDataSize() - 12);
		recs.pop_front();
	}
	
	for(unsigned int i = 0; i < cconditions; ++i)
	{
		SortCond12Ptr sort_cond(new SortCond12);
		record >> *sort_cond;
		sortCond12Array.push_back(sort_cond);
	}

}
开发者ID:ShockwaveNN,项目名称:core,代码行数:32,代码来源:SortData.cpp

示例4: checklist

/*===========================================================================*
 *				checklist				     *
 *===========================================================================*/
static int checklist(char *file, int line,
	struct slabheader *s, int l, int bytes)
{
	struct slabdata *n = s->list_head[l];
	int ch = 0;

	while(n) {
		int count = 0, i;
		MYASSERT(n->sdh.magic1 == MAGIC1);
		MYASSERT(n->sdh.magic2 == MAGIC2);
		MYASSERT(n->sdh.list == l);
		MYASSERT(usedpages_add(n->sdh.phys, VM_PAGE_SIZE) == 0);
		if(n->sdh.prev)
			MYASSERT(n->sdh.prev->sdh.next == n);
		else
			MYASSERT(s->list_head[l] == n);
		if(n->sdh.next) MYASSERT(n->sdh.next->sdh.prev == n);
		for(i = 0; i < USEELEMENTS*8; i++)
			if(i >= ITEMSPERPAGE(bytes))
				MYASSERT(!GETBIT(n, i));
			else
				if(GETBIT(n,i))
					count++;
		MYASSERT(count == n->sdh.nused);
		ch += count;
		n = n->sdh.next;
	}

	return ch;
}
开发者ID:locosoft1986,项目名称:nucleos,代码行数:33,代码来源:slaballoc.c

示例5: GETBITS

void AutoFilter::readFields(CFRecord& record)
{
	size_t pos_record = record.getRdPtr();

	if (size == 0xffffffff) size = record.getDataSize() - pos_record;

	if (size > 0)
	{
		bExist = true;
	}

	m_bAutoFilter12 = false;

	unsigned short flags;
	record >> iEntry >> flags;
	
	wJoin		= GETBITS(flags, 0, 1);
	
	fSimple1	= GETBIT(flags, 2);
	fSimple2	= GETBIT(flags, 3);
	fTopN		= GETBIT(flags, 4);
	fTop		= GETBIT(flags, 5); //top(1) or bottom(0)
	fPercent	= GETBIT(flags, 6);
	
	wTopN		= GETBITS(flags, 7, 15);

	unsigned short	_iEntry		= iEntry;
	unsigned char	_wJoin		= wJoin;			
	unsigned short	_wTopN		= wTopN;			
	
	if (fTopN != 1)
	{
		record >> doper1;			
		record >> doper2;
	}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:35,代码来源:AutoFilter.cpp

示例6: GETBIT

void DXFBdr::load(CFRecord& record)
{
	_UINT32 flags;
	record >> flags;
	
	dgLeft		= static_cast<unsigned char>(GETBITS(flags, 0, 3));
	dgRight		= static_cast<unsigned char>(GETBITS(flags, 4, 7));
	dgTop		= static_cast<unsigned char>(GETBITS(flags, 8, 11));
	dgBottom	= static_cast<unsigned char>(GETBITS(flags, 12, 15));
	
	icvLeft		= static_cast<unsigned char>(GETBITS(flags, 16, 22));
	icvRight	= static_cast<unsigned char>(GETBITS(flags, 23, 29));
	
	bitDiagDown = GETBIT(flags, 30);
	bitDiagUp	= GETBIT(flags, 31);

	record >> flags;
	
	icvTop		= static_cast<unsigned char>(GETBITS(flags, 0, 6));
	icvBottom	= static_cast<unsigned char>(GETBITS(flags, 7, 13));
	icvDiag		= static_cast<unsigned char>(GETBITS(flags, 14, 20));
	
	dgDiag		= static_cast<unsigned char>(GETBITS(flags, 21, 24));

}
开发者ID:ShockwaveNN,项目名称:core,代码行数:25,代码来源:DXFBdr.cpp

示例7: AddGraceOp

/*
 * Expand -g interval:o,t into primitive ops.
 */
void
AddGraceOp(int flags, long long n)
{
	int ScopeMask, ScopeBit, opbase;

	ScopeMask = flags&SCOPE_MASK;

	if ((flags&(TYPE_MASK|EXP_MASK)) != 0) {
		fprintf(stderr, "%s:  AddGraceOp: Invalid flags -- %#x\n",
		    Program, flags);
		Err++;
		return;
	}

	opbase = OP_SET|ARG_GRACE;
	for (ScopeBit = GETBIT(ScopeMask); ScopeBit != 0;
	    ScopeBit = GETBIT(ScopeMask)) {
		switch (ScopeBit) {
		case SCOPE_ONLINE:
		case SCOPE_TOTAL:
			AddPrimOp(opbase|ScopeBit, n);
			break;
		default:
			fprintf(stderr, "%s:  AddGraceOp:  bad option %#x\n",
			    Program, ScopeBit);
			Err++;
		}
		ScopeMask &= ~ScopeBit;
	}
}
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:33,代码来源:quota.c

示例8: GETBIT

void BookExt_Conditional11::load(CFRecord& record)
{
	unsigned char flags;
	record >> flags;
	fBuggedUserAboutSolution = GETBIT(flags, 0);
	fShowInkAnnotation = GETBIT(flags, 1);
}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:7,代码来源:BookExt_Conditional11.cpp

示例9: GETBIT

void BookBool::readFields(CFRecord& record)
{
	unsigned short flags;
	record >> flags;
	
	fNoSaveSup			= GETBIT(flags, 0);
	fHasEnvelope		= GETBIT(flags, 2);
	fEnvelopeVisible	= GETBIT(flags, 3);
	fEnvelopeInitDone	= GETBIT(flags, 4);
	
	unsigned char grUpdateLinks_num = GETBITS(flags, 5, 6);
	switch(grUpdateLinks_num)
	{
		case 0:
			grUpdateLinks = std::wstring (L"userSet");
			break;
		case 1:
			grUpdateLinks = std::wstring (L"never");
			break;
		case 2:
			grUpdateLinks = std::wstring (L"always");
			break;
		default:
			throw;// EXCEPT::RT::WrongBiffRecord("Unsupported value of grUpdateLinks.", record.getTypeString());

	}
	
	fHideBorderUnselLists = GETBIT(flags, 8);
}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:29,代码来源:BookBool.cpp

示例10: letterA

void letterA(void)
{
	/***letter A****/


	 for(u8 i=0;i<6;i++)
	 {
		// shift(rows[i],cols[i]);

		u8 R=rows[i];
		u8 C=cols[0][i];
		DIO_u8WritePinVal(otpt_pin,0);  //output enable
			for(s8 i=0;i<8;i++)
		{
		DIO_u8WritePinVal(DS_pin,GETBIT(R,i)); // rows
		DIO_u8WritePinVal(sh_clk,0); ///clk
		DIO_u8WritePinVal(sh_clk,1); //clk
		}

		for(s8 i=0;i<8;i++)
		{
		DIO_u8WritePinVal(DS_pin,GETBIT(C,i)); //columns
		DIO_u8WritePinVal(sh_clk,0); //clk
		DIO_u8WritePinVal(sh_clk,1); //clk
		}
		DIO_u8WritePinVal(otpt_pin,1);  // output enable
	 }

	/*DIO_u8WritePortVal(2,0b00000000); //switch all off
	DIO_u8WritePortVal(3,0b11111011); //row //low //
	DIO_u8WritePortVal(2,0b00011000);   //cols //high //
	Delay(1);


	DIO_u8WritePortVal(2,0b00000000); //switch all off
	DIO_u8WritePortVal(3,0b11110111); //row //low //
	DIO_u8WritePortVal(2,0b00100100);   //cols //high //
	Delay(1);

	DIO_u8WritePortVal(2,0b00000000); //switch all off
	DIO_u8WritePortVal(3,0b11101111); //row //low //
	DIO_u8WritePortVal(2,0b01000010);   //cols //high //
	Delay(1);

	DIO_u8WritePortVal(2,0b00000000); //switch all off
	DIO_u8WritePortVal(3,0b11011111); //row //low //
	DIO_u8WritePortVal(2,0b01111110);   //cols //high //
	Delay(1);

	DIO_u8WritePortVal(2,0b00000000); //switch all off
	DIO_u8WritePortVal(3,0b10111111); //row //low //
	DIO_u8WritePortVal(2,0b01000010);   //cols //high //
	Delay(1);

	DIO_u8WritePortVal(2,0b00000000); //switch all off
	DIO_u8WritePortVal(3,0b01111111); //row //low //
	DIO_u8WritePortVal(2,0b01000010);   //cols //high //
	Delay(1);*/

}
开发者ID:Anwariti,项目名称:SSD-PushButton,代码行数:60,代码来源:main.c

示例11: GETBIT

void FactoidData::load(CFRecord& record)
{
	unsigned short flags;
	record >> flags;
	fDelete = GETBIT(flags, 0);
	fXMLBased = GETBIT(flags, 0);
	record >> propertyBag;
}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:8,代码来源:FactoidData.cpp

示例12: GETBIT

void Frame::readFields(CFRecord& record)
{
	unsigned short flags;
	record >> frt >> flags;
	
	fAutoSize = GETBIT(flags, 0);
	fAutoPosition = GETBIT(flags, 1);
}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:8,代码来源:Frame.cpp

示例13: GETBIT

void RRD::load(CFRecord& record)
{
	unsigned short flags;
	record >> cbMemory >> revid >> revt >> flags;
	fAccepted = GETBIT(flags, 0);
	fUndoAction = GETBIT(flags, 1);
	fDelAtEdgeOfSort = GETBIT(flags, 3);
	record >> tabid;
}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:9,代码来源:RRD.cpp

示例14: GETBIT

void CatSerRange::readFields(CFRecord& record)
{
	unsigned short flags;
	record >> catCross >> catLabel >> catMark >> flags;

	fBetween = GETBIT(flags, 0);
	fMaxCross = GETBIT(flags, 1);
	fReversed = GETBIT(flags, 2);
}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:9,代码来源:CatSerRange.cpp

示例15: frtHeader

void PLV::readFields(CFRecord& record)
{
	FrtHeader frtHeader(rt_PLV);
	record >> frtHeader;
	unsigned short flags;
	record >> wScalePLV >> flags;
	fPageLayoutView = GETBIT(flags, 0);
	fRulerVisible = GETBIT(flags, 1);
	fWhitespaceHidden = GETBIT(flags, 2);
}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:10,代码来源:PLV.cpp


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