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


C++ CLEAR_FLAG函數代碼示例

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


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

示例1: unlock_elements

/*!
 * \brief Locking all or selected elements.
 *
 * Usage:\n
 * UnlockElements(All)\n
 * UE(All)\n       
 * If no argument is passed, no action is carried out.
 */
static int
unlock_elements (int argc, char **argv, Coord x, Coord y)
{
        int all = 0;
        if (strcasecmp (argv[0], "All") == 0)
                all = 1;
        else
        {
                Message ("ERROR: in UnlockElements argument should be All.\n");
                return 1;
        }
        SET_FLAG (NAMEONPCBFLAG, PCB);
        ELEMENT_LOOP(PCB->Data);
        {
                if (TEST_FLAG (LOCKFLAG, element))
                {
                        /* element is locked */
                        if (all)
                                CLEAR_FLAG(LOCKFLAG, element);
                }
        }
        END_LOOP;
        gui->invalidate_all ();
        IncrementUndoSerialNumber ();
        return 0;
}
開發者ID:Mehanik,項目名稱:pcb-plugins,代碼行數:34,代碼來源:lockelements.c

示例2: SpTerminateAdapterSynchronized

BOOLEAN
SpTerminateAdapterSynchronized(
    IN PADAPTER_EXTENSION Adapter
    )
{
    //
    // Disable the interrupt from coming in.
    //

    SET_FLAG(Adapter->InterruptData.InterruptFlags, PD_ADAPTER_REMOVED);
    CLEAR_FLAG(Adapter->InterruptData.InterruptFlags, PD_RESET_HOLD);

    ScsiPortCompleteRequest(Adapter->HwDeviceExtension,
                            0xff,
                            0xff,
                            0xff,
                            SRB_STATUS_NO_HBA);

    //
    // Run the completion DPC.
    //

    if(TEST_FLAG(Adapter->InterruptData.InterruptFlags,
                 PD_NOTIFICATION_REQUIRED)) {
        SpRequestCompletionDpc(Adapter->DeviceObject);
    }

    return TRUE;
}
開發者ID:JanD1943,項目名稱:ndas4windows,代碼行數:29,代碼來源:remove.c

示例3: delete_value

void delete_value(unit_box *boxes, INDEX index, INDEX i,INDEX j)
{
    INDEX ri = 0, ci = 0, bi = 0;
    UNIT val = 0;
    bi = index;
    ri = GET_ROW(bi)*COLUMN + i; 
    ci = GET_COLUMN(bi)*ROW + j;
    val = boxes[index].value[i][j];
    if(val > 0 && val <= TOTAL)
    {
        boxes[index].value[i][j] = 0;
        CLEAR_FLAG(box[bi], val-1);
        CLEAR_FLAG(row[ri], val-1);
        CLEAR_FLAG(column[ci], val-1);
    }
}
開發者ID:roopeshs,項目名稱:mycode,代碼行數:16,代碼來源:sudoku.c

示例4: SW_UART_Receive

/*! \brief  Receive one byte.
 *
 *  This function receives one byte of data
 *  by accessing the Rx buffer.
 *
 *  \note   The SW_UART_RX_BUFFER_FULL flag
 *          must be one when this function
 *          is called.
 *
 *  \return Data received.
 */
uint8_t SW_UART_Receive(void)
{
  uint8_t data;
  data = UART_Rx_buffer;
  CLEAR_FLAG( SW_UART_status, SW_UART_RX_BUFFER_FULL );
  return data;
}
開發者ID:oni303,項目名稱:stratumkey,代碼行數:18,代碼來源:single_wire_UART.c

示例5: closeStream

/*
 * Stream contains open file descriptors that could not be completed.
 * If stream has only pending open file descriptors close file
 * descriptors.
 */
static void
closeStream()
{
	FileInfo_t *file;
	int id;

	id = Stream->first;
	while (id > EOS) {
		PthreadMutexLock(&Stream->mutex);
		file = GetFile(id);
		PthreadMutexLock(&file->mutex);
		if (GET_FLAG(file->flags, FI_DCACHE_CLOSE)) {
			if (close(file->dcache) == -1) {
				WarnSyscallError(HERE,
				    "close", "");
			}
			CLEAR_FLAG(file->flags, FI_DCACHE);
			NumOpenFiles--;

		} else if (GET_FLAG(file->flags, FI_DCACHE)) {
			SendErrorResponse(file);
		}

		id = file->next;
		PthreadMutexUnlock(&Stream->mutex);
		PthreadMutexUnlock(&file->mutex);
	}

	if (GET_FLAG(Stream->flags, SR_UNAVAIL)) {
		rejectRequest(ENODEV, B_TRUE);
	} else {
		rejectRequest(0, B_TRUE);
	}
}
開發者ID:BackupTheBerlios,項目名稱:samqfs,代碼行數:39,代碼來源:copyfile.c

示例6: MoveTextToLayerLowLevel

/* ---------------------------------------------------------------------------
 * moves a text object between layers; lowlevel routines
 */
static void *
MoveTextToLayerLowLevel (LayerType *Source, TextType *text,
			 LayerType *Destination)
{
  RestoreToPolygon (PCB->Data, TEXT_TYPE, Source, text);
  r_delete_entry (Source->text_tree, (BoxType *)text);

  Source->Text = g_list_remove (Source->Text, text);
  Source->TextN --;
  Destination->Text = g_list_append (Destination->Text, text);
  Destination->TextN ++;

  if (GetLayerGroupNumberByNumber (solder_silk_layer) ==
      GetLayerGroupNumberByPointer (Destination))
    SET_FLAG (ONSOLDERFLAG, text);
  else
    CLEAR_FLAG (ONSOLDERFLAG, text);

  /* re-calculate the bounding box (it could be mirrored now) */
  SetTextBoundingBox (&PCB->Font, text);
  if (!Destination->text_tree)
    Destination->text_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (Destination->text_tree, (BoxType *)text, 0);
  ClearFromPolygon (PCB->Data, TEXT_TYPE, Destination, text);

  return text;
}
開發者ID:BenBergman,項目名稱:geda-pcb,代碼行數:30,代碼來源:move.c

示例7: TGitNtQueryDirectoryFile

NTSTATUS
NTAPI
TGitNtQueryDirectoryFile(
    HANDLE                  FileHandle,
    HANDLE                  Event  OPTIONAL,
    PIO_APC_ROUTINE         ApcRoutine  OPTIONAL,
    PVOID                   ApcContext  OPTIONAL,
    PIO_STATUS_BLOCK        IoStatusBlock,
    PVOID                   FileInformation,
    ULONG                   Length,
    FILE_INFORMATION_CLASS  FileInformationClass,
    BOOLEAN                 ReturnSingleEntry,
    PUNICODE_STRING         FileName  OPTIONAL,
    BOOLEAN                 RestartScan
)
{
    NTSTATUS Status;

    Status = StubNtQueryDirectoryFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FileInformation, Length, FileInformationClass, ReturnSingleEntry, FileName, RestartScan);
    if (NT_SUCCESS(Status) && FileInformationClass == FileBothDirectoryInformation)
    {
        PFILE_BOTH_DIR_INFORMATION FileInfo;

        FileInfo = (PFILE_BOTH_DIR_INFORMATION)FileInformation;

        if (FileInfo != NULL)
        {
            CLEAR_FLAG(FileInfo->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT);
        }
    }

    return Status;
}
開發者ID:LegalEagle,項目名稱:Arianrhod,代碼行數:33,代碼來源:Test_Dll.cpp

示例8: save_life

/**
 * Can the player be saved by an item?
 * @param op Player to try to save.
 * @retval 1 Player had his life saved by an item, first item saving life
 * is removed.
 * @retval 0 Player had no life-saving item. */
static int save_life(object *op)
{
	object *tmp;

	if (!QUERY_FLAG(op, FLAG_LIFESAVE))
	{
		return 0;
	}

	for (tmp = op->inv; tmp != NULL; tmp = tmp->below)
	{
		if (QUERY_FLAG(tmp, FLAG_APPLIED) && QUERY_FLAG(tmp, FLAG_LIFESAVE))
		{
			play_sound_map(op->map, op->x, op->y, SOUND_OB_EVAPORATE, SOUND_NORMAL);
			new_draw_info_format(NDI_UNIQUE, op, "Your %s vibrates violently, then evaporates.", query_name(tmp, NULL));

			if (CONTR(op))
			{
				esrv_del_item(CONTR(op), tmp->count, tmp->env);
			}

			remove_ob(tmp);
			CLEAR_FLAG(op, FLAG_LIFESAVE);

			if (op->stats.hp < 0)
			{
				op->stats.hp = op->stats.maxhp;
			}

			if (op->stats.food < 0)
			{
				op->stats.food = 999;
			}

			/* Bring him home. */
			enter_player_savebed(op);
			return 1;
		}
	}

	LOG(llevBug, "BUG: save_life(): LIFESAVE set without applied object.\n");
	CLEAR_FLAG(op, FLAG_LIFESAVE);
	/* Bring him home. */
	enter_player_savebed(op);
	return 0;
}
開發者ID:atrinik,項目名稱:dwc,代碼行數:52,代碼來源:player.c

示例9: cs_pushp

inline void catalog_object_header::validate() {
    //S_LOCK(lock);
    cs_pushp();
    if (object != NULL) object->serialize();
    cs_popp();
    CLEAR_FLAG(flags, CAT_OBJECT_INVALID_FLAG);
    //S_UNLOCK(lock);
};
開發者ID:bitkeeper,項目名稱:sedna,代碼行數:8,代碼來源:catalog.cpp

示例10: setupInt

//setup to run the code at the address, that the Interrupt Vector points to...
static void
setupInt(int intNum)
{
	DEBUG_PRINTF_INTR("%s(%x): executing interrupt handler @%08x\n",
			  __func__, intNum, my_rdl(intNum * 4));
	// push current R_FLG... will be popped by IRET
	push_word((u16) M.x86.R_FLG);
	CLEAR_FLAG(F_IF);
	CLEAR_FLAG(F_TF);
	// push current CS:IP to the stack, will be popped by IRET
	push_word(M.x86.R_CS);
	push_word(M.x86.R_IP);
	// set CS:IP to the interrupt handler address... so the next executed instruction will
	// be the interrupt handler
	M.x86.R_CS = my_rdw(intNum * 4 + 2);
	M.x86.R_IP = my_rdw(intNum * 4);
}
開發者ID:XVilka,項目名稱:coreboot,代碼行數:18,代碼來源:interrupt.c

示例11: MoveElementToBuffer

/* ---------------------------------------------------------------------------
 * moves a element to buffer without allocating memory for pins/names
 */
static void *
MoveElementToBuffer (ElementType *element)
{
  /*
   * Delete the element from the source (remove it from trees,
   * restore to polygons)
   */
  r_delete_element (Source, element);

  Source->Element = g_list_remove (Source->Element, element);
  Source->ElementN --;
  Dest->Element = g_list_append (Dest->Element, element);
  Dest->ElementN ++;

  PIN_LOOP (element);
  {
    RestoreToPolygon(Source, PIN_TYPE, element, pin);
    CLEAR_FLAG (WARNFLAG | NOCOPY_FLAGS, pin);
  }
  END_LOOP;
  PAD_LOOP (element);
  {
    RestoreToPolygon(Source, PAD_TYPE, element, pad);
    CLEAR_FLAG (WARNFLAG | NOCOPY_FLAGS, pad);
  }
  END_LOOP;
  SetElementBoundingBox (Dest, element, &PCB->Font);
  /*
   * Now clear the from the polygons in the destination
   */
  PIN_LOOP (element);
  {
    ClearFromPolygon (Dest, PIN_TYPE, element, pin);
  }
  END_LOOP;
  PAD_LOOP (element);
  {
    ClearFromPolygon (Dest, PAD_TYPE, element, pad);
  }
  END_LOOP;

  return element;
}
開發者ID:bgamari,項目名稱:geda-pcb,代碼行數:46,代碼來源:buffer.c

示例12: x86emu_intr_handle

/****************************************************************************
REMARKS:
Handles any pending asychronous interrupts.
****************************************************************************/
static void x86emu_intr_handle(void)
{
	u8	intno;

	if (M.x86.intr & INTR_SYNCH) {
		intno = M.x86.intno;
		if (_X86EMU_intrTab[intno]) {
			(*_X86EMU_intrTab[intno])(intno);
		} else {
			push_word((u16)M.x86.R_FLG);
			CLEAR_FLAG(F_IF);
			CLEAR_FLAG(F_TF);
			push_word(M.x86.R_CS);
			M.x86.R_CS = mem_access_word(intno * 4 + 2);
			push_word(M.x86.R_IP);
			M.x86.R_IP = mem_access_word(intno * 4);
			M.x86.intr = 0;
		}
	}
}
開發者ID:BernardXiong,項目名稱:loongson1-pmon,代碼行數:24,代碼來源:decode.c

示例13: CLEAR_FLAG

void NetConnection::shutdown()
{
   if ( IS_SET(mFlags, eConnected) )
   {
      CLEAR_FLAG(mFlags, eConnected);

      mSocket.close();

      // remove the clients
      mClients.clear();
   }
}
開發者ID:crafter2d,項目名稱:crafter2d,代碼行數:12,代碼來源:netconnection.cpp

示例14: Set_RA_LDPC_8812

void Set_RA_LDPC_8812(struct sta_info *psta, BOOLEAN bLDPC)
{
	if (psta == NULL)
		return;

#ifdef CONFIG_80211AC_VHT
	if (psta->wireless_mode == WIRELESS_11_5AC) {
		if (bLDPC && TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
			SET_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
		else
			CLEAR_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
	} else
		if (IsSupportedTxHT(psta->wireless_mode) || IsSupportedVHT(psta->wireless_mode)) {
			if (bLDPC && TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
				SET_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
			else
				CLEAR_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
		}
#endif

	/* DBG_871X("MacId %d bLDPC %d\n", psta->mac_id, bLDPC); */
}
開發者ID:ssurba,項目名稱:rtl8821au,代碼行數:22,代碼來源:fw.c

示例15: SpRemoveAdapterSynchronized

BOOLEAN
SpRemoveAdapterSynchronized(
    PADAPTER_EXTENSION Adapter
    )
{
    //
    // Disable the interrupt from coming in.
    //

    SET_FLAG(Adapter->InterruptData.InterruptFlags, PD_ADAPTER_REMOVED);
    CLEAR_FLAG(Adapter->InterruptData.InterruptFlags, PD_RESET_HOLD);

    return TRUE;
}
開發者ID:JanD1943,項目名稱:ndas4windows,代碼行數:14,代碼來源:remove.c


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