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


C++ SetFlags函数代码示例

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


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

示例1: MOZ_ASSERT

nsresult CharacterData::BindToTree(Document* aDocument, nsIContent* aParent,
                                   nsIContent* aBindingParent) {
  MOZ_ASSERT(aParent || aDocument, "Must have document if no parent!");
  MOZ_ASSERT(NODE_FROM(aParent, aDocument)->OwnerDoc() == OwnerDoc(),
             "Must have the same owner document");
  MOZ_ASSERT(!aParent || aDocument == aParent->GetUncomposedDoc(),
             "aDocument must be current doc of aParent");
  MOZ_ASSERT(!GetUncomposedDoc() && !IsInUncomposedDoc(),
             "Already have a document.  Unbind first!");
  MOZ_ASSERT(!IsInComposedDoc(), "Already have a document.  Unbind first!");
  // Note that as we recurse into the kids, they'll have a non-null parent.  So
  // only assert if our parent is _changing_ while we have a parent.
  MOZ_ASSERT(!GetParent() || aParent == GetParent(),
             "Already have a parent.  Unbind first!");
  MOZ_ASSERT(!GetBindingParent() || aBindingParent == GetBindingParent() ||
                 (!aBindingParent && aParent &&
                  aParent->GetBindingParent() == GetBindingParent()),
             "Already have a binding parent.  Unbind first!");
  MOZ_ASSERT(aBindingParent != this,
             "Content must not be its own binding parent");
  MOZ_ASSERT(!IsRootOfNativeAnonymousSubtree() || aBindingParent == aParent,
             "Native anonymous content must have its parent as its "
             "own binding parent");

  if (!aBindingParent && aParent) {
    aBindingParent = aParent->GetBindingParent();
  }

  // First set the binding parent
  if (aBindingParent) {
    NS_ASSERTION(IsRootOfNativeAnonymousSubtree() ||
                     !HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE) ||
                     (aParent && aParent->IsInNativeAnonymousSubtree()),
                 "Trying to re-bind content from native anonymous subtree to "
                 "non-native anonymous parent!");
    ExtendedContentSlots()->mBindingParent =
        aBindingParent;  // Weak, so no addref happens.
    if (aParent->IsInNativeAnonymousSubtree()) {
      SetFlags(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE);
    }
    if (aParent->HasFlag(NODE_HAS_BEEN_IN_UA_WIDGET)) {
      SetFlags(NODE_HAS_BEEN_IN_UA_WIDGET);
    }
    if (HasFlag(NODE_IS_ANONYMOUS_ROOT)) {
      aParent->SetMayHaveAnonymousChildren();
    }
  }

  if (aParent && aParent->IsInShadowTree()) {
    ClearSubtreeRootPointer();
    SetFlags(NODE_IS_IN_SHADOW_TREE);
    SetIsConnected(aParent->IsInComposedDoc());
    MOZ_ASSERT(aParent->GetContainingShadow());
    ExtendedContentSlots()->mContainingShadow = aParent->GetContainingShadow();
  }

  bool hadParent = !!GetParentNode();

  // Set parent
  if (aParent) {
    if (!GetParent()) {
      NS_ADDREF(aParent);
    }
    mParent = aParent;
  } else {
    mParent = aDocument;
  }
  SetParentIsContent(aParent);

  // XXXbz sXBL/XBL2 issue!

  // Set document
  if (aDocument) {
    // We no longer need to track the subtree pointer (and in fact we'll assert
    // if we do this any later).
    ClearSubtreeRootPointer();

    // XXX See the comment in Element::BindToTree
    SetIsInDocument();
    SetIsConnected(true);
    if (mText.IsBidi()) {
      aDocument->SetBidiEnabled();
    }
    // Clear the lazy frame construction bits.
    UnsetFlags(NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
  } else if (!IsInShadowTree()) {
    // If we're not in the doc and not in a shadow tree,
    // update our subtree pointer.
    SetSubtreeRootPointer(aParent->SubtreeRoot());
  }

  nsNodeUtils::ParentChainChanged(this);
  if (!hadParent && IsRootOfNativeAnonymousSubtree()) {
    nsNodeUtils::NativeAnonymousChildListChange(this, false);
  }

  UpdateEditableState(false);

  MOZ_ASSERT(aDocument == GetUncomposedDoc(), "Bound to wrong document");
  MOZ_ASSERT(aParent == GetParent(), "Bound to wrong parent");
//.........这里部分代码省略.........
开发者ID:jld,项目名称:gecko-dev,代码行数:101,代码来源:CharacterData.cpp

示例2: SetFlags

static char *GetOPGroup( char subtype )
  {
    SetFlags( group_flags[ subtype-'0' ][ REG(modrm()) ] );
 return groups[subtype-'0'][REG(modrm())];
}
开发者ID:CS-svnmirror,项目名称:farmanager,代码行数:5,代码来源:disasm.cpp

示例3: EView


//.........这里部分代码省略.........
	array.runs[0].underline = false;
	textView->Insert("This is a test, Be", &array);

	array.runs[0].offset = 0;
	array.runs[0].color.set_to(200, 0, 0, 255);
	textView->Insert(-1, "OS", -1, &array);

	array.runs[0].offset = 0;
	array.runs[0].font.SetSize(12);
	array.runs[0].color.set_to(200, 0, 200, 255);
	array.runs[0].background.alpha = 0;
	textView->Insert(-1, " style TextView, just enjoy it. :)\n", -1, &array);

	array.runs[0].offset = 0;
	array.runs[0].font = *etk_bold_font;
	array.runs[0].font.SetSize(20);
	array.runs[0].color.set_to(200, 0, 0, 255);
	array.runs[0].underline = true;
	textView->Insert(-1, "多行", -1, &array);

	array.runs[0].offset = 0;
	array.runs[0].font.SetSize(16);
	array.runs[0].color.set_to(0, 50, 0, 255);
	array.runs[0].underline = true;
	textView->Insert(-1, "文本", -1, &array);

	array.runs[0].offset = 0;
	array.runs[0].font.SetSize(30);
	array.runs[0].color.set_to(0, 0, 200, 255);
	array.runs[0].underline = false;
	textView->Insert(-1, "编辑", -1, &array);

	array.runs[0].offset = 0;
	array.runs[0].font = *etk_plain_font;
	array.runs[0].font.SetSize(10);
	array.runs[0].color.set_to(0, 0, 0, 255);
	textView->Insert(-1, "测试...", -1, &array);

	textView->Select(5, 20, true);

	box->AddChild(new EScrollView(ERect(100, 500, 350, 650), NULL, textView, E_FOLLOW_NONE));
#endif


#if TEST_TABVIEW
	ETabView *tabView = new ETabView(ERect(360, 300, 700, 500), NULL, E_WIDTH_FROM_LABEL, E_FOLLOW_NONE);
	ERect tabVR = tabView->ContainerView()->Bounds();

	ETab *tab = new ETab(new EStringView(tabVR, NULL, "Hello, This is the TAB 1.\nShow it...", E_FOLLOW_ALL));
	tab->SetLabel("Tab 1");
	tabView->AddTab(NULL, tab);

	tab = new ETab(new EColorControl(EPoint(5, 5), NULL, NULL, true));
	tab->SetLabel(">> ColorControl <<");
	tabView->AddTab(NULL, tab);

	tab = new ETab(new EStringView(tabVR, NULL, "Hello, This is the ** TAB 3 **.\nShow it...", E_FOLLOW_ALL));
	tab->SetLabel("  Tab 3  ");
	tabView->AddTab(NULL, tab);

	box->AddChild(tabView);
#endif

#if TEST_SCROLLBAR
	EScrollBar *hScrollBar = new EScrollBar(hR, NULL, 0, -100, 100, E_HORIZONTAL);
	EScrollBar *vScrollBar = new EScrollBar(vR, NULL, 0, -100, 100, E_VERTICAL);
	AddChild(hScrollBar);
	AddChild(vScrollBar);

	hScrollBar->SetTarget(box);
	vScrollBar->SetTarget(box);
#else
	EScrollView *scv = new EScrollView(Bounds(), NULL, box, E_FOLLOW_ALL);
	AddChild(scv);
#endif

#if TEST_STATUSBAR
	fStatusBar = new EStatusBar(ERect(280, 250, 500, 290), NULL, "进度条示例:", "/100");
	box->AddChild(fStatusBar);
	SetFlags(Flags() | E_PULSE_NEEDED);
#endif

#if TEST_MENUFIELD
	EMenu *menu = new EMenu("Options", E_ITEMS_IN_COLUMN);
	menu->SetLabelFromMarked(true);

	menu->AddItem(new EMenuItem("First Item", NULL));
	menu->AddSeparatorItem();
	menu->AddItem(new EMenuItem("Item", NULL));
	menu->AddItem(new EMenuItem("Item Item", NULL));
	menu->AddItem(new EMenuItem("Item Item Item", NULL));
	menu->AddItem(new EMenuItem("Item Item Item Item", NULL));
	menu->AddSeparatorItem();
	menu->AddItem(new EMenuItem("Last Item", NULL));
	menu->ItemAt(0)->SetMarked(true);

	EMenuField *menuField = new EMenuField(ERect(280, 150, 500, 200), NULL, "候选框:", menu, true);
	box->AddChild(menuField);
#endif
}
开发者ID:D-os,项目名称:EasyToolkitAndExtension,代码行数:101,代码来源:scroll-test.cpp

示例4: S9xSoftResetCPU

static void S9xSoftResetCPU (void)
{
	Registers.PBPC = 0;
	Registers.PB = 0;
	CPU.InDMAorHDMA = TRUE; // hangs on addCyclesInMemoryAccess_x2 when S9X_ACCURACY_LEVEL >= 2
	Registers.PCw = S9xGetWord(0xfffc);
	OpenBus = Registers.PCh;
	Registers.D.W = 0;
	Registers.DB = 0;
	Registers.SH = 1;
	Registers.SL -= 3;
	Registers.XH = 0;
	Registers.YH = 0;

	ICPU.ShiftedPB = 0;
	ICPU.ShiftedDB = 0;
	SetFlags(MemoryFlag | IndexFlag | IRQ | Emulation);
	ClearFlags(Decimal);

	CPU.Cycles = 182; // Or 188. This is the cycle count just after the jump to the Reset Vector.
	CPU.PrevCycles = -1;
	CPU.V_Counter = 0;
	CPU.Flags = CPU.Flags & (DEBUG_MODE_FLAG | TRACE_FLAG);
	CPU.PCBase = NULL;
	CPU.IRQActive = FALSE;
	CPU.IRQPending = 0;
	CPU.MemSpeed = SLOW_ONE_CYCLE;
	CPU.MemSpeedx2 = SLOW_ONE_CYCLE * 2;
	CPU.FastROMSpeed = SLOW_ONE_CYCLE;
	CPU.InDMA = FALSE;
	CPU.InHDMA = FALSE;
	CPU.InDMAorHDMA = FALSE;
	CPU.InWRAMDMAorHDMA = FALSE;
	CPU.HDMARanInDMA = 0;
	CPU.CurrentDMAorHDMAChannel = -1;
	CPU.WhichEvent = HC_RENDER_EVENT;
	CPU.NextEvent  = Timings.RenderPos;
	CPU.WaitingForInterrupt = FALSE;
	CPU.WaitAddress = 0xffffffff;
	CPU.WaitCounter = 0;
	CPU.PBPCAtOpcodeStart = 0xffffffff;
	CPU.AutoSaveTimer = 0;
	CPU.SRAMModified = FALSE;

	Timings.InterlaceField = FALSE;
	Timings.H_Max = Timings.H_Max_Master;
	Timings.V_Max = Timings.V_Max_Master;
	Timings.NMITriggerPos = 0xffff;
	if (Model->_5A22 == 2)
		Timings.WRAMRefreshPos = SNES_WRAM_REFRESH_HC_v2;
	else
		Timings.WRAMRefreshPos = SNES_WRAM_REFRESH_HC_v1;

	S9xSetPCBase(Registers.PBPC);

	ICPU.S9xOpcodes = S9xOpcodesE1;
	ICPU.S9xOpLengths = S9xOpLengthsM1X1;
	ICPU.CPUExecuting = TRUE;

	S9xUnpackStatus();
}
开发者ID:loveemu,项目名称:snsf9x,代码行数:61,代码来源:cpu.cpp

示例5: nsBlockFrame

// caption frame
nsTableCaptionFrame::nsTableCaptionFrame(nsStyleContext* aContext):
  nsBlockFrame(aContext)
{
  // shrink wrap 
  SetFlags(NS_BLOCK_FLOAT_MGR);
}
开发者ID:mbrubeck,项目名称:mozilla-central,代码行数:7,代码来源:nsTableOuterFrame.cpp

示例6: while


//.........这里部分代码省略.........
		//This string will hold the base URL path up to the rightmost slash
		String_256 sTempPath="";
		
		//First find the rightmost slash in Base.Path
		INT32 iFound=Base.Path.ReverseFind(cSlash);
		
		//Did we find a slash?
		if (iFound>=0)
		{
			//Yes. So copy everything up to that slash into sTempPath


			Base.Path.Split(&sTempPath, NULL, iFound, TRUE);
			
			sTempPath+=Path;

			Path=sTempPath;
		}//End IF there's a slash in Base.Path

		
		//We now need to check the path for ../ and ./
		//First let's search for /./
		iFound=Path.Sub(sSlashDotSlash);

		//If we've found a /./
		while (iFound>=0)
		{
			//Then remove the ./ part of it.
			Path.Remove(iFound+1, 2);

			//And look for the next /./ to remove
			iFound=Path.Sub(sSlashDotSlash);
		}

		//Now we want to remove all occurrences of /[path segment/../
		//So first let's do a search for /../
		
		iFound=Path.Sub(sSlashDotDotSlash);

		//If we've found a /./
		while (iFound>=0)
		{
			//Then go back until we find the start of the path segment before it
			INT32 iStartOfSection=iFound-1;

			while (iStartOfSection>=0 && Path[iStartOfSection]!=cSlash)
				iStartOfSection--;

			if (iStartOfSection>=0)
			{
				//Get iStartOfSection to represent the character after the slash,
				//rather than the slash
				iStartOfSection++;

				//So if we've found something, then set a pointer to the end of that
				//section
				INT32 iEndOfSection=iFound+3;

				Path.Remove(iStartOfSection, (iEndOfSection-iStartOfSection+1));
			}
			else
				//If we found an unparsable /../, then break now before we
				//get into trouble...
				break;

			//And find the next /../
			iFound=Path.Sub(sSlashDotDotSlash);
		}	
	}
	else
	{
		//No, this Web Address doesn't have a path.
		//So it inherits the path of the base URL.
		Path=Base.Path;

		//If this Web Address has some parameters, we need do nothin more to it
		if (!Parameters.IsEmpty())
			goto ReturnNow;

		//Otherwise this Web Address inherits the parameters of the base URL
		Parameters=Base.Parameters;

		//If this Web Address has a query, we need do nothin more to it
		if (!Query.IsEmpty())
			goto ReturnNow;

		//Otherwise this Web Address inherits the parameters of the base URL
		Query=Base.Query;

		//And that's it. (Fragments are never inherited).
		//So we can return.
		goto ReturnNow;

	}//End if (!Path.IsEmpty()) else...

ReturnNow:
	//Set the "Absolute" flag to whatever it's meant to be, and return
	SetFlags();
	return;
}
开发者ID:vata,项目名称:xarino,代码行数:101,代码来源:stemplate.cpp

示例7: GetFlags

void wxSettableHeaderColumn::ClearFlag(int flag)
{
    int flags = GetFlags();
    if ( flags & flag )
        SetFlags(flags & ~flag);
}
开发者ID:chromylei,项目名称:third_party,代码行数:6,代码来源:headercolcmn.cpp

示例8: INT_IMIA1

/*************************************************
            ITU0同期割り込み関数
--------------------------------------------------
* H8外部クロック25MHz
* 100Hzで割り込み発生
*
**************************************************/
void INT_IMIA1(void)
{
	unsigned char i;
	
	//生存信号
	if(itu1_cnt % ALV_PERIOD == 0)	SetFlags(flag_alive);
	
	// AD変換,マルチプレクサスイッチング
//	if((itu1_cnt % DIV_AD) % DIV_MPX == 0 && (itu1_cnt % DIV_AD) <=35){	// DIV_AD/10 * 7

	if((itu1_cnt % DIV_AD) % DIV_MPX == 0 && (itu1_cnt % DIV_AD) <=70){	// DIV_AD/10 * 7
		SetFlags(flag_ad);
	}
	
	// AD変換結果表示
	if(itu1_cnt % DIV_AD == 0)	SetFlags(flag_dispAD);
	
	//コマンド実行
	if(itu1_cnt % DIV_EXE == 0)	SetFlags(flag_exe);
	
	//渦電流検知テレメトリ
	if(itu1_cnt % DIV_OVERAMPARE == 0)	SetFlags(flag_overa);
	
	// 粗テレメトリ
	if(itu1_cnt % DIV_ROUGHTELEME == 0)	SetFlags(flag_rteleme);
	
	// 詳細テレメトリ
	if(itu1_cnt % DIV_DETAILEDTELEME == 0)	SetFlags(flag_dteleme);
	
	// APIテレメトリ
	if(itu1_cnt % DIV_APITELEME == 0)	SetFlags(flag_ateleme);
	
	// 初期化情報テレメトリ
	if(itu1_cnt % DIV_ITELEME == 0)	SetFlags(flag_iteleme);
	
	// パワーテレメトリ
	if(itu1_cnt % DIV_PTELEME == 0)	SetFlags(flag_pwrt);
	
	// ミッションテレメトリ
	if(itu1_cnt % DIV_MTELEME == 0) SetFlags(flag_misst);
	
	// シリアル通信メッセージチェック
	if(itu1_cnt % DIV_MESSAGE == 0)	SetFlags(flag_scirx);
	
	// RXチェック
	if(itu1_cnt % DIV_RX == 0)	SetFlags(flag_rx);
	
	// TXチェック
	if(itu1_cnt % DIV_TX == 0)	SetFlags(flag_tx);
	
	//パワーから返事が返って来ているかの確認
	if(itu1_cnt % DIV_CPR == 0)  SetFlags(flag_cpr);
	
	// 試験用テレメトリ出力
	if(itu1_cnt % DIV_OUTPUTTELEME == 0) SetFlags(flag_oteleme);
	
	//ミッションCPU起動(タイマ予約型、タイマ予約&作動時間指定型)
	if((smr_time>0)&&(itu1_cnt > smr_time)){
		SetFlags(flag_smr);
	}
	//ミッションCPUシャットダウン(タイマ予約&作動時間指定型)
	if((sms_time>0)&&(itu1_cnt > sms_time)){
		SetFlags(flag_sms);
	}
	//PICオン要求
	if(itu1_cnt % DIV_PIC == 0) SetFlags(flag_pic);
	
	/*デバッグ用*/
	mission_cnt=itu1_cnt;
	
	itu1_cnt++;
	
	if(itu1_cnt >= 0xFFFFFFFE)	// 0.001*4294967296(sec) = 500(day)でクリア
	{
		itu1_cnt = 0;
	}
	
	if(CheckFlags(ena_mywdt)){
		my_wdt++;		// main loopでクリア
		if(my_wdt >= OVERFLOW)	RequestMainShutdown();	// 自己リセット要求
	}
	
	status.obctime[3] =  itu1_cnt			& 0x00ff;
	status.obctime[2] = (itu1_cnt >>  8)	& 0x00ff;
	status.obctime[1] = (itu1_cnt >> 16)	& 0x00ff;
	status.obctime[0] = (itu1_cnt >> 24)	& 0x00ff;
	
	ITU.TISRA.BIT.IMFA1 = 0;				// 割り込みステータスフラグクリア
}
开发者ID:ARTSAT,项目名称:INVADER,代码行数:96,代码来源:itu1.c

示例9: WrapObject

JSBool
WrapObject(JSContext *cx, JSObject *parent, jsval *vp, XPCWrappedNative* wn)
{
  NS_ASSERTION(XPCPerThreadData::IsMainThread(cx),
               "Can't do this off the main thread!");

  // Our argument should be a wrapped native object, but the caller may have
  // passed it in as an optimization.
  JSObject *wrappedObj;
  if (JSVAL_IS_PRIMITIVE(*vp) ||
      !(wrappedObj = JSVAL_TO_OBJECT(*vp)) ||
      wrappedObj->getClass() == &XOWClass) {
    return JS_TRUE;
  }

  if (!wn &&
      !(wn = XPCWrappedNative::GetAndMorphWrappedNativeOfJSObject(cx, wrappedObj))) {
    return JS_TRUE;
  }

  CheckWindow(wn);

  // The parent must be the inner global object for its scope.
  parent = JS_GetGlobalForObject(cx, parent);
  OBJ_TO_INNER_OBJECT(cx, parent);
  if (!parent) {
    return JS_FALSE;
  }

  XPCWrappedNativeWithXOW *wnxow = nsnull;
  if (wn->NeedsXOW()) {
    JSObject *innerWrappedObj = wrappedObj;
    OBJ_TO_INNER_OBJECT(cx, innerWrappedObj);
    if (!innerWrappedObj) {
      return JS_FALSE;
    }

    if (innerWrappedObj == parent) {
      wnxow = static_cast<XPCWrappedNativeWithXOW *>(wn);
      JSObject *xow = wnxow->GetXOW();
      if (xow) {
        *vp = OBJECT_TO_JSVAL(xow);
        return JS_TRUE;
      }
    }
  }

  XPCWrappedNative *parentwn =
    XPCWrappedNative::GetWrappedNativeOfJSObject(cx, parent);
  XPCWrappedNativeScope *parentScope;
  if (NS_LIKELY(parentwn)) {
    parentScope = parentwn->GetScope();
  } else {
    parentScope = XPCWrappedNativeScope::FindInJSObjectScope(cx, parent);
  }

  JSObject *outerObj = nsnull;
  WrappedNative2WrapperMap *map = parentScope->GetWrapperMap();

  outerObj = map->Find(wrappedObj);
  if (outerObj) {
    NS_ASSERTION(outerObj->getClass() == &XOWClass,
                 "What crazy object are we getting here?");
    *vp = OBJECT_TO_JSVAL(outerObj);

    if (wnxow) {
      // NB: wnxow->GetXOW() must have returned false.
      SetFlags(cx, outerObj, AddFlags(GetFlags(cx, outerObj), FLAG_IS_CACHED));
      wnxow->SetXOW(outerObj);
    }

    return JS_TRUE;
  }

  outerObj = JS_NewObjectWithGivenProto(cx, js::Jsvalify(&XOWClass), nsnull,
                                        parent);
  if (!outerObj) {
    return JS_FALSE;
  }

  jsval flags = INT_TO_JSVAL(wnxow ? FLAG_IS_CACHED : 0);
  if (!JS_SetReservedSlot(cx, outerObj, sWrappedObjSlot, *vp) ||
      !JS_SetReservedSlot(cx, outerObj, sFlagsSlot, flags) ||
      !JS_SetReservedSlot(cx, outerObj, XPC_XOW_ScopeSlot,
                          PRIVATE_TO_JSVAL(parentScope))) {
    return JS_FALSE;
  }

  *vp = OBJECT_TO_JSVAL(outerObj);

  map->Add(wn->GetScope()->GetWrapperMap(), wrappedObj, outerObj);
  if(wnxow) {
    wnxow->SetXOW(outerObj);
  }

  return JS_TRUE;
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:97,代码来源:XPCCrossOriginWrapper.cpp

示例10: Init

	void Init() 
	{
		SetFlags( ACH_LISTEN_MAP_EVENTS | ACH_SAVE_WITH_GAME );
		SetGameDirFilter( "episodic" );
		SetGoal( 1 );
	}
开发者ID:Creeper4414,项目名称:Portal-SourceSDKEdition,代码行数:6,代码来源:achievements_ep1.cpp

示例11: Adr2Pos


//.........这里部分代码省略.........
        if (minClassName != "") className = minClassName;
    }

    argA = argD = argC = true;  //On entry
    inA = inD = inC = false;    //No arguments

    _procSize = GetProcSize(fromAdr);
    curPos = fromPos; curAdr = fromAdr;

    while (1)
    {
        if (curAdr >= CodeBase + TotalSize) break;
        //Skip exception table
        if (IsFlagSet(cfETable, curPos))
        {
            //dd num
            num = *((int*)(Code + curPos));
            curPos += 4 + 8*num; curAdr += 4 + 8*num;
            continue;
        }

        BYTE b1 = Code[curPos];
        BYTE b2 = Code[curPos + 1];
        instrLen = Disasm.Disassemble(Code + curPos, (__int64)curAdr, &DisInfo, 0);
        //if (!instrLen) break;
        if (!instrLen)
        {
            curPos++; curAdr++;
            continue;
        }

        op = Disasm.GetOp(DisInfo.Mnem);
        //Code
        SetFlags(cfCode, curPos, instrLen);
        //Instruction begin
        SetFlag(cfInstruction, curPos);

        if (curAdr >= lastAdr) lastAdr = 0;

        if (op == OP_JMP)
        {
            if (curAdr == fromAdr) break;
            if (DisInfo.OpType[0] == otMEM)
            {
                if (Adr2Pos(DisInfo.Offset) < 0 && (!lastAdr || curAdr == lastAdr)) break;
            }
            if (DisInfo.OpType[0] == otIMM)
            {
                Adr = DisInfo.Immediate;
                if (Adr2Pos(Adr) < 0 && (!lastAdr || curAdr == lastAdr)) break;
                if (GetSegmentNo(Adr) != 0 && GetSegmentNo(fromAdr) != GetSegmentNo(Adr) && (!lastAdr || curAdr == lastAdr)) break;
                if (Adr < fromAdr && (!lastAdr || curAdr == lastAdr)) break;
                curPos += instrLen; curAdr += instrLen;
                continue;
            }
        }

        if (DisInfo.Ret)
        {
            //End of proc
            if (!lastAdr || curAdr == lastAdr)
            {
                //Get last instruction
                curPos -= instrLen;
                if ((DisInfo.Ret && !IsFlagSet(cfSkip, curPos)) ||   //ret not in SEH
                    IsFlagSet(cfCall, curPos))                       //@Halt0
开发者ID:crypto2011,项目名称:IDR,代码行数:67,代码来源:AnalyzeArguments.cpp

示例12: UnsetFlags

void
HTMLAnchorElement::OnDNSPrefetchDeferred()
{
  UnsetFlags(HTML_ANCHOR_DNS_PREFETCH_REQUESTED);
  SetFlags(HTML_ANCHOR_DNS_PREFETCH_DEFERRED);
}
开发者ID:L2-D2,项目名称:gecko-dev,代码行数:6,代码来源:HTMLAnchorElement.cpp

示例13: SetFlags

// private
Cvar::Cvar() {
	cvars[name] = this;

	SetFlags( CVAR_NONE );
	modified = false;
}
开发者ID:Razish,项目名称:xsngine,代码行数:7,代码来源:Cvar.cpp

示例14: SetFlags

void CAchievement_AchievedCount::Init() 
{
	SetFlags( ACH_SAVE_GLOBAL );
	SetGoal( 1 );
	SetAchievementsRequired( 0, 0, 0 );
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:6,代码来源:baseachievement.cpp

示例15: FIND_ENTITY_BY_TARGETNAME

void CLightning::BeamUpdateVars( void )
{
	int beamType;
	int pointStart, pointEnd;

	edict_t *pStart = FIND_ENTITY_BY_TARGETNAME ( NULL, STRING(m_iszStartEntity) );
	edict_t *pEnd = FIND_ENTITY_BY_TARGETNAME ( NULL, STRING(m_iszEndEntity) );
	pointStart = IsPointEntity( CBaseEntity::Instance(pStart) );
	pointEnd = IsPointEntity( CBaseEntity::Instance(pEnd) );

	pev->skin = 0;
	pev->sequence = 0;
	pev->rendermode = 0;
	pev->flags |= FL_CUSTOMENTITY;
	pev->model = m_iszSpriteName;
	SetTexture( m_spriteTexture );

	beamType = BEAM_ENTS;
	if ( pointStart || pointEnd )
	{
		if ( !pointStart )	// One point entity must be in pStart
		{
			edict_t *pTemp;
			// Swap start & end
			pTemp = pStart;
			pStart = pEnd;
			pEnd = pTemp;
			int swap = pointStart;
			pointStart = pointEnd;
			pointEnd = swap;
		}
		if ( !pointEnd )
			beamType = BEAM_ENTPOINT;
		else
			beamType = BEAM_POINTS;
	}

	SetType( beamType );
	if ( beamType == BEAM_POINTS || beamType == BEAM_ENTPOINT || beamType == BEAM_HOSE )
	{
		SetStartPos( pStart->v.origin );
		if ( beamType == BEAM_POINTS || beamType == BEAM_HOSE )
			SetEndPos( pEnd->v.origin );
		else
			SetEndEntity( ENTINDEX(pEnd) );
	}
	else
	{
		SetStartEntity( ENTINDEX(pStart) );
		SetEndEntity( ENTINDEX(pEnd) );
	}

	RelinkBeam();

	SetWidth( m_boltWidth );
	SetNoise( m_noiseAmplitude );
	SetFrame( m_frameStart );
	SetScrollRate( m_speed );
	if ( pev->spawnflags & SF_BEAM_SHADEIN )
		SetFlags( BEAM_FSHADEIN );
	else if ( pev->spawnflags & SF_BEAM_SHADEOUT )
		SetFlags( BEAM_FSHADEOUT );
}
开发者ID:NoFreeWill,项目名称:MultiplayerSource,代码行数:63,代码来源:effects.cpp


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