本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
};
示例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);
}
示例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;
}
示例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;
}
}
}
示例13: CLEAR_FLAG
void NetConnection::shutdown()
{
if ( IS_SET(mFlags, eConnected) )
{
CLEAR_FLAG(mFlags, eConnected);
mSocket.close();
// remove the clients
mClients.clear();
}
}
示例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); */
}
示例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;
}