• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CLEAR_FLAG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了CLEAR_FLAG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: update_params

void update_params(unit_box *boxes, inv_unit_box *box, inv_unit_box *row, inv_unit_box *column)
{
    INDEX i=0, j=0, bi=0;
    for(i = 0 ; i < TOTAL ; i++)
        for(j = 0 ; j < TOTAL ; j++)
        {
            CLEAR_FLAG(box[i], j);
            CLEAR_FLAG(row[i], j);
            CLEAR_FLAG(column[i], j);
        }
    for( bi= 0; bi < TOTAL; bi++)
        for( i= 0; i < COLUMN; i++)
        {
            INDEX ri = GET_ROW(bi)*COLUMN + i;
            for(j= 0; j < ROW; j++)
            {
                INDEX ci = GET_COLUMN(bi)*ROW + j;
                UNIT val = boxes[bi].value[i][j]-1;
                SET_FLAG(box[bi], val);
                SET_FLAG(row[ri], val);
                SET_FLAG(column[ci], val);
            }
        }
}
开发者ID:roopeshs,项目名称:mycode,代码行数:24,代码来源:sudoku.c


示例17: trap_show

/**
 * Handles showing of a trap.
 * @param trap The trap.
 * @param where Where.
 * @return 1 if the trap was shown, 0 otherwise. */
int trap_show(object *trap, object *where)
{
	object *env;

	if (where == NULL)
	{
		return 0;
	}

	env = trap->env;
	/* We must remove and reinsert it.. */
	remove_ob(trap);
	CLEAR_FLAG(trap, FLAG_SYS_OBJECT);
	CLEAR_MULTI_FLAG(trap, FLAG_IS_INVISIBLE);
	trap->layer = LAYER_EFFECT;

	if (env && env->type != PLAYER && env->type != MONSTER && env->type != DOOR && !QUERY_FLAG(env, FLAG_NO_PASS))
	{
		SET_FLAG(env, FLAG_IS_TRAPPED);

		/* Env object is on map */
		if (!env->env)
		{
			update_object(env, UP_OBJ_FACE);
		}
		/* Somewhere else - if visible, update */
		else
		{
			if (env->env->type == PLAYER || env->env->type == CONTAINER)
			{
				esrv_update_item(UPD_FLAGS, env->env, env);
			}
		}

		insert_ob_in_ob(trap, env);

		if (env->type == PLAYER || env->type == CONTAINER)
		{
			esrv_update_item(UPD_LOCATION, env, trap);
		}
	}
	else
	{
		insert_ob_in_map(trap, where->map, NULL, 0);
	}

	return 1;
}
开发者ID:atrinik,项目名称:strakewood-remake,代码行数:53,代码来源:rune.c


示例18: MoveRatToBuffer

/* ---------------------------------------------------------------------------
 * moves a rat-line to paste buffer
 */
static void *
MoveRatToBuffer (RatType *rat)
{
  r_delete_entry (Source->rat_tree, (BoxType *)rat);

  Source->Rat = g_list_remove (Source->Rat, rat);
  Source->RatN --;
  Dest->Rat = g_list_append (Dest->Rat, rat);
  Dest->RatN ++;

  CLEAR_FLAG (NOCOPY_FLAGS, rat);

  if (!Dest->rat_tree)
    Dest->rat_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (Dest->rat_tree, (BoxType *)rat, 0);
  return rat;
}
开发者ID:bgamari,项目名称:geda-pcb,代码行数:20,代码来源:buffer.c


示例19: TGitNtQueryFullAttributesFile

NTSTATUS
NTAPI
TGitNtQueryFullAttributesFile(
    POBJECT_ATTRIBUTES              ObjectAttributes,
    PFILE_NETWORK_OPEN_INFORMATION  FileInformation
)
{
    NTSTATUS Status;

    Status = StubNtQueryFullAttributesFile(ObjectAttributes, FileInformation);

    if (NT_SUCCESS(Status))
    {
        CLEAR_FLAG(FileInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT);
    }

    return Status;
}
开发者ID:LegalEagle,项目名称:Arianrhod,代码行数:18,代码来源:Test_Dll.cpp


示例20: MoveViaToBuffer

/* ---------------------------------------------------------------------------
 * moves a via to paste buffer without allocating memory for the name
 */
static void *
MoveViaToBuffer (PinType *via)
{
  RestoreToPolygon (Source, VIA_TYPE, via, via);

  r_delete_entry (Source->via_tree, (BoxType *) via);
  Source->Via = g_list_remove (Source->Via, via);
  Source->ViaN --;
  Dest->Via = g_list_append (Dest->Via, via);
  Dest->ViaN ++;

  CLEAR_FLAG (WARNFLAG | NOCOPY_FLAGS, via);

  if (!Dest->via_tree)
    Dest->via_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (Dest->via_tree, (BoxType *)via, 0);
  ClearFromPolygon (Dest, VIA_TYPE, via, via);
  return via;
}
开发者ID:bgamari,项目名称:geda-pcb,代码行数:22,代码来源:buffer.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CLEAR_HEAD函数代码示例发布时间:2022-05-30
下一篇:
C++ CLEAR_CBUS_REG_MASK函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap