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

C++ setflag函数代码示例

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

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



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

示例1: display_infotype_dialog

//------------------------------------------------------------------
// Display a dialog form with the information types
// Let the user to clear some checkboxes if he wants so
// Returns: true - the user clicked OK
bool display_infotype_dialog(int *respect_info, const char *cfgname)
{
  ushort r = *respect_info;
  if ( r == 0 ) return false;
  static const char form[] =
    "Loaded information type\n"
    "\n"
    "Please specify what information should be loaded from\n"
    "the configuration file %s to the database.\n"
    "\n"
    "If the input file does not contain parts corresponding to\n"
    "the segmentation defined in the config file, you might want\n"
    "to clear the 'memory layout' checkbox or even cancel this\n"
    "dialog box.\n";
  char buf[MAXSTR];
  char *ptr = buf + qsnprintf(buf, sizeof(buf), form, cfgname);
  char *const end = buf + sizeof(buf);
  int B = 1;
  ushort b = 0;
  if ( r & IORESP_PORT ) { b|=B; B<<=1; APPEND(ptr, end, "\n<#Rename port and I/O registers#I/O ports:C>"); }
  if ( r & IORESP_AREA ) { b|=B; B<<=1; APPEND(ptr, end, "\n<#Adjust the program segmentation#Memory layout:C>"); }
  if ( r & IORESP_INT  ) { b|=B;        APPEND(ptr, end, "\n<#Create interrupt vectors and/or entry points#Interrupts:C>"); }
  APPEND(ptr, end, ">\n\n");
  if ( !AskUsingForm_c(buf, &b) )
    return false;
  B = 1;
  if ( r & IORESP_PORT ) { setflag(r, IORESP_PORT, B & b); B <<= 1; }
  if ( r & IORESP_AREA ) { setflag(r, IORESP_AREA, B & b); B <<= 1; }
  if ( r & IORESP_INT  ) { setflag(r, IORESP_INT , B & b);          }
  *respect_info = r;
  return true;
}
开发者ID:trietptm,项目名称:usefulres,代码行数:36,代码来源:iocommon.cpp


示例2: cmdParse

void cmdParse(AgiGame *state, uint8 *p) {
	_v[vWordNotFound] = 0;
	setflag(fEnteredCli, false);
	setflag(fSaidAcceptedInput, false);

	state->_vm->dictionaryWords(state->_vm->agiSprintf(state->strings[p0]));
}
开发者ID:Coworker,项目名称:scummvm,代码行数:7,代码来源:op_cmd.cpp


示例3: DrawDisplay

/*-------------------------------------------------------------------------*/
static void
DrawDisplay(void)
{
    if (strlen(dispstr) >= MAXDISP) { /* strip out some decimal digits */
        char *estr = index(dispstr,'e');  /* search for exponent part */
        if (!estr) dispstr[12]='\0';      /* no exp, just trunc. */
        else {
            char tmp[32];
            if (strlen(estr) <= 4)        /* leftmost 8 chars plus exponent */
                snprintf(tmp, sizeof(tmp), "%.8s%s", dispstr, estr);
            else                          /* leftmost 7 chars plus exponent */
                snprintf(tmp, sizeof(tmp), "%.7s%s", dispstr, estr);
            strlcpy(dispstr, tmp, sizeof(dispstr));
        }
    }
    draw(dispstr);
    setflag(XCalc_MEMORY, (flagM));
    setflag(XCalc_INVERSE, (flagINV));
    setflag(XCalc_DEGREE, (drgmode==DEG));
    setflag(XCalc_RADIAN, (drgmode==RAD));
    setflag(XCalc_GRADAM, (drgmode==GRAD));
    setflag(XCalc_PAREN, (flagPAREN));
    setflag(XCalc_HEX, (numbase==16));
    setflag(XCalc_DEC, (numbase==10));
    setflag(XCalc_OCT, (numbase==8));
}
开发者ID:thentenaar,项目名称:xcalc,代码行数:27,代码来源:math.c


示例4: start_file_fun

bool_t start_file_fun(void *user, const char_t *file, const char_t **xpaths) {
  parserinfo_mv_t *pinfo = (parserinfo_mv_t *)user;
  if( pinfo ) {

    if( checkflag(pinfo->flags,MV_FLAG_TARGET) ) {

      if( (strcmp(file, "stdin") == 0) && 
	  checkflag(pinfo->rcm.flags, RCM_WRITE_FILES) ) {
	errormsg(E_WARNING, "cannot write to stdin, ignoring this file.\n");
	return FALSE;
      }
      cp_start_target_rcm(&pinfo->rcm, file);

    } else {

      if( strcmp(file, "stdout") == 0 ) {
	if( checkflag(pinfo->flags, MV_FLAG_SEEN_STDOUT) ) {
	  if( false_and_setflag(&pinfo->flags, MV_FLAG_WARN_STDOUT) ) {
	    errormsg(E_WARNING, 
		     "only one stdout target allowed, ignoring remaining.\n");
	  }
	}
	setflag(&pinfo->flags, MV_FLAG_SEEN_STDOUT);
      }
    
      if( checkflag(pinfo->rcm.flags, RCM_WRITE_FILES) ) {

	if( strcmp(file, "stdin") == 0 ) {
	  errormsg(E_WARNING, "cannot write to stdin, ignoring this file.\n");
	  return FALSE;
	}

      } else {

	/* this only occurs the first time the target is seen */
	if( (strcmp(file, pinfo->target) == 0) && 
	    pinfo->tempfile && (pinfo->tempfd != -1) ) {
	  open_redirect_stdout(pinfo->tempfd);
	  setflag(&pinfo->rcm.flags, RCM_RM_OUTPUT);
	}

      }
      rm_start_file_rcm(&pinfo->rcm, file);

    }
    return TRUE;
  }
  return FALSE;
}
开发者ID:rudimeier,项目名称:xml-coreutils,代码行数:49,代码来源:xml-mv.c


示例5: switch

void AgiEngine::updateView(VtEntry *v) {
	int cel, lastCel;

	if (v->flags & DONTUPDATE) {
		v->flags &= ~DONTUPDATE;
		return;
	}

	cel = v->currentCel;
	lastCel = v->numCels - 1;

	switch (v->cycle) {
	case CYCLE_NORMAL:
		if (++cel > lastCel)
			cel = 0;
		break;
	case CYCLE_END_OF_LOOP:
		if (cel < lastCel) {
			debugC(5, kDebugLevelResources, "cel %d (last = %d)", cel + 1, lastCel);
			if (++cel != lastCel)
				break;
		}
		setflag(v->parm1, true);
		v->flags &= ~CYCLING;
		v->direction = 0;
		v->cycle = CYCLE_NORMAL;
		break;
	case CYCLE_REV_LOOP:
		if (cel) {
			if (--cel)
				break;
		}
		setflag(v->parm1, true);
		v->flags &= ~CYCLING;
		v->direction = 0;
		v->cycle = CYCLE_NORMAL;
		break;
	case CYCLE_REVERSE:
		if (cel == 0) {
			cel = lastCel;
		} else {
			cel--;
		}
		break;
	}

	setCel(v, cel);
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:48,代码来源:view.cpp


示例6: create_func_frame

//----------------------------------------------------------------------
bool idaapi create_func_frame(func_t *pfn)
{
    if ( pfn != NULL )
    {
        if ( pfn->frame == BADNODE )
        {
            ea_t ea = pfn->startEA;
            if ( ea + 12 < pfn->endEA) // minimum 4 + 4 + 2 + 2 bytes needed
            {
                insn_t insn[4];
                for (int i=0; i<4; i++)
                {
                    decode_insn(ea);
                    insn[i] = cmd;
                    ea += cmd.size;
                }
                if ( insn[0].itype == PIC_movff2 // movff FSR2L,POSTINC1
                        && insn[0].Op1.addr == PIC16_FSR2L && insn[0].Op2.addr == PIC16_POSTINC1
                        && insn[1].itype == PIC_movff2 // movff FSR1L,FSR2L
                        && insn[1].Op1.addr == PIC16_FSR1L && insn[1].Op2.addr == PIC16_FSR2L
                        && insn[2].itype == PIC_movlw  // movlw <size>
                        && insn[3].itype == PIC_addwf3 // addwf FSR1L,f
                        && insn[3].Op1.addr == PIC16_FSR1L && insn[3].Op2.reg == F)
                {
                    setflag((uint32 &)pfn->flags,FUNC_FRAME,1);
                    return add_frame(pfn, insn[2].Op1.value, 0, 0);
                }
            }
        }
    }
    return 0;
}
开发者ID:nealey,项目名称:vera,代码行数:33,代码来源:emu.cpp


示例7: return

node *omalloc(void) {
    if (freelist isnt NULL) {
        return (node *)popFree((stack **)(&freelist));
    }
    setflag("ERROR in omalloc: NULL freelist");
    return NULL;
}
开发者ID:hongyunnchen,项目名称:parallella-lisp,代码行数:7,代码来源:libplisp.c


示例8: cmdEndOfLoop

void cmdEndOfLoop(AgiGame *state, uint8 *p) {
	debugC(4, kDebugLevelScripts, "o%d, f%d", p0, p1);
	vt.cycle = kCycleEndOfLoop;
	vt.flags |= (fDontupdate | fUpdate | fCycling);
	vt.parm1 = p1;
	setflag(p1, false);
}
开发者ID:Coworker,项目名称:scummvm,代码行数:7,代码来源:op_cmd.cpp


示例9: cmdMoveObj

void cmdMoveObj(AgiGame *state, uint8 *p) {
	// _D (_D_WARN "o=%d, x=%d, y=%d, s=%d, f=%d", p0, p1, p2, p3, p4);

	vt.motion = kMotionMoveObj;
	vt.parm1 = p1;
	vt.parm2 = p2;
	vt.parm3 = vt.stepSize;
	vt.parm4 = p4;

	if (p3 != 0)
		vt.stepSize = p3;

	if (getVersion() < 0x2000) {
		_v[p4] = 0;
		vt.flags |= fUpdate | fAnimated;
	} else {
		setflag(p4, false);
		vt.flags |= fUpdate;
	}

	if (p0 == 0)
		state->playerControl = false;

	// AGI 2.272 (ddp, xmas) doesn't call move_obj!
	if (getVersion() > 0x2272)
		state->_vm->moveObj(&vt);
}
开发者ID:Coworker,项目名称:scummvm,代码行数:27,代码来源:op_cmd.cpp


示例10: cmdSetV

void cmdSetV(AgiGame *state, uint8 *p) {
	if (getVersion() < 0x2000) {
		_v[p0] = 1;
	} else {
		setflag(_v[p0], true);
	}
}
开发者ID:Coworker,项目名称:scummvm,代码行数:7,代码来源:op_cmd.cpp


示例11: cmdResetV

void cmdResetV(AgiGame *state, uint8 *p) {
	if (getVersion() < 0x2000) {
		_v[p0] = 0;
	} else {
		setflag(_v[p0], false);
	}
}
开发者ID:Coworker,项目名称:scummvm,代码行数:7,代码来源:op_cmd.cpp


示例12: cmdToggleV

void cmdToggleV(AgiGame *state, uint8 *p) {
	if (getVersion() < 0x2000) {
		_v[p0] ^= 1;
	} else {
		setflag(_v[p0], !getflag(_v[p0]));
	}
}
开发者ID:Coworker,项目名称:scummvm,代码行数:7,代码来源:op_cmd.cpp


示例13: cmdDrawPic

void cmdDrawPic(AgiGame *state, uint8 *p) {
	debugC(6, kDebugLevelScripts, "=== draw pic %d ===", _v[p0]);
	state->_vm->_sprites->eraseBoth();
	state->_vm->_picture->decodePicture(_v[p0], true);
	state->_vm->_sprites->blitBoth();
	state->_vm->_sprites->commitBoth();
	state->pictureShown = 0;
	debugC(6, kDebugLevelScripts, "--- end of draw pic %d ---", _v[p0]);

	// WORKAROUND for a script bug which exists in SQ1, logic scripts
	// 20 and 110. Flag 103 is not reset correctly, which leads to erroneous
	// behavior from view 46 (the spider droid). View 46 is supposed to
	// follow ego and explode when it comes in contact with him. However, as
	// flag 103 is not reset correctly, when the player goes down the path
	// and back up, the spider is always at the base of the path (since it
	// can't go up) and kills the player when he goes down at ground level
	// (although the spider droid sprite itself seems to be correctly positioned).
	// With this workaround, when the player goes back to picture 20 (1 screen
	// above the ground), flag 103 is reset, thereby fixing this issue. Note
	// that this is a script bug and occurs in the original interpreter as well.
	// Fixes bug #1658514: AGI: SQ1 (2.2 DOS ENG) bizzare exploding roger
	if (getGameID() == GID_SQ1 && _v[p0] == 20)
		setflag(103, false);

	// Simulate slowww computer. Many effects rely on this
	state->_vm->pause(kPausePicture);
}
开发者ID:Coworker,项目名称:scummvm,代码行数:27,代码来源:op_cmd.cpp


示例14: main

int
main()
{
	uint32_t primes[PRIMES_SIZE] = { 0 };
	for (unsigned i = 2; i <= 1000; i++) {
		for (unsigned j = 2 * i; j < 1000000; j += i) {
			setflag(j, primes, PRIMES_SIZE);
		}
	}
	unsigned sum = 0;
	for (unsigned i = 2; i < 1000000; i++) {
		bool iscirc = true;
		unsigned len = 1;
		unsigned num = i;
		while (num /= 10)
			len++;
		num = i;
		for (unsigned j = 0; j < len; j++) {
			if (checked(num, primes, PRIMES_SIZE)) {
				iscirc = false;
				break;
			}
			num = rotate(num, len);
		}
		if (iscirc)
			sum++;
	}
	printf("%u\n", sum);
	return 0;
}
开发者ID:ilyak,项目名称:euler,代码行数:30,代码来源:035.c


示例15: set_idp_options

static const char *idaapi set_idp_options(const char *keyword,int value_type,const void *value)
{
  if ( keyword == NULL )
  {
    static const char form[] =
"HELP\n"
"TMS320C55 specific options Ü\n"
" ßßßßßßßßßßßßßßßßßßßßßß\n"
"\n"
" Use I/O definitions \n"
"\n"
"       If this option is on, IDA will use I/O definitions\n"
"       from the configuration file into a macro instruction.\n"
"\n"
" Detect memory mapped registers \n"
"\n"
"       If this option is on, IDA will replace addresses\n"
"       by an equivalent memory mapped register.\n"
"\n"
"ENDHELP\n"
"TMS320C54 specific options\n"
"\n"
" <Use ~I~/O definitions:C>\n"
" <Detect memory mapped ~r~egisters:C>>\n"
"\n"
" <~C~hoose device name:B:0::>\n"
"\n"
"\n";
    AskUsingForm_c(form, &idpflags, choose_device);
    return IDPOPT_OK;
  }
  else
  {
    if ( value_type != IDPOPT_BIT ) return IDPOPT_BADTYPE;
    if ( strcmp(keyword, "TMS320C55_IO") == 0 )
    {
      setflag(idpflags,TMS320C55_IO,*(int*)value);
      return IDPOPT_OK;
    }
    else if ( strcmp(keyword, "TMS320C55_MMR") == 0 )
    {
      setflag(idpflags,TMS320C55_MMR,*(int*)value);
      return IDPOPT_OK;
    }
    return IDPOPT_BADKEY;
  }
}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:47,代码来源:reg.cpp


示例16: pause

/**
 * Set up new room.
 * This function is called when ego enters a new room.
 * @param n room number
 */
void AgiEngine::newRoom(int n) {
	VtEntry *v;
	int i;

	// Simulate slowww computer.
	// Many effects rely on it.
	pause(kPauseRoom);

	debugC(4, kDebugLevelMain, "*** room %d ***", n);
	_sound->stopSound();

	i = 0;
	for (v = _game.viewTable; v < &_game.viewTable[MAX_VIEWTABLE]; v++) {
		v->entry = i++;
		v->flags &= ~(ANIMATED | DRAWN);
		v->flags |= UPDATE;
		v->stepTime = 1;
		v->stepTimeCount = 1;
		v->cycleTime = 1;
		v->cycleTimeCount = 1;
		v->stepSize = 1;
	}
	agiUnloadResources();

	_game.playerControl = true;
	_game.block.active = false;
	_game.horizon = 36;
	_game.vars[vPrevRoom] = _game.vars[vCurRoom];
	_game.vars[vCurRoom] = n;
	_game.vars[vBorderTouchObj] = 0;
	_game.vars[vBorderCode] = 0;
	_game.vars[vEgoViewResource] = _game.viewTable[0].currentView;

	agiLoadResource(rLOGIC, n);

	// Reposition ego in the new room
	switch (_game.vars[vBorderTouchEgo]) {
	case 1:
		_game.viewTable[0].yPos = _HEIGHT - 1;
		break;
	case 2:
		_game.viewTable[0].xPos = 0;
		break;
	case 3:
		_game.viewTable[0].yPos = HORIZON + 1;
		break;
	case 4:
		_game.viewTable[0].xPos = _WIDTH - _game.viewTable[0].xSize;
		break;
	}

	_game.vars[vBorderTouchEgo] = 0;
	setflag(fNewRoomExec, true);

	_game.exitAllLogics = true;

	writeStatus();
	writePrompt();
}
开发者ID:bluegr,项目名称:scummvm,代码行数:64,代码来源:cycle.cpp


示例17: setflag

//
// argument/struture access
//
node *nextarg(node **pargs) {
    if (not consp(*pargs) or nullp(*pargs)) {
        setflag("too few arguments\n");
    }
    node *arg = car(*pargs);
    *pargs = cdr(*pargs);
    return arg;
}
开发者ID:hongyunnchen,项目名称:parallella-lisp,代码行数:11,代码来源:libplisp.c


示例18: set_enum_flag

inline bool set_enum_flag(enum_t id, uint32 bit, bool set)
{
  if ( id == BADNODE ) return false;
  netnode n(id);
  uint32 f = uint32(n.altval(ENUM_FLAGS));
  setflag(f, bit, set);
  return n.altset(ENUM_FLAGS, f) != 0;
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:idaplugin,代码行数:8,代码来源:enum.hpp


示例19: rf_set_ugid

void
rf_set_ugid(address_item *addr, ugid_block *ugid)
{
if (ugid->uid_set)
  {
  addr->uid = ugid->uid;
  setflag(addr, af_uid_set);
  }

if (ugid->gid_set)
  {
  addr->gid = ugid->gid;
  setflag(addr, af_gid_set);
  }

if (ugid->initgroups) setflag(addr, af_initgroups);
}
开发者ID:KunZheng,项目名称:mosbench,代码行数:17,代码来源:rf_set_ugid.c


示例20: if

/** @brief create a thread result must be unreferenced
  *
  * @note If the manager thread has not yet started this will start the manager thread.
  * @warning @ref THREAD_OPTION_RETURN flag controls the return of this function.
  * @warning Threads should periodically check the result of framework_threadok() and cleanup or use @ref THREAD_OPTION_CANCEL
  * @param func Function to run thread on.
  * @param cleanup Cleanup function to run.
  * @param sig_handler Thread signal handler.
  * @param data Data to pass to callbacks.
  * @param flags Options of @ref thread_option_flags passed
  * @returns a thread structure that must be un referencend OR NULL depending on flags.*/
extern struct thread_pvt *framework_mkthread(threadfunc func, threadcleanup cleanup, threadsighandler sig_handler, void *data, int flags) {
	struct thread_pvt *thread;
	struct threadcontainer *tc = NULL;

	/*Grab a reference for threads in this scope start up if we can*/
	if (!(tc = (objref(threads)) ? threads : NULL)) {
		if (!thread_can_start) {
			return NULL;
		} else if (!startthreads()) {
			return NULL;
		}
		if (!(tc = (objref(threads)) ? threads : NULL)) {
			return NULL;
		}
	}

	objlock(tc);
	/* dont allow threads if no manager or it not started*/
	if ((!tc->manager || !func) && (func != managethread)) {
		/*im shuting down*/
		objunlock(tc);
		objunref(tc);
		return NULL;
	} else if (!(thread = objalloc(sizeof(*thread), free_thread))) {
		/* could not create*/
		objunlock(tc);
		objunref(tc);
		return NULL;
	}

	thread->data = (objref(data)) ? data : NULL;
	thread->flags = flags << 16;
	thread->cleanup = cleanup;
	thread->sighandler = sig_handler;
	thread->func = func;
	objunlock(tc);

	/* start thread and check it*/
	if (pthread_create(&thread->thr, NULL, threadwrap, thread) || pthread_kill(thread->thr, 0)) {
		objunref(thread);
		objunref(tc);
		return NULL;
	}

	/*Activate the thread it needs to be flaged to run or it will die*/
	objlock(tc);
	addtobucket(tc->list, thread);
	setflag(thread, TL_THREAD_RUN);
	objunlock(tc);
	objunref(tc);

	if (testflag(thread, TL_THREAD_RETURN)) {
		return thread;
	} else {
		objunref(thread);
		return NULL;
	}
}
开发者ID:Distrotech,项目名称:dtsapplib,代码行数:69,代码来源:thread.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setfont函数代码示例发布时间:2022-05-30
下一篇:
C++ setfillstyle函数代码示例发布时间: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