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

C++ ERROR_exit函数代码示例

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

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



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

示例1: expr_mult

static int expr_mult(State_t* state, Node_t *np)
{
	register int	tok = expr_cond(state, np);

	while ((tok&~T_OP)==T_MULT)
	{
		Node_t rp;
		int op = (tok&T_OP);
		tok = expr_cond(state, &rp);
		if (!numeric(np) || !numeric(&rp))
			error(ERROR_exit(2),"non-numeric argument");
		if (op && rp.num==0)
			error(ERROR_exit(2),"division by zero");
		switch(op)
		{
		    case 0:
			np->num *= rp.num;
			break;
		    case 1:
			np->num /= rp.num;
			break;
		    case 2:
			np->num %= rp.num;
		}
		np->type = T_NUM;
	}
	return tok;
}
开发者ID:nathanmkaya,项目名称:ksh-arch,代码行数:28,代码来源:expr.c


示例2: process_input_dsets

/*
 * for each input dataset name
 *    open (check dims, etc.)
 *    dilate (zeropad, make binary, dilate, unpad, apply)
 *    fill list of bytemask datasets
 *
 * also, count total volumes
 */
int process_input_dsets(param_t * params)
{
   THD_3dim_dataset * dset, * dfirst=NULL;
   int                iset, nxyz;

   ENTRY("process_input_dsets");

   if( !params ) ERROR_exit("NULL inputs to PID");

   if( params->ndsets <= 0 ) {
      ERROR_message("process_input_dsets: no input datasets");
      RETURN(1);
   }

   /* allocate space for dsets array */
   params->dsets = (THD_3dim_dataset **)malloc(params->ndsets*
                                               sizeof(THD_3dim_dataset*));
   if( !params->dsets ) ERROR_exit("failed to allocate dset pointers");

   if( params->verb ) INFO_message("processing %d input datasets...",
                                   params->ndsets);
   
   /* warn user of dilations */
   if(params->verb && params->ndsets) {
      int pad = needed_padding(&params->IND);
      INFO_message("padding all datasets by %d (for dilations)", pad);
   }

   /* process the datasets */
   nxyz = 0;
   for( iset=0; iset < params->ndsets; iset++ ) {
      /* open and verify dataset */
      dset = THD_open_dataset(params->inputs[iset]);
      if( !dset ) ERROR_exit("failed to open mask dataset '%s'",
                             params->inputs[iset]);
      DSET_load(dset);  CHECK_LOAD_ERROR(dset);

      if( params->verb>1 ) INFO_message("loaded dset %s, with %d volumes",
                                        DSET_PREFIX(dset), DSET_NVALS(dset));

      if( nxyz == 0 ) { /* make an empty copy of the first dataset */
         nxyz = DSET_NVOX(dset);
         dfirst = EDIT_empty_copy(dset);
      }

      /* check for consistency in voxels and grid */
      if( DSET_NVOX(dset) != nxyz ) ERROR_exit("nvoxel mis-match");
      if( ! EQUIV_GRIDS(dset, dfirst) )
         WARNING_message("grid from dset %s does not match that of dset %s",
                         DSET_PREFIX(dset), DSET_PREFIX(dfirst));

      /* apply dilations to all volumes, returning bytemask datasets */
      params->dsets[iset] = apply_dilations(dset, &params->IND,1,params->verb);
      if( ! params->dsets[iset] ) RETURN(1);
   } 

   DSET_delete(dfirst); /* and nuke */

   RETURN(0);
}
开发者ID:LJWilliams,项目名称:Neuroimaging,代码行数:68,代码来源:3dmask_tool.c


示例3: expr_cond

static int expr_cond(State_t* state, Node_t *np)
{
	register int	tok = getnode(state, np);

	while (tok==':')
	{
		regex_t re;
		regmatch_t match[2];
		int n;
		Node_t rp;
		char *cp;
		tok = getnode(state, &rp);
		if (np->type&T_STR)
			cp = np->str;
		else
			sfsprintf(cp=state->buf,sizeof(state->buf),"%d",np->num);
		np->num = 0;
		np->type = T_NUM;
		if (n = regcomp(&re, rp.str, REG_LEFT|REG_LENIENT))
			regfatal(&re, ERROR_exit(2), n);
		if (!(n = regexec(&re, cp, elementsof(match), match, 0)))
		{
			if (re.re_nsub > 0)
			{
				np->type = T_STR;
				if (match[1].rm_so >= 0)
				{
					np->str = cp + match[1].rm_so;
					np->str[match[1].rm_eo - match[1].rm_so] = 0;
					np->num = strtol(np->str,&cp,10);
					if (cp!=np->str && *cp==0)
						np->type |= T_NUM;
				}
				else
					np->str = "";
			}
			else
				np->num = match[0].rm_eo - match[0].rm_so;
		}
		else if (n != REG_NOMATCH)
			regfatal(&re, ERROR_exit(2), n);
		else if (re.re_nsub)
		{
			np->str = "";
			np->type = T_STR;
		}
		regfree(&re);
	}
	return tok;
}
开发者ID:nathanmkaya,项目名称:ksh-arch,代码行数:50,代码来源:expr.c


示例4: write_result

/* convert by hand, since no scaling will be done
 * (byte seems inappropriate and float does not need it)  */
int write_result(param_t * params, THD_3dim_dataset * oset,
                 int argc, char * argv[])
{
   short * sptr;
   int     nvox = DSET_NVOX(oset), ind;

   ENTRY("write_results");

   EDIT_dset_items(oset, ADN_prefix, params->prefix, ADN_none);

   if( params->verb )
      INFO_message("writing result %s...\n", DSET_PREFIX(oset));

   switch( params->datum ) {
      default: ERROR_exit("invalid datum for result: %d", params->datum);
      case MRI_short: break;     /* nothing to do */
      case MRI_float: {
         float * data = (float *)malloc(nvox*sizeof(float));
         sptr = DBLK_ARRAY(oset->dblk, 0);
         if( ! data ) ERROR_exit("failed to alloc %d output floats\n", nvox);
         for( ind = 0; ind < nvox; ind++ ) data[ind] = (float)sptr[ind];
         EDIT_substitute_brick(oset, 0, params->datum, data);
      }
      break;
      case MRI_byte: {
         byte * data = (byte *)malloc(nvox*sizeof(byte));
         int errs = 0;
         sptr = DBLK_ARRAY(oset->dblk, 0);
         if( ! data ) ERROR_exit("failed to alloc %d output bytes\n", nvox);
         for( ind = 0; ind < nvox; ind++ ) {
            if( sptr[ind] > 255 ) {     /* watch for overflow */
               data[ind] = (byte)255;
               errs++;
            } else data[ind] = (byte)sptr[ind];
         }
         EDIT_substitute_brick(oset, 0, params->datum, data);
         if(errs) WARNING_message("convert to byte: %d truncated voxels",errs);
      }
      break;
   }

   tross_Make_History( "3dmask_tool", argc, argv, oset );

   DSET_write(oset);
   WROTE_DSET(oset);

   RETURN(0);
}
开发者ID:LJWilliams,项目名称:Neuroimaging,代码行数:50,代码来源:3dmask_tool.c


示例5: b_break

int	b_break(register int n, register char *argv[],Shbltin_t *context)
{
	char *arg;
	register int cont= **argv=='c';
	register Shell_t *shp = context->shp;
	while((n = optget(argv,cont?sh_optcont:sh_optbreak))) switch(n)
	{
	    case ':':
		errormsg(SH_DICT,2, "%s", opt_info.arg);
		break;
	    case '?':
		errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg);
		return(2);
	}
	if(error_info.errors)
		errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
	argv += opt_info.index;
	n=1;
	if(arg= *argv)
	{
		n = (int)strtol(arg,&arg,10);
		if(n<=0 || *arg)
			errormsg(SH_DICT,ERROR_exit(1),e_nolabels,*argv);
	}
	if(shp->st.loopcnt)
	{
		shp->st.execbrk = shp->st.breakcnt = n;
		if(shp->st.breakcnt > shp->st.loopcnt)
			shp->st.breakcnt = shp->st.loopcnt;
		if(cont)
			shp->st.breakcnt = -shp->st.breakcnt;
	}
	return(0);
}
开发者ID:nathanmkaya,项目名称:ksh-arch,代码行数:34,代码来源:cflow.c


示例6: put_time

static void put_time(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
{
	struct dctime *dp = (struct dctime*)nfp;
	char *last;
	if(val)
	{
		int32_t t;
		if(flag&NV_INTEGER)
		{
			if(flag&NV_LONG)
				t = *(Sfdouble_t*)val;
			else
				t = *(double*)val;
		}
		else
		{
			t = tmdate(val, &last, (time_t*)0);
			if(*last)
				errormsg(SH_DICT,ERROR_exit(1),"%s: invalid date/time string",val);
		}
		nv_putv(np,(char*)&t,NV_INTEGER,nfp);
	}
	else
	{
		nv_unset(dp->format);
		free((void*)dp->format);
		nv_putv(np,val,flag,nfp);
	}
}
开发者ID:ISLEcode,项目名称:kornshell,代码行数:29,代码来源:open.c


示例7: B_login

int    B_login(int argc,char *argv[],void *extra)
{
	struct checkpt *pp;
	register struct login *logp=0;
	register Shell_t *shp;
	const char *pname;
	if(argc)
		shp = ((Shbltin_t*)extra)->shp;
	else
	{
		logp = (struct login*)extra;
		shp = logp->sh;
	}
	pp = (struct checkpt*)shp->jmplist;
	if(sh_isoption(SH_RESTRICTED))
		errormsg(SH_DICT,ERROR_exit(1),e_restricted,argv[0]);
	else
        {
		register struct argnod *arg=shp->envlist;
		register Namval_t* np;
		register char *cp;
		if(shp->subshell && !shp->subshare)
			sh_subfork();
		if(logp && logp->clear)
		{
#ifdef _ENV_H
			env_close(shp->env);
			shp->env = env_open((char**)0,3);
#else
			nv_scan(shp->var_tree,noexport,0,NV_EXPORT,NV_EXPORT);
#endif
		}
		while(arg)
		{
			if((cp=strchr(arg->argval,'=')) &&
				(*cp=0,np=nv_search(arg->argval,shp->var_tree,0)))
			{
				nv_onattr(np,NV_EXPORT);
				sh_envput(shp->env,np);
			}
			if(cp)
				*cp = '=';
			arg=arg->argnxt.ap;
		}
		pname = argv[0];
		if(logp && logp->arg0)
			argv[0] = logp->arg0;
#ifdef JOBS
		if(job_close(shp) < 0)
			return(1);
#endif /* JOBS */
		/* force bad exec to terminate shell */
		pp->mode = SH_JMPEXIT;
		sh_sigreset(2);
		sh_freeup(shp);
		path_exec(pname,argv,NIL(struct argnod*));
		sh_done(shp,0);
        }
	return(1);
}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:60,代码来源:misc.c


示例8: UNUSED

static_fn Namval_t *create_enum(Namval_t *np, const void *vp, nvflag_t flags, Namfun_t *fp) {
    UNUSED(flags);
    const char *name = vp;
    struct Enum *ep = (struct Enum *)fp;
    Namval_t *mp;
    const char *v;
    int i, n;
    mp = nv_namptr(ep->node, 0);
    mp->nvenv = np;
    for (i = 0; i < ep->nelem; i++) {
        v = ep->values[i];
        if (ep->iflag) {
            n = strcasecmp(v, name);
        } else {
            n = strcmp(v, name);
        }

        if (n == 0) {
            STORE_VT(mp->nvalue, i16, i);
            mp->nvname = (char *)v;
            fp->last = (char *)(name + strlen(name));
            return mp;
        }
    }

    error(ERROR_exit(1), "%s:  invalid enum constant for %s", name, nv_name(np));
    return mp;
}
开发者ID:att,项目名称:ast,代码行数:28,代码来源:enum.c


示例9: put_enum

static_fn void put_enum(Namval_t *np, const void *val, nvflag_t flags, Namfun_t *fp) {
    struct Enum *ep = (struct Enum *)fp;
    const char *v;
    int n;
    if (!val && !(flags & NV_INTEGER)) {
        nv_putv(np, val, flags, fp);
        nv_disc(np, &ep->namfun, DISC_OP_POP);
        if (!ep->namfun.nofree) free_enum(ep);
        return;
    }
    if (flags & NV_INTEGER) {
        nv_putv(np, val, flags, fp);
        return;
    }

    for (int i = 0; i < ep->nelem; i++) {
        v = ep->values[i];
        if (ep->iflag) {
            n = strcasecmp(v, val);
        } else {
            n = strcmp(v, val);
        }

        if (n == 0) {
            // TODO: Figure out if a static var is correct. The code used to store a pointer to the
            // stack local var `i` which is obviously wrong and only works by accident if the
            // pointer is used before the stack location is overwritten.
            static uint16_t x;
            x = i;
            nv_putv(np, (char *)&x, NV_UINT16, fp);
            return;
        }
    }
    if (nv_isattr(np, NV_NOFREE)) error(ERROR_exit(1), "%s:  invalid value %s", nv_name(np), val);
}
开发者ID:att,项目名称:ast,代码行数:35,代码来源:enum.c


示例10: put_enum

static void put_enum(Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
	struct Enum 		*ep = (struct Enum*)fp;
	register const char	*v;
	unsigned short		i=0, n;
	if(!val && !(flags&NV_INTEGER))
	{
		nv_putv(np, val, flags,fp);
		nv_disc(np,&ep->hdr,NV_POP);
		if(!ep->hdr.nofree)
			free((void*)ep);
		return;
	}
	if(flags&NV_INTEGER)
	{
		nv_putv(np,val,flags,fp);
		return;
	}
	while(v=ep->values[i])
	{
		if(ep->iflag)
			n = strcasecmp(v,val);
		else
			n = strcmp(v,val);
		if(n==0)
		{
			nv_putv(np, (char*)&i, NV_UINT16, fp);
			return;
		}
		i++;
	}
	if(nv_isattr(np,NV_NOFREE))
		error(ERROR_exit(1), "%s:  invalid value %s",nv_name(np),val);
}
开发者ID:nathanmkaya,项目名称:ksh-arch,代码行数:34,代码来源:enum.c


示例11: b_shift

//
// Builtin `shift`.
//
int b_shift(int n, char *argv[], Shbltin_t *context) {
    char *arg;
    Shell_t *shp = context->shp;
    while ((n = optget(argv, sh_optshift))) {
        switch (n) {
            case ':': {
                errormsg(SH_DICT, 2, "%s", opt_info.arg);
                break;
            }
            case '?': {
                errormsg(SH_DICT, ERROR_usage(0), "%s", opt_info.arg);
                return 2;
            }
            default: { break; }
        }
    }

    if (error_info.errors) {
        errormsg(SH_DICT, ERROR_usage(2), "%s", optusage(NULL));
        __builtin_unreachable();
    }

    argv += opt_info.index;
    n = ((arg = *argv) ? (int)sh_arith(shp, arg) : 1);
    if (n < 0 || shp->st.dolc < n) {
        errormsg(SH_DICT, ERROR_exit(1), e_number, arg);
        __builtin_unreachable();
    } else {
        shp->st.dolv += n;
        shp->st.dolc -= n;
    }
    return 0;
}
开发者ID:att,项目名称:ast,代码行数:36,代码来源:misc.c


示例12: mesg

static int mesg(int  mode)
{
	struct stat statb;
	char *tty = ttyname(2);
	if(!tty)
		tty = ttyname(0);
	if(!tty)
		tty = ttyname(1);
	if(!tty)
		error(ERROR_exit(1),"cannot find terminal");
	if(stat(tty,&statb)<0)
		error(ERROR_system(1),"%s: cannot stat",tty);
	switch(mode)
	{
	    case 'n':
	    case 'y':
		if(mode=='y')
			statb.st_mode |= S_IWGRP;
		else
			statb.st_mode &= ~S_IWGRP;
		if(chmod(tty, statb.st_mode) < 0)
			error(ERROR_system(1),"%s: cannot stat",tty);
		break;
	    case 0:
		sfprintf(sfstdout,"%c\n",(statb.st_mode&S_IWGRP)?'y':'n');
	}
	return((statb.st_mode&S_IWGRP)==0);
}
开发者ID:ISLEcode,项目名称:kornshell,代码行数:28,代码来源:mesg.c


示例13: GradConv_Gsign_from_BmatA

// take a len=6 matr and an empt len =3 grad file, calc grads from matr
int GradConv_Gsign_from_BmatA( float *grad, float *matr )
{
   int i;
   int signum[3] = {1,1,1};

   if( (matr[0]<0) || (matr[1]<0) || (matr[2]<0) )
      ERROR_exit("Matrices don't appear to be correct format-- check again") ;

   // get signs for grads
   for( i=0 ; i<3 ; i++)
      if( matr[3+i] < 0 )
         signum[2-i] = -1; // if all neg, then same as having all pos because of symmetry still

   for( i=0 ; i<3 ; i++)
      if ( matr[i] >= 0 ) {
         grad[i] = (float) sqrt(matr[i]);
         grad[i]*= signum[i];
      }
      else {
         WARNING_message("matrices don't appear to be correct format-- check again") ;
         grad[i] = 0;
      }

   return 1;
}
开发者ID:bryancort,项目名称:afni,代码行数:26,代码来源:1dDW_Grad_o_Mat.c


示例14: b_ulimit

	int	b_ulimit(int argc,char *argv[],void *extra)
	{
		NOT_USED(argc);
		NOT_USED(argv);
		NOT_USED(extra);
		errormsg(SH_DICT,ERROR_exit(2),e_nosupport);
		return(0);
	}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:8,代码来源:ulimit.c


示例15: b_dot_cmd

int    b_dot_cmd(register int n,char *argv[],void* extra)
{
	register char *script;
	register Namval_t *np;
	register int jmpval;
	register Shell_t *shp = ((Shbltin_t*)extra)->shp;
	struct sh_scoped savst, *prevscope = shp->st.self;
	char *filename=0;
	int	fd;
	struct dolnod   *argsave=0, *saveargfor;
	struct checkpt buff;
	Sfio_t *iop=0;
	short level;
	while (n = optget(argv,sh_optdot)) switch (n)
	{
	    case ':':
		errormsg(SH_DICT,2, "%s", opt_info.arg);
		break;
	    case '?':
		errormsg(SH_DICT,ERROR_usage(0), "%s",opt_info.arg);
		return(2);
	}
	argv += opt_info.index;
	script = *argv;
	if(error_info.errors || !script)
		errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
	if(shp->dot_depth+1 > DOTMAX)
		errormsg(SH_DICT,ERROR_exit(1),e_toodeep,script);
	if(!(np=shp->posix_fun))
	{
		/* check for KornShell style function first */
		np = nv_search(script,shp->fun_tree,0);
		if(np && is_afunction(np) && !nv_isattr(np,NV_FPOSIX))
		{
			if(!np->nvalue.ip)
			{
				path_search(script,NIL(Pathcomp_t**),0);
				if(np->nvalue.ip)
				{
					if(nv_isattr(np,NV_FPOSIX))
						np = 0;
				}
				else
					errormsg(SH_DICT,ERROR_exit(1),e_found,script);
			}
		}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:46,代码来源:misc.c


示例16: b_bg

//
// Builtin `bg`.
//
int b_bg(int n, char *argv[], Shbltin_t *context) {
    int flag = **argv;
    Shell_t *shp = context->shp;
    const char *optstr = sh_optbg;
    if (*argv[0] == 'f') {
        optstr = sh_optfg;
    } else if (*argv[0] == 'd') {
        optstr = sh_optdisown;
    }

    while ((n = optget(argv, optstr))) {
        switch (n) {
            case ':': {
                errormsg(SH_DICT, 2, "%s", opt_info.arg);
                break;
            }
            case '?': {
                errormsg(SH_DICT, ERROR_usage(2), "%s", opt_info.arg);
                __builtin_unreachable();
            }
            default: { break; }
        }
    }
    if (error_info.errors) {
        errormsg(SH_DICT, ERROR_usage(2), "%s", optusage(NULL));
        __builtin_unreachable();
    }

    argv += opt_info.index;
    if (!sh_isoption(shp, SH_MONITOR) || !job.jobcontrol) {
        if (sh_isstate(shp, SH_INTERACTIVE)) {
            errormsg(SH_DICT, ERROR_exit(1), e_no_jctl);
            __builtin_unreachable();
        }
        return 1;
    }
    if (flag == 'd' && *argv == 0) argv = NULL;
    if (job_walk(shp, sfstdout, job_switch, flag, argv)) {
        errormsg(SH_DICT, ERROR_exit(1), e_no_job);
        __builtin_unreachable();
    }
    return shp->exitval;
}
开发者ID:att,项目名称:ast,代码行数:46,代码来源:misc.c


示例17: CompareSetDims

// use Ndim to set number of dimensions to check: 3 or 4
int CompareSetDims(THD_3dim_dataset *A, THD_3dim_dataset *B, int Ndim)
{
   int DimA[4] = {0,0,0,0}, DimB[4] = {0,0,0,0};
   int i;

   if ( Ndim > 4)
      ERROR_exit("Bad call to CompareSetDims-- overtime!");

   DimA[0] = DSET_NX(A);   DimA[1] = DSET_NY(A); 
   DimA[2] = DSET_NZ(A);   DimA[3] = DSET_NVALS(A);

   DimB[0] = DSET_NX(B);   DimB[1] = DSET_NY(B); 
   DimB[2] = DSET_NZ(B);   DimB[3] = DSET_NVALS(B);

   for ( i=0 ; i<Ndim ; i++)
      if ( DimA[i] != DimA[i] )
         ERROR_exit("Bad dimensional matching of inputs: '%s' and '%s'!",
                    DSET_PREFIXSTR(A), DSET_PREFIXSTR(B));

   return 0;
}
开发者ID:neurodebian,项目名称:afni,代码行数:22,代码来源:checks_and_balances.c


示例18: main

int main( int argc , char *argv[] )
{
   wtarray *wt_for , *wt_inv ;
   int jj ;
   int nwf=NW , nwi=0 ;
   float err , aa=0.222 ;

   if( argc > 1 ){
     nwf = (int)strtod(argv[1],NULL) ;
     if( nwf < 1 || nwf > 99 ) nwf = NW ;
   }
   if( argc > 2 ){
     nwi = (int)strtod(argv[2],NULL) ;
     if( nwi < 1 || nwi > 999 ) nwi = 0 ;
   }
   if( nwi < 1 ) nwi = nwf ;
   if( argc > 3 ){
     aa = (float)strtod(argv[3],NULL) ;
   }

   INIT_wtarray(wt_for,1.0f,nwf) ;
   INIT_wtarray(wt_inv,1.0f,0  ) ;

   for( jj=1 ; jj <= nwf ; jj++ )
     wt_for->wt[jj-1] = aa /(jj*jj + 1.0f) ;

   err = wtarray_inverse( 66*MAX(nwf,nwi) , wt_for , nwi , wt_inv ) ;

   if( wt_inv->nwt == 0 || wt_inv->wt == NULL ) ERROR_exit("Bad wt_inv!") ;

   printf("err = %.5g\n",err) ;

   printf("z := x -> %f * x ",wt_inv->a) ;
   for( jj=1 ; jj <= nwi ; jj++ ){
     if( wt_inv->wt[jj-1] != 0.0f ){
       if( wt_inv->wt[jj-1] >  0.0f ) printf(" +") ;
       printf("%f * sin(%d*Pi*x)" , wt_inv->wt[jj-1] , 2*jj ) ;
     }
   }
   printf(";\n") ;

   printf("y := x -> %f * x ",wt_for->a) ;
   for( jj=1 ; jj <= nwf ; jj++ ){
     if( wt_for->wt[jj-1] != 0.0f ){
       if( wt_for->wt[jj-1] >  0.0f ) printf(" +") ;
       printf("%f * sin(%d*Pi*x)" , wt_for->wt[jj-1] , 2*jj ) ;
     }
   }
   printf(";\n") ;

   exit(0) ;
}
开发者ID:Gilles86,项目名称:afni,代码行数:52,代码来源:mri_wf.c


示例19: return

static char *nxtarg(struct test *tp,int mt)
{
	if(tp->ap >= tp->ac)
	{
		if(mt)
		{
			tp->ap++;
			return(0);
		}
		errormsg(SH_DICT,ERROR_exit(2),e_argument);
	}
	return(tp->av[tp->ap++]);
}
开发者ID:ISLEcode,项目名称:kornshell,代码行数:13,代码来源:test.c


示例20: GenFeatureDist

int GenFeatureDist(SEG_OPTS *Opt) 
{
   
   ENTRY("GenFeatureDist");
   
   
   /* get the probability maps */
   if (!Opt->pset && Opt->DO_p) {
      if (!(Opt->pset = p_C_GIV_A(Opt))) {
         ERROR_message("Failed miserably");
         RETURN(0);
      }
   }
      
   /* Get the classes */
   if (!Opt->cset && Opt->crefix && Opt->DO_c) {
      if (!(SUMA_assign_classes_eng(Opt->pset, 
                           Opt->clss->str, Opt->clss->num, Opt->keys, 
                           Opt->cmask, &Opt->cset))) {
         ERROR_message("Failed aimlessly");
         RETURN(0);
      }
      EDIT_dset_items(Opt->cset, ADN_prefix, Opt->crefix, ADN_none);
      if( !THD_ok_overwrite() && THD_is_file( DSET_HEADNAME(Opt->cset) ) ){
      ERROR_exit("Output file %s already exists -- cannot continue!\n",
                  DSET_HEADNAME(Opt->cset) ) ;
      }
   }  
   
   /* group classes ? */
   if (Opt->group_classes) {
      THD_3dim_dataset *gcset=NULL;
      THD_3dim_dataset *gpset=NULL;
      if (!SUMA_Regroup_classes (Opt, 
                     Opt->clss->str, Opt->clss->num, Opt->keys,
                     Opt->group_classes->str,
                     Opt->group_classes->num,
                     Opt->group_keys, Opt->cmask,
                     Opt->pset, 
                     Opt->cset,
                     &gpset, 
                     &gcset) ) {
         ERROR_message("Failed to regroup");
         RETURN(0);
      }
      DSET_write(gpset);
      DSET_write(gcset);
   }
          
   RETURN(1);
}
开发者ID:afni,项目名称:rmafni,代码行数:51,代码来源:SUMA_3dGenFeatureDist.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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