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

C++ check_op函数代码示例

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

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



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

示例1: zrotate

/* <angle> <matrix> rotate <matrix> */
static int
zrotate(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    int code;
    double ang;

    if ((code = real_param(op, &ang)) >= 0) {
        code = gs_rotate(igs, ang);
        if (code < 0)
            return code;
    } else {			/* matrix operand */
        gs_matrix mat;

        /* The num_params failure might be a stack underflow. */
        check_op(1);
        if ((code = num_params(op - 1, 1, &ang)) < 0 ||
            (code = gs_make_rotation(ang, &mat)) < 0 ||
            (code = write_matrix(op, &mat)) < 0
            ) {			/* Might be a stack underflow. */
            check_op(2);
            return code;
        }
        op[-1] = *op;
    }
    pop(1);
    return code;
}
开发者ID:computersforpeace,项目名称:ghostpdl,代码行数:29,代码来源:zmatrix.c


示例2: zscale

/* <sx> <sy> <matrix> scale <matrix> */
static int
zscale(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    int code;
    double scale[2];

    if ((code = num_params(op, 2, scale)) >= 0) {
        code = gs_scale(igs, scale[0], scale[1]);
        if (code < 0)
            return code;
    } else {			/* matrix operand */
        gs_matrix mat;

        /* The num_params failure might be a stack underflow. */
        check_op(2);
        if ((code = num_params(op - 1, 2, scale)) < 0 ||
            (code = gs_make_scaling(scale[0], scale[1], &mat)) < 0 ||
            (code = write_matrix(op, &mat)) < 0
            ) {			/* Might be a stack underflow. */
            check_op(3);
            return code;
        }
        op[-2] = *op;
    }
    pop(2);
    return code;
}
开发者ID:computersforpeace,项目名称:ghostpdl,代码行数:29,代码来源:zmatrix.c


示例3: zrunandhide

static int
zrunandhide(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    es_ptr ep;

    check_op(2);
    if (!r_is_array(op - 1))
        return_op_typecheck(op);
    if (!r_has_attr(op, a_executable))
        return 0;		/* literal object just gets pushed back */
    check_estack(5);
    ep = esp += 5;
    make_mark_estack(ep - 4, es_other, err_end_runandhide); /* error case */
    make_op_estack(ep - 1,  end_runandhide); /* normal case */
    ref_assign(ep, op);
    /* Store the object we are hiding  and it's current tas.type_attrs */
    /* on the exec stack then change to 'noaccess' */
    make_int(ep - 3, (int)op[-1].tas.type_attrs);
    ref_assign(ep - 2, op - 1);
    r_clear_attrs(ep - 2, a_all);
    /* replace the array with a special kind of mark that has a_read access */
    esfile_check_cache();
    pop(2);
    return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:26,代码来源:zcontrol.c


示例4: zzstop

/* <result> <mask> .stop - */
static int
zzstop(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    uint count;

    check_type(*op, t_integer);
    count = count_to_stopped(i_ctx_p, op->value.intval);
    if (count) {
        /*
         * If there are any t_oparrays on the e-stack, they will pop
         * any new items from the o-stack.  Wait to push the result
         * until we have run all the unwind procedures.
         */
        ref save_result;

        check_op(2);
        save_result = op[-1];
        pop(2);
        pop_estack(i_ctx_p, count);
        op = osp;
        push(1);
        *op = save_result;
        return o_pop_estack;
    }
    /* No mark, quit.  (per Adobe documentation) */
    return unmatched_exit(op, zzstop);
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:29,代码来源:zcontrol.c


示例5: main

int		main(int ac, char **av)
{
  bool		help = false;
  bool		verbose = check_op(ac, av, help);

  if (!help)
    {
      if (!(optind < ac))
	readIn(verbose);
      else
	{
	  for (; optind < ac; optind += 1)
	    {
	      std::cout << "---     ---     ---     ---" << std::endl
			<< "  Debut du fichier " << av[optind] << ": "
			<< std::endl
			<< "---     ---     ---     ---" << std::endl;
	      readOut(av[optind], verbose);
	      std::cout << "---     ---     ---     ---" << std::endl
			<< "  Fin du fichier " << av[optind] << "."
			<< std::endl
			<< "---     ---     ---     ---" << std::endl;
	    }
	}
    }
  return (0);
}
开发者ID:Berniecrochu,项目名称:epitech_perso,代码行数:27,代码来源:main.cpp


示例6: zexecn

/* <obj1> ... <objn> <n> .execn - */
static int
zexecn(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    uint n, i;
    es_ptr esp_orig;

    check_int_leu(*op, max_uint - 1);
    n = (uint) op->value.intval;
    check_op(n + 1);
    check_estack(n);
    esp_orig = esp;
    for (i = 0; i < n; ++i) {
        const ref *rp = ref_stack_index(&o_stack, (long)(i + 1));

        /* Make sure this object is legal to execute. */
        if (ref_type_uses_access(r_type(rp))) {
            if (!r_has_attr(rp, a_execute) &&
                r_has_attr(rp, a_executable)
                ) {
                esp = esp_orig;
                return_error(e_invalidaccess);
            }
        }
        /* Executable nulls have a special meaning on the e-stack, */
        /* so since they are no-ops, don't push them. */
        if (!r_has_type_attrs(rp, t_null, a_executable)) {
            ++esp;
            ref_assign(esp, rp);
        }
    }
    esfile_check_cache();
    pop(n + 1);
    return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:36,代码来源:zcontrol.c


示例7: check_ipa_load

static bool
check_ipa_load (gimple, tree op, tree, void *data)
{
  if (DECL_P (op))
    check_decl ((funct_state)data, op, false, true);
  else
    check_op ((funct_state)data, op, false);
  return false;
}
开发者ID:MaddTheSane,项目名称:haiku-buildtools,代码行数:9,代码来源:ipa-pure-const.c


示例8: zquit

/* <obj> <int> .quit - */
static int
zquit(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;

    check_op(2);
    check_type(*op, t_integer);
    return_error(e_Quit);	/* Interpreter will do the exit */
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:10,代码来源:zcontrol.c


示例9: zeq

/* <obj1> <obj2> eq <bool> */
int
zeq(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    EQ_CHECK_READ(op - 1, check_op(2));
    EQ_CHECK_READ(op, DO_NOTHING);
    make_bool(op - 1, (obj_eq(imemory, op - 1, op) ? 1 : 0));
    pop(1);
    return 0;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:11,代码来源:zrelbit.c


示例10: common_transform

/* Common logic for [i][d]transform */
static int
common_transform(i_ctx_t *i_ctx_p,
        int (*ptproc)(gs_state *, double, double, gs_point *),
        int (*matproc)(double, double, const gs_matrix *, gs_point *))
{
    os_ptr op = osp;
    double opxy[2];
    gs_point pt;
    int code;

    /* Optimize for the non-matrix case */
    switch (r_type(op)) {
        case t_real:
            opxy[1] = op->value.realval;
            break;
        case t_integer:
            opxy[1] = (double)op->value.intval;
            break;
        case t_array:		/* might be a matrix */
        case t_shortarray:
        case t_mixedarray: {
            gs_matrix mat;
            gs_matrix *pmat = &mat;

            if ((code = read_matrix(imemory, op, pmat)) < 0 ||
                (code = num_params(op - 1, 2, opxy)) < 0 ||
                (code = (*matproc) (opxy[0], opxy[1], pmat, &pt)) < 0
                ) {		/* Might be a stack underflow. */
                check_op(3);
                return code;
            }
            op--;
            pop(1);
            goto out;
        }
        default:
            return_op_typecheck(op);
    }
    switch (r_type(op - 1)) {
        case t_real:
            opxy[0] = (op - 1)->value.realval;
            break;
        case t_integer:
            opxy[0] = (double)(op - 1)->value.intval;
            break;
        default:
            return_op_typecheck(op - 1);
    }
    if ((code = (*ptproc) (igs, opxy[0], opxy[1], &pt)) < 0)
        return code;
out:
    make_real(op - 1, pt.x);
    make_real(op, pt.y);
    return 0;
}
开发者ID:computersforpeace,项目名称:ghostpdl,代码行数:56,代码来源:zmatrix.c


示例11: zzstopped

/* <obj> <result> <mask> .stopped <result> */
static int
zzstopped(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    check_type(*op, t_integer);
    check_op(3);
    /* Mark the execution stack, and push the default result */
    /* in case control returns normally. */
    check_estack(5);
    push_mark_estack(es_stopped, no_cleanup);
    *++esp = op[-1];		/* save the result */
    *++esp = *op;		/* save the signal mask */
    push_op_estack(stopped_push);
    push_op_estack(zexec);	/* execute the operand */
    pop(2);
    return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:18,代码来源:zcontrol.c


示例12: zstopped

/* the stacks would get restored in case of an error. */
static int
zstopped(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;

    check_op(1);
    /* Mark the execution stack, and push the default result */
    /* in case control returns normally. */
    check_estack(5);
    push_mark_estack(es_stopped, no_cleanup);
    ++esp;
    make_false(esp);		/* save the result */
    ++esp;
    make_int(esp, 1);		/* save the signal mask */
    push_op_estack(stopped_push);
    push_op_estack(zexec);	/* execute the operand */
    return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:19,代码来源:zcontrol.c


示例13: cie_exec_tpqr

/* v [ws wd bs bd] proc -> -mark- ws wd bs bd v proc + exec */
static int
cie_exec_tpqr(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    const ref *ppt = op[-1].value.const_refs;
    uint space = r_space(op - 1);
    int i;

    check_op(3);
    push(4);
    *op = op[-4];		/* proc */
    op[-1] = op[-6];		/* v */
    for (i = 0; i < 4; i++)
	make_const_array(op - 5 + i, a_readonly | space,
			 6, ppt + i * 6);
    make_mark(op - 6);
    return zexec(i_ctx_p);
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:19,代码来源:zcrd.c


示例14: zsuperexec

static int
zsuperexec(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    es_ptr ep;

    check_op(1);
    if (!r_has_attr(op, a_executable))
        return 0;		/* literal object just gets pushed back */
    check_estack(2);
    ep = esp += 3;
    make_mark_estack(ep - 2, es_other, end_superexec); /* error case */
    make_op_estack(ep - 1,  end_superexec); /* normal case */
    ref_assign(ep, op);
    esfile_check_cache();
    pop(1);
    i_ctx_p->in_superexec++;
    return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:19,代码来源:zcontrol.c


示例15: jl_typeof

static inline jl_value_t *jl_intrinsic_cvt(jl_value_t *ty, jl_value_t *a, const char *name, intrinsic_cvt_t op, intrinsic_cvt_check_t check_op)
{
    jl_value_t *aty = jl_typeof(a);
    if (!jl_is_bitstype(aty))
        jl_errorf("%s: value is not a bitstype", name);
    if (!jl_is_bitstype(ty))
        jl_errorf("%s: type is not a bitstype", name);
    void *pa = jl_data_ptr(a);
    unsigned isize = jl_datatype_size(aty);
    unsigned osize = jl_datatype_size(ty);
    if (check_op && check_op(isize, osize, pa))
        jl_throw(jl_inexact_exception);
    jl_value_t *newv = newstruct((jl_datatype_t*)ty);
    op(aty == (jl_value_t*)jl_bool_type ? 1 : isize * host_char_bit, pa,
            osize * host_char_bit, jl_data_ptr(newv));
    if (ty == (jl_value_t*)jl_bool_type)
        return *(uint8_t*)jl_data_ptr(newv) & 1 ? jl_true : jl_false;
    return newv;
}
开发者ID:codeForSaif,项目名称:julia,代码行数:19,代码来源:runtime_intrinsics.c


示例16: zexec

/* <obj> exec - */
int
zexec(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    int code;

    check_op(1);
    code = check_for_exec(op);
    if (code < 0) {
        return code;
    }
    if (!r_has_attr(op, a_executable)) {
        return 0;	/* shortcut, literal object just gets pushed back */
    }
    check_estack(1);
    ++esp;
    ref_assign(esp, op);
    esfile_check_cache();
    pop(1);
    return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:22,代码来源:zcontrol.c


示例17: search_epur

static int	search_epur(int s, char *ret, char *line, t_sh *term)
{
	t_epur	e;

	e.i = -1;
	e.f = 0;
	e.j = 0;
	while (line[++e.i])
	{
		if (line[e.i] != ' ' && line[e.i] != '\t' && line[e.i] != '\n')
			fsretj(&e, &ret, &s, line[e.i]);
		else if (line[e.i + 1] && line[e.i + 1] != ' ' &&
				line[e.i + 1] != '\t' && line[e.i + 1] != '\n')
		{
			if (e.i && !check_op(term->ope, line[e.i + 1])
				&& !rev_srch(term->ope, line, e.i))
				fsretj(&e, &ret, &s, ' ');
		}
	}
	if (ret)
		ret[e.j] = '\0';
	return (s);
}
开发者ID:jalcim,项目名称:42sh,代码行数:23,代码来源:ft_epur_str.c


示例18: cmd_user

void		cmd_user(t_message *msg, t_client *client)
{
  if (msg == NULL || client == NULL)
    return;
  if (get_nb_params(msg->params) != 4)
    {
      dprintf(client->client, ERR_NEEDMOREPARAMS, S_NAME, S_ADDR, \
	      client->nick, "USER");
      return;
    }
  if (client->isAuth >= 3 || client->isAuth == 1)
    {
      dprintf(client->client, ERR_ALREADYREGISTRED, S_NAME, S_ADDR, \
	      client->nick);
      return;
    }
  strcpy(client->user, msg->params[0]);
  strcpy(client->rname, msg->params[3]);
  if (client->isAuth == 0)
    client->isAuth = 1;
  else if (client->isAuth == 2)
    auth_client(client);
  check_op(client);
}
开发者ID:Kevin-Costa,项目名称:PSU_myirc,代码行数:24,代码来源:cmd_user.c


示例19: main

int main(

  int    argc,
  char **argv)

  {
  int c;
  int errflg = 0;
  char *errmsg;

#define MAX_OPTARG_LEN 256
#define MAX_RESOURCE_NAME_LEN 256
  char optargout[MAX_OPTARG_LEN+1];
  char resource_name[MAX_RESOURCE_NAME_LEN+1];

  enum batch_op op;
  enum batch_op *pop = &op;

  struct attropl *select_list = 0;

  static char destination[PBS_MAXROUTEDEST+1] = "";
  char server_out[MAXSERVERNAME] = "";

  char *queue_name_out;
  char *server_name_out;

  int connect;
  char **selectjob_list;
  char *res_pos;
  char *pc;
  int u_cnt, o_cnt, s_cnt, n_cnt;
  time_t after;
  char a_value[80];
  int exec_only = 0;

  if (getenv("PBS_QSTAT_EXECONLY") != NULL)
    exec_only = 1;

#define GETOPT_ARGS "a:A:ec:h:l:N:p:q:r:s:u:"

  while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF)
    switch (c)
      {

      case 'a':
        check_op(optarg, pop, optargout);

        if ((after = cvtdate(optargout)) < 0)
          {
          fprintf(stderr, "qselect: illegal -a value\n");
          errflg++;
          break;
          }

        sprintf(a_value, "%ld", (long)after);

        set_attrop(&select_list, ATTR_a, NULL, a_value, op);
        break;

      case 'e':
        exec_only = 1;
        break;

      case 'c':
        check_op(optarg, pop, optargout);
        pc = optargout;

        while (isspace((int)*pc)) pc++;

        if (strlen(pc) == 0)
          {
          fprintf(stderr, "qselect: illegal -c value\n");
          errflg++;
          break;
          }

        if (strcmp(pc, "u") == 0)
          {
          if ((op != EQ) && (op != NE))
            {
            fprintf(stderr, "qselect: illegal -c value\n");
            errflg++;
            break;
            }
          }
        else if ((strcmp(pc, "n") != 0) &&
                 (strcmp(pc, "s") != 0) &&
                 (strcmp(pc, "c") != 0))
          {
          if (strncmp(pc, "c=", 2) != 0)
            {
            fprintf(stderr, "qselect: illegal -c value\n");
            errflg++;
            break;
            }

          pc += 2;

          if (strlen(pc) == 0)
            {
//.........这里部分代码省略.........
开发者ID:risyomei-poppin-games,项目名称:PBS,代码行数:101,代码来源:qselect.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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