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

C++ check_condition函数代码示例

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

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



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

示例1: check_conditions

static bool check_conditions(dialogue_node* node) {
	for (auto& i : node->conditions.has_item) {
		if (!check_condition(i)) {
			return false;
		}
	}
	for (auto& i : node->conditions.stat_check) {
		if (!check_condition(i)) {
			return false;
		}
	}
	return true;
}
开发者ID:noctare,项目名称:Caligo,代码行数:13,代码来源:dialogue.cpp


示例2: simpleexp

static void simpleexp(LexState* ls, expdesc* v)
{
	/* simpleexp -> NUMBER | STRING | NIL | true | false | ... |
		  constructor | FUNCTION body | primaryexp */
	switch (ls->t.token)
	{
		case TK_NUMBER:
		{
			init_exp(v, VKNUM, 0);
			v->u.nval = ls->t.seminfo.r;
			break;
		}
		case TK_STRING:
		{
			codestring(ls, v, ls->t.seminfo.ts);
			break;
		}
		case TK_NIL:
		{
			init_exp(v, VNIL, 0);
			break;
		}
		case TK_TRUE:
		{
			init_exp(v, VTRUE, 0);
			break;
		}
		case TK_FALSE:
		{
			init_exp(v, VFALSE, 0);
			break;
		}
		case TK_DOTS:	 /* vararg */
		{
			FuncState* fs = ls->fs;
			check_condition(ls, fs->f->is_vararg,
					"cannot use " LUA_QL("...") " outside a vararg function");
			fs->f->is_vararg &= ~VARARG_NEEDSARG;  /* don't need 'arg' */
			init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0));
			break;
		}
		case '{':	 /* constructor */
		{
			constructor(ls, v);
			return;
		}
		case TK_FUNCTION:
		{
			luaX_next(ls);
			body(ls, v, 0, ls->linenumber);
			return;
		}
		default:
		{
			primaryexp(ls, v);
			return;
		}
	}
	luaX_next(ls);
}
开发者ID:Ape,项目名称:DCPUToolchain,代码行数:60,代码来源:lparser.c


示例3: check_condition

static TString *str_checkname (LexState *ls) {
  TString *ts;
  check_condition(ls, (ls->t.token == TK_NAME), "<name> expected");
  ts = ls->t.seminfo.ts;
  next(ls);
  return ts;
}
开发者ID:BitMax,项目名称:openitg,代码行数:7,代码来源:lparser.c


示例4: signal_condition

static inline SEXP signal_condition(SEXP condition, const char * fun) {
    check_condition(condition);
    SEXP call = PROTECT(Rf_lang2(Rf_install(fun), condition));
    Rf_eval(call, R_GlobalEnv);
    UNPROTECT(1);
    return R_NilValue;
}
开发者ID:mllg,项目名称:conditions,代码行数:7,代码来源:signal.c


示例5: assignment

static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
  expdesc e;
  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
                      "syntax error");
  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */
    struct LHS_assign nv;
    nv.prev = lh;
    primaryexp(ls, &nv.v);
    if (nv.v.k == VLOCAL)
      check_conflict(ls, lh, &nv.v);
    assignment(ls, &nv, nvars+1);
  }
  else {  /* assignment -> `=' explist1 */
    int nexps;
    checknext(ls, '=');
    nexps = explist1(ls, &e);
    if (nexps != nvars) {
      adjust_assign(ls, nvars, nexps, &e);
      if (nexps > nvars)
        ls->fs->freereg -= nexps - nvars;  /* remove extra values */
    }
    else {
      luaK_setoneret(ls->fs, &e);  /* close last expression */
      luaK_storevar(ls->fs, &lh->v, &e);
      return;  /* avoid default */
    }
  }
  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */
  luaK_storevar(ls->fs, &lh->v, &e);
}
开发者ID:xiaofeng,项目名称:Arcemu,代码行数:30,代码来源:lparser.c


示例6: ldrb_inst

void ldrb_inst(int inst, ARMProc *proc) {
	int i;
	int address;
	int (*func)(int, ARMProc *);
	int rd;
	int data;
	int **rd_ptr;

	if(!check_condition(proc, inst))
                return;

	ls_addr_modes = ls_addressing_dict();
	rd = getbits(inst, 12, 4);

	rd_ptr = &proc->r0;
	rd_ptr += rd;

	for(i = 0; i < LS_ADDRESSING_NUMBER; i++) {
                if(test_inst(ls_addr_modes[i], inst)) {
                        func = ls_addr_modes[i]->execute;
                        address = (*func)(inst, proc);
			break;
                }
        }

	data = read_mem(proc, address, 1);
	**rd_ptr = data;
}
开发者ID:iamedu,项目名称:armdev,代码行数:28,代码来源:ldstr.c


示例7: ldr_inst

void ldr_inst(int inst, ARMProc *proc) {
	int i;
	int address;
	int rd;
	int **rd_ptr;
	int (*func)(int, ARMProc *);
	int data;

	if(!check_condition(proc, inst))
                return;

	ls_addr_modes = ls_addressing_dict();

	for(i = 0; i < LS_ADDRESSING_NUMBER; i++) {
                if(test_inst(ls_addr_modes[i], inst)) {
			printf("Addressing mode: %d\n", i);
                        func = ls_addr_modes[i]->execute;
                        address = (*func)(inst, proc);
			break;
                }
        }

	rd = getbits(inst, 12, 4);
	rd_ptr = &proc->r0;
	rd_ptr += rd;

	data = read_mem(proc, address, 4);

	if(rd == 15) {
		**rd_ptr = data & 0xfffffffe;
	} else {
		**rd_ptr = data;
	}
}
开发者ID:iamedu,项目名称:armdev,代码行数:34,代码来源:ldstr.c


示例8: rtl88e_phy_config_rf_with_headerfile

static bool rtl88e_phy_config_rf_with_headerfile(struct adapter *adapt)
{
	u32 i;
	u32 array_len = ARRAY_SIZE(Array_RadioA_1T_8188E);
	u32 *array = Array_RadioA_1T_8188E;

	for (i = 0; i < array_len; i += 2) {
		u32 v1 = array[i];
		u32 v2 = array[i+1];

		if (v1 < 0xCDCDCDCD) {
			rtl8188e_config_rf_reg(adapt, v1, v2);
			continue;
		} else {
			if (!check_condition(adapt, array[i])) {
				READ_NEXT_PAIR(v1, v2, i);
				while (v2 != 0xDEAD && v2 != 0xCDEF &&
				       v2 != 0xCDCD && i < array_len - 2)
					READ_NEXT_PAIR(v1, v2, i);
				i -= 2;
			} else {
				READ_NEXT_PAIR(v1, v2, i);
				while (v2 != 0xDEAD && v2 != 0xCDEF &&
				       v2 != 0xCDCD && i < array_len - 2) {
						rtl8188e_config_rf_reg(adapt, v1, v2);
						READ_NEXT_PAIR(v1, v2, i);
				}

				while (v2 != 0xDEAD && i < array_len - 2)
					READ_NEXT_PAIR(v1, v2, i);
			}
		}
	}
	return true;
}
开发者ID:Announcement,项目名称:linux,代码行数:35,代码来源:rf_cfg.c


示例9: perf_t

void perf_t(char dep) {
	unsigned int i;
	/*char dummy;
	gen_all_captures();*/
	gen_all();
	check_condition();
	dep--;

	for (i = tree.first_move[Ply];i < tree.first_move[Ply + 1];i++) {
		if (verify_move(tree.move_list[i].move)==0) continue;
			if (makemove(tree.move_list[i].move,0)) {
					/*print_board();
					printf("Press any key to continue:");
					 while (!kbhit());
					dummy=getch();*/
					Nodes++;

					if (dep)
						perf_t(dep);

					unmakemove();
					}

			}
	}
开发者ID:qut-inb304,项目名称:Mizar-Chess,代码行数:25,代码来源:testing.c


示例10: compound

static void compound (LexState *ls, struct LHS_assign *lh) {
  expdesc rh;
  int nexps;
  BinOpr op;

  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
                      "syntax error");
  /* parse Compound operation. */
  op = getcompopr(ls->t.token);
  luaX_next(ls);

  /* parse right-hand expression */
  nexps = explist1(ls, &rh);
  check_condition(ls, nexps == 1, "syntax error");

  luaK_posfix(ls->fs, op, &(lh->v), &rh);
}
开发者ID:henryfung01,项目名称:GameCode4,代码行数:17,代码来源:lparser.c


示例11: check_correct

/*Verifica la correttezza della funzione di scacco*/
void check_correct() {
	char p0[] = "1k1r4/pp1b1R2/3qp1pp/8/3B4/4Q3/PPP2B2/3K4 w - - 0 1";
	char p1[] = "1k1r4/pp1b1R2/3qp1pp/8/3B4/3Q4/PPP2B2/3K4 w - - 0 1";

	set_position(p0);
	init_data();
	print_board();
	printf("In this position white king is under x attack\n");
	printf("Mizar saies:\n");
	check_condition();

	if (tree.check[Side][Ply])
		printf("king is in check\n");
	else
		printf("king is not in check\n");

	if (tree.verify[Ply])
		printf("do legality test in makemove\n");
	else
		printf("No legality test in makemove\n");

	set_position(p1);

	init_data();

	print_board();

	printf("In this position white king is not under x attack\n");

	printf("Mizar saies:\n");

	check_condition();

	if (tree.check[Side][Ply])
		printf("king is in check\n");
	else
		printf("king is not in check\n");

	if (tree.verify[Ply])
		printf("do legality test in makemove\n");
	else
		printf("No legality test in makemove\n");

	}
开发者ID:qut-inb304,项目名称:Mizar-Chess,代码行数:45,代码来源:testing.c


示例12: swp_handler

/*
 * swp_handler logs the id of calling process, dissects the instruction, sanity
 * checks the memory location, calls emulate_swpX for the actual operation and
 * deals with fixup/error handling before returning
 */
static int swp_handler(struct pt_regs *regs, unsigned int instr)
{
	unsigned int address, destreg, data, type;
	unsigned int res = 0;

	perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, regs->ARM_pc);

	if (current->pid != previous_pid) {
		pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",
			 current->comm, (unsigned long)current->pid);
		previous_pid = current->pid;
	}

	/* Ignore the instruction if it fails its condition code check */
	if (!check_condition(regs, instr)) {
		regs->ARM_pc += 4;
		return 0;
	}

	address = regs->uregs[EXTRACT_REG_NUM(instr, RN_OFFSET)];
	data	= regs->uregs[EXTRACT_REG_NUM(instr, RT2_OFFSET)];
	destreg = EXTRACT_REG_NUM(instr, RT_OFFSET);

	type = instr & TYPE_SWPB;

	pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n",
		 EXTRACT_REG_NUM(instr, RN_OFFSET), address,
		 destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data);

	/* Check access in reasonable access range for both SWP and SWPB */
	if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) {
		pr_debug("SWP{B} emulation: access to %p not allowed!\n",
			 (void *)address);
		res = -EFAULT;
	} else {
		res = emulate_swpX(address, &data, type);
	}

	if (res == 0) {
		/*
		 * On successful emulation, revert the adjustment to the PC
		 * made in kernel/traps.c in order to resume execution at the
		 * instruction following the SWP{B}.
		 */
		regs->ARM_pc += 4;
		regs->uregs[destreg] = data;
	} else if (res == -EFAULT) {
		/*
		 * Memory errors do not mean emulation failed.
		 * Set up signal info to return SEGV, then return OK
		 */
		set_segfault(regs, address);
	}

	return 0;
}
开发者ID:4ptiv4,项目名称:d2usc-tw-jb,代码行数:61,代码来源:swp_emulate.c


示例13:

int wpl_text_chunks::condition::output_json (
		wpl_text_state *state,
		const set<wpl_value*> &vars,
		wpl_text_chunk_it *it,
		wpl_value *final_result
) {
	if (check_condition (state, it->get_pos())) {
		 state->run_text_output_json(get_text(), it->get_pos(), vars, final_result);
	}

	return WPL_OP_NO_RETURN;
}
开发者ID:geirda,项目名称:P-star,代码行数:12,代码来源:text.cpp


示例14: ldm1_inst

void ldm1_inst(int inst, ARMProc *proc) {
	int i;
	LSMAddrResult *result;
	LSMAddrResult *(*func)(int, ARMProc *);
	int register_list;
	int address;
	int start_address;
	int end_address;
	int value;
	int **reg;

	if(!check_condition(proc, inst))
                return;

	register_list = getbits(inst, 0, 16);
	lsm_addr_modes = lsm_addressing_dict();
	reg = &proc->r0;

	for(i = 0; i < LSM_ADDRESSING_NUMBER; i++) {
                if(test_inst(lsm_addr_modes[i], inst)) {
                        func = lsm_addr_modes[i]->execute;
                        result = (*func)(inst, proc);
			break;
                }
        }

	start_address = result->start_address;
	end_address   = result->end_address;

	address = start_address;

	for(i = 0; i < 15; i++) {
		if(getbit(register_list, i)) {
			**(reg + i) = read_mem(proc, address, 4);
			address += 4;
		}
	}

	if(getbit(register_list, 15)) {
		value = read_mem(proc, address, 4);
		*proc->pc = value & 0xFFFFFFFE;
		address += 4;
	}

	if(end_address != address - 4) {
		fprintf(stderr, "Load memory error");
	}

}
开发者ID:iamedu,项目名称:armdev,代码行数:49,代码来源:ldstr.c


示例15: luaX_setinput

Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff) {
  struct LexState lexstate;
  struct FuncState funcstate;
  lexstate.buff = buff;
  lexstate.nestlevel = 0;
  luaX_setinput(L, &lexstate, z, luaS_new(L, zname(z)));
  open_func(&lexstate, &funcstate);
  next(&lexstate);  /* read first token */
  chunk(&lexstate);
  check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected");
  close_func(&lexstate);
  lua_assert(funcstate.prev == NULL);
  lua_assert(funcstate.f->nups == 0);
  lua_assert(lexstate.nestlevel == 0);
  return funcstate.f;
}
开发者ID:BitMax,项目名称:openitg,代码行数:16,代码来源:lparser.c


示例16: assignment

static void assignment (LexState *ls, struct LHS_assign *lh, int nvars, BinOpr *opr) {
  expdesc e;
  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
                      "syntax error");
  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */
    struct LHS_assign nv;
    nv.prev = lh;
    primaryexp(ls, &nv.v);
    if (nv.v.k == VLOCAL)
      check_conflict(ls, lh, &nv.v);
    assignment(ls, &nv, nvars+1, opr);
  }
  else {  /* assignment -> `=' explist1 */
    int nexps;

	*opr = OPR_NOBINOPR;
	switch(ls->t.token)
	{
	case '=': break;
	case TK_CONCATASSIGN: *opr = OPR_CONCAT; break;
	case TK_ADDASSIGN: *opr = OPR_ADD; break;
	case TK_SUBASSIGN: *opr = OPR_SUB; break;
	case TK_MULASSIGN: *opr = OPR_MUL; break;
	case TK_DIVASSIGN: *opr = OPR_DIV; break;
	case TK_POWASSIGN: *opr = OPR_POW; break;
	case TK_MODASSIGN: *opr = OPR_MOD; break;
	default:
		luaX_syntaxerror(ls, "unexpected symbol");
		break;
	};
	luaX_next(ls);
    nexps = explist1(ls, &e);
    if (nexps != nvars) {
      adjust_assign(ls, nvars, nexps, &e);
      if (nexps > nvars)
        ls->fs->freereg -= nexps - nvars;  /* remove extra values */
    }
    else {
      luaK_setoneret(ls->fs, &e);  /* close last expression */
      luaK_storevar(ls->fs, &lh->v, &e, *opr);
      return;  /* avoid default */
    }
  }
  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */
  luaK_storevar(ls->fs, &lh->v, &e, *opr);
}
开发者ID:elasota,项目名称:rdx2,代码行数:46,代码来源:lparser.c


示例17: assignment

static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
  expdesc e;
  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
                      "syntax error");
  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */
    struct LHS_assign nv;
    nv.prev = lh;
    primaryexp(ls, &nv.v);
    if (nv.v.k == VLOCAL)
      check_conflict(ls, lh, &nv.v);
    luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
                    "variables in assignment");
    assignment(ls, &nv, nvars+1);
  }
  else {  /* assignment -> `=' explist1 */
    int nexps;
      
      /* hook for inc_assignment */
      if(nvars==1) {
          switch(ls->t.token) {
              case '+': case '-': case '*': case '/': case TK_CONCAT:
                  inc_assignment(ls,lh);
                  /* If you're using Shook's table unpack patch, return 0 here.*/
                  return;
          }
      }
      
    checknext(ls, '=');
    nexps = explist1(ls, &e);
    if (nexps != nvars) {
      adjust_assign(ls, nvars, nexps, &e);
      if (nexps > nvars)
        ls->fs->freereg -= nexps - nvars;  /* remove extra values */
    }
    else {
      luaK_setoneret(ls->fs, &e);  /* close last expression */
      luaK_storevar(ls->fs, &lh->v, &e);
      return;  /* avoid default */
    }
  }
  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */
  luaK_storevar(ls->fs, &lh->v, &e);
}
开发者ID:igoumeninja,项目名称:GAmuza,代码行数:43,代码来源:lparser.c


示例18: bl_inst

void bl_inst(int inst, ARMProc *proc) {
	int l;
	int signed_immed_24;
	int branch_addr;

	if(!check_condition(proc, inst))
		return;
	l = getbit(inst, 24);
	signed_immed_24 = getbits(inst, 0, 24);

	if(l) {
		*proc->lr = *proc->pc;
	}

	branch_addr = sign_extend(signed_immed_24, 24, 30);

	branch_addr <<= 2;


	*proc->pc += 4 + branch_addr;
}
开发者ID:iamedu,项目名称:armdev,代码行数:21,代码来源:branch.c


示例19: root

/*Genera le mosse della Root e le ordina*/
void root(){
	int d,next;
	RMOVEL m;
	unsigned int c;
	
	/*siamo sotto scacco?*/
    check_condition();

	/*generiamo le mosse della root*/
	gen_all();

	/*validiamo, inseriamo nella lista e attribuiamo un valore*/
	tree.last_root_move=0;
	for (c=0;c<tree.first_move[1];c++) {
        if(!makemove(tree.move_list[c].move,0))continue;
		tree.root_move_list[tree.last_root_move].move=tree.move_list[c].move;
		tree.root_move_list[c].scorec=-quiesce(-INF,+INF,0);
		tree.root_move_list[c].scoren=0;
		tree.last_root_move++;
		unmakemove();
	}

	/*ordiniamo*/
	d=1;
	do {
		next=0;
		for (c=0;c<((tree.last_root_move)-d);c++) {
			if (tree.root_move_list[c].scorec<tree.root_move_list[c+1].scorec) {
				m=tree.root_move_list[c];
				tree.root_move_list[c]=tree.root_move_list[c+1];
				tree.root_move_list[c+1]=m;
				next=1;
			}
		}
		d++;
	} while (next);
}
开发者ID:qut-inb304,项目名称:Mizar-Chess,代码行数:38,代码来源:root.c


示例20: assignment

static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
  expdesc e;
  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
                      "syntax error");
  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */
    struct LHS_assign nv;
    nv.prev = lh;
    primaryexp(ls, &nv.v);
    if (nv.v.k == VLOCAL)
      check_conflict(ls, lh, &nv.v);
    luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
                    "variables in assignment");
    assignment(ls, &nv, nvars+1);
  }
  else {  /* assignment -> `=' explist1 */
    int nexps;
#if LUA_MUTATION_OPERATORS
    luaX_next(ls); /* consume `=' token. */
#else
    checknext(ls, '=');
#endif /* LUA_MUTATION_OPERATORS */
    nexps = explist1(ls, &e);
    if (nexps != nvars) {
      adjust_assign(ls, nvars, nexps, &e);
      if (nexps > nvars)
        ls->fs->freereg -= nexps - nvars;  /* remove extra values */
    }
    else {
      luaK_setoneret(ls->fs, &e);  /* close last expression */
      luaK_storevar(ls->fs, &lh->v, &e);
      return;  /* avoid default */
    }
  }
  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */
  luaK_storevar(ls->fs, &lh->v, &e);
}
开发者ID:henryfung01,项目名称:GameCode4,代码行数:36,代码来源:lparser.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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