您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ trap函数代码示例

51自学网 2021-06-03 08:57:22
  C++
这篇教程C++ trap函数代码示例写得很实用,希望能帮到您。

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

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

示例1: err_get_code

/** * @public * @brief extract err code from err * @param[in] e err * @retval uint32_t code */uint32_t  err_get_code( err_t const *e ){  trap( e );  trap( e->code != CODE_NONE );  return e->code;}
开发者ID:apalrd,项目名称:o5e_firmware,代码行数:13,


示例2: fifo_pop

/** * @public * @brief pop node from the back of the list * @param[in] fifo list root * @retval void* popped node * @note { not threadsafe } */void *  fifo_pop( void *fifo ){  trap( fifo );  fifo_t *const f = fifo;  fifo_t *n = 0;  if( f->head || f->tail )          /**< 1+ nodes in list                 */  {    n = f->tail;                    /**< pop from tail                    */    trap( n->next == 0 );           /**< last node shouldn't have been    */                                    /*   pointing to anything next        */    if( f->head != f->tail )        /**< 2+ nodes in list ?               */    {      f->tail = n->prev;            /**< safe to update tail              */      f->tail->next = 0;            /**< terminate list properly          */      n->prev = 0;                  /**< not required, but safe           */    }    else                            /**< that was last node in the list   */    {      trap( n->prev == 0 );         /**< which means it shouldn't have    */                                    /*   been pointing to anything prev   */      f->tail = f->head = 0;        /**< now empty                        */    }  }  return n;}
开发者ID:apalrd,项目名称:o5e_firmware,代码行数:35,


示例3: FdmDoSaveAction

static BOOL FdmDoSaveAction(HWND hwnd, char *szpath, int act, int sact){    switch (act) {        case 0:            check_extension(szpath, ".cfg");            return resources_save(szpath);        case 1:            check_extension(szpath, ".vsf");            return trap(hwnd, save_snapshot, szpath);        case 2:            switch (sact) {                case 0:                    check_extension(szpath, ".png");                    break;                case 1:                    check_extension(szpath, ".bmp");                    break;            }            return trap(hwnd, save_screenshot, szpath);        case 3:            check_extension(szpath, ".vfl");            return fliplist_save_list(sact+8, szpath);        case 4:            return machine_romset_file_save(szpath);    }    return -1;}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:27,


示例4: xhallfunc

/* -------------------------------------------------------------------- */xhallfunc(int roomslot, int xyn, int fl){    int yn;    if (hallBuf->hall[thisHall].hroomflags[roomslot].inhall)    {        yn=getYesNo("Exclude from hall", (char)xyn);        if (yn == 2) return FALSE;        if (yn)        {            hallBuf->hall[thisHall].hroomflags[roomslot].inhall = FALSE;            sprintf(msgBuf->mbtext,            "Room %s excluded from hall %s by %s",             roomTab[roomslot].rtname,             hallBuf->hall[thisHall].hallname,             logBuf.lbname );            trap(msgBuf->mbtext, T_AIDE);            if (!fl)            {                aideMessage();            }else{                              amPrintf(" Excluded %s/n",                       roomTab[roomslot].rtname,                       hallBuf->hall[thisHall].hallname);                changed_room = TRUE;            }        }    }else{      yn=getYesNo("Add to hall", (char)xyn);      if (yn == 2) return FALSE;      if (yn)      {          hallBuf->hall[thisHall].hroomflags[roomslot].inhall = TRUE;          sprintf(msgBuf->mbtext,             "Room %s added to hall %s by %s",             roomTab[roomslot].rtname,             hallBuf->hall[thisHall].hallname,             logBuf.lbname );          trap(msgBuf->mbtext, T_AIDE);            if (!fl)            {                aideMessage();            }else{                amPrintf(" Added    %s/n",                       roomTab[roomslot].rtname);                changed_room = TRUE;            }      }    }    return TRUE;}
开发者ID:dylancarlson,项目名称:atlas,代码行数:59,


示例5: main

int main() {	{		int height[] = { 4,2,3 };		printf("%d/n", trap(height, sizeof(height) / sizeof(int)));	}	{		int height[] = { 0,1,0,2,1,0,1,3,2,1,2,1 };		printf("%d/n", trap(height, sizeof(height) / sizeof(int)));	}	system("PAUSE");	return 0;}
开发者ID:kyu-sz,项目名称:LeetCode-Solutions,代码行数:12,


示例6: purgeuserlog

void TERMWINDOWMEMBER purgeuserlog(void)	{	Bool done = FALSE;	for (l_slot i = (l_slot) (cfg.MAXLOGTAB - 1); i >= 0 && !done; i--)		{		if (LTab(i).IsInuse())			{			label UserName;			LTab(i).GetName(UserName, sizeof(UserName));			if (!loggedIn || !CurrentUser->IsSameName(UserName))				{				char prompt[256];				sprintf(prompt, getsysmsg(57), cfg.Luser_nym, UserName);				const int response = getYesNo(prompt, 3);				if (response == 1)					{					LogEntry1 Log1;					Log1.Clear();					if (Log1.Save(LTab(i).GetLogIndex()))						{                        if(!read_tr_messages())                            {                            errorDisp(getmsg(172));                            done = TRUE;                            return;                            }#ifdef WINCIT                        trap(T_SYSOP, WindowCaption, gettrmsg(16), UserName);#else                        trap(T_SYSOP, gettrmsg(16), UserName);#endif                        dump_tr_messages();						}					}				else if (response == 2)					{					done = TRUE;					}				}			}		}	}
开发者ID:dylancarlson,项目名称:citplus,代码行数:49,


示例7: append

static Line_t*append(char* (*f)(void), Line_t* a, Line_t** r){	register char*		s;	register Line_t*	a1;	register Line_t*	a2;	register Line_t*	a3;	off_t			t;	long			added;	added = 0;	ed.dot = a;	while (s = (*f)()) {		trap();		if ((ed.dol - ed.zero) + 1 >= ed.all) {			unsigned long	dot_off = ed.dot - ed.zero;			unsigned long	dol_off = ed.dol - ed.zero;			unsigned long	r_off = r ? *r - ed.zero : 0;			ed.all += BLOCK_LINE;			if (!(ed.zero = newof(ed.zero, Line_t, ed.all, 0))) {				error(ERROR_SYSTEM|1, "no space [zero]");				ed.caught = SIGHUP;				trap();			}			ed.dot = ed.zero + dot_off;			ed.dol = ed.zero + dol_off;			if (r)				*r = ed.zero + r_off;		}		t = lineput(s);		added++;		a1 = ++ed.dol;		a2 = a1 + 1;		a3 = ++ed.dot;		while (a1 > a3) {			(--a2)->event = ed.event;			a2->undo = a2->offset;			a2->offset = (--a1)->offset;		}		a3->event = ed.event;		a3->undo = a3->offset;		a3->offset = t;	}	if (r)		*r += added;	return ed.dot;}
开发者ID:ISLEcode,项目名称:kornshell,代码行数:48,


示例8: _stateFile

IOErrorHandler::IOErrorHandler(StateFile *stateFile)    : _stateFile(stateFile),      _trapped(false),      _fired(false){    trap();}
开发者ID:songhtdo,项目名称:vespa,代码行数:7,


示例9: getCSR

static DWORDgetCSR(Processor *p, int csr) {    switch(csr) {    case r_MHARTID:        return p->csr[i_MHARTID];    case r_MSTATUS:        return p->csr[i_MSTATUS];    case r_MTVEC:        return p->csr[i_MTVEC];    case r_MEPC:        return p->csr[i_MEPC];    case r_MBADADDR:        return p->csr[i_MBADADDR];    case r_MCAUSE:        return p->csr[i_MCAUSE];    case r_MTOHOST:        return p->csr[i_MTOHOST];    case r_MFROMHOST:        return p->csr[i_MFROMHOST];    case r_MIE:        return p->csr[i_MIE];    case r_MIP:        return ipr;	/* See address-space.c */    default:        trap(p, 2);	// Illegal CSR addresses are now spec'd to trigger illegal instruction traps. (RV64S V1.9)        fprintf(stderr, "Warning: At $%016llX, attempt to read unsupported CSR %d/n", p->pc-4, csr);        return 0xCCCCCCCCCCCCCCCC;    }}
开发者ID:sam-falvo,项目名称:kestrel,代码行数:29,


示例10: recursive_apply

expr_ptr recursive_apply(expr_ptr& expr, expr_ptr (simplifier)(expr_ptr& expr, bool&), bool& mod){	switch(expr->get_type())	{		case MULT     : { binary*b=(binary*) expr.release(); expr = Binary{new multiplication{ recursive_apply(b->first, simplifier, mod), recursive_apply(b->second, simplifier, mod) }}; break; }		case DIV      : { binary*b=(binary*) expr.release(); expr = Binary{new division      { recursive_apply(b->first, simplifier, mod), recursive_apply(b->second, simplifier, mod) }}; break; }		case ADD      : { binary*b=(binary*) expr.release(); expr = Binary{new addition      { recursive_apply(b->first, simplifier, mod), recursive_apply(b->second, simplifier, mod) }}; break; }		case SUB      : { binary*b=(binary*) expr.release(); expr = Binary{new subtraction   { recursive_apply(b->first, simplifier, mod), recursive_apply(b->second, simplifier, mod) }}; break; }		case EXPO     : { break; }		case LOG      : { break; }		case NEGATE   : { Negation n{(negation*) expr.release()}; expr = recursive_apply(n->orig, simplifier, mod); break; }		case VARIABLE : { break; }		case INTERVAL : { break; }		case IEEE     : { break; }		case REAL     : { break; }		case COMPLEX  : { break; }		case ZERO     : { break; }		case UNITY    : { break; }		case ANYTHING : { break; }		case NAN      : { break; }		case INFINITY : { break; }		default:			trap("Unable to simplify expression of type: " + expr->get_text());	}	return simplifier(expr, mod);}
开发者ID:U2hH9kRga5Fl0b,项目名称:turbo-epsilon,代码行数:26,


示例11: simplify_an_expression

expr_ptr simplify_an_expression(expr_ptr& expr, bool& mod){//	expr->append_text(std::cout << "simplifying: ") << std::endl;	switch(expr->get_type())	{		case REAL    : /* return simplify     (Real           {(real           *) expr.release()}, mod); */ break;		case COMPLEX : /* return simplify     (Complex        {(complex        *) expr.release()}, mod); */ break;		case MULT    :    return  simplify_mult(Multiplication {(multiplication *) expr.release()}, mod);		case DIV     : /* return simplify     (Division       {(division       *) expr.release()}, mod); */ break;		case ADD     :    return simplify_add (Addition       {(addition       *) expr.release()}, mod);		case SUB     : /* return simplify     (Subtraction    {(subtraction    *) expr.release()}, mod); */ break;		case EXPO    : /* return simplify     (Exponent       {(exponent       *) expr.release()}, mod); */ break;		case NEGATE  :    return simplify_neg (Negation       {(negation       *) expr.release()}, mod);		case VARIABLE: /* return simplify     (Variable       {(variable       *) expr.release()}, mod); */ break;		case LOG     : /* return simplify     (expr_ptr       {(expression_raw *) expr.release()}, mod); */ break;		case INTERVAL: /* return simplify     (expr_ptr       {(expression_raw *) expr.release()}, mod); */ break;		case IEEE    : /* return simplify     (expr_ptr       {(expression_raw *) expr.release()}, mod); */ break;		case ZERO    : /* return expr_ptr{expr.release()};                                               */ break;		case UNITY   : /* return expr_ptr{expr.release()};                                               */ break;		case ANYTHING: /* return expr_ptr{expr.release()};                                               */ break;		case NAN     : /* return expr_ptr{expr.release()};                                               */ break;		case INFINITY: /* return expr_ptr{expr.release()};                                               */ break;		default:			trap("Unable to simplify expression of type: " + expr->get_text());	}	return expr_ptr{expr.release()};}
开发者ID:U2hH9kRga5Fl0b,项目名称:turbo-epsilon,代码行数:29,


示例12: trap

BitField StateConstraints::minimalTrap(const PetriNet& net,									   const MarkVal* marking,									   const MarkVal* resultMarking) const{	const size_t nPlaces = net.numberOfPlaces();	BitField trap(nPlaces);	trap.set();	trap = maxTrap(net, trap, resultMarking);	if(!isMarked(trap, marking))		return BitField(nPlaces).clear();	//Get the exclusion candidates	BitField EC(trap);	BitField tmp(nPlaces);	while(EC.any()){		int exclude = EC.first();		tmp = trap;		tmp.clear(exclude);		EC.clear(exclude);		tmp = maxTrap(net, tmp, resultMarking);		if(isMarked(tmp, marking)){			trap = tmp;			EC = tmp;		}	}	return trap;}
开发者ID:jonasfj,项目名称:PeTe,代码行数:26,


示例13: powerpc_interrupt

/* * A very short dispatch, to try and maximise assembler code use * between all exception types. Maybe 'true' interrupts should go * here, and the trap code can come in separately */voidpowerpc_interrupt(struct trapframe *framep){        struct thread *td;	struct clockframe ckframe;	td = curthread;	switch (framep->exc) {	case EXC_EXI:		atomic_add_int(&td->td_intr_nesting_level, 1);		(*powerpc_extintr_handler)();		atomic_subtract_int(&td->td_intr_nesting_level, 1);			break;	case EXC_DECR:		atomic_add_int(&td->td_intr_nesting_level, 1);		ckframe.srr0 = framep->srr0;		ckframe.srr1 = framep->srr1;		decr_intr(&ckframe);		atomic_subtract_int(&td->td_intr_nesting_level, 1);			break;	default:		/*		 * Re-enable interrupts and call the generic trap code		 */#if 0		printf("powerpc_interrupt: got trap/n");#endif		mtmsr(mfmsr() | PSL_EE);		isync();		trap(framep);	}	        }
开发者ID:MarginC,项目名称:kame,代码行数:40,


示例14: powerpc_mchk_interrupt

void powerpc_mchk_interrupt(struct trapframe *framep){	printf("powerpc_mchk_interrupt: machine check interrupt!/n");	dump_frame(framep);	trap(framep);}
开发者ID:coyizumi,项目名称:cs111,代码行数:7,


示例15: rombergRec

//the private recursive methoddouble RecursiveIntegration::rombergRec(MultiVarFunction* f, int dim, double* a, double* b, int n, double* coords){   //each level of recursion needs storage space   double* evals = new double[n + 1];   double h = (b[dim] - a[dim])/n;   coords[dim] = a[dim];  //need to reset for each pass   for (int j = 0; j <= n; j++)  //loop over the number of points (number of intervals plus one)   {      if (dim == 0)  //base case, function evaluation      {         evals[j] = f->evaluate(coords);      }      else      {         evals[j] = rombergRec(f, dim - 1, a, b, n, coords);      }      coords[dim] = coords[dim] + h;   }         double result = trap(evals, n, a[dim], b[dim]);   delete[] evals;   return result;}
开发者ID:Jrwilliams43,项目名称:DSALab07,代码行数:28,


示例16: unlink

int unlink(const char *path){        argstr_t args;        args.as_len = strlen(path);        args.as_str = path;        return trap(SYS_unlink, (uint32_t) &args);}
开发者ID:AnupreetKJohar,项目名称:weenix,代码行数:7,


示例17: sig_trap

/* * call-seq: *   Signal.trap( signal, command ) -> obj *   Signal.trap( signal ) {| | block } -> obj * * Specifies the handling of signals. The first parameter is a signal * name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on) or a * signal number. The characters ``SIG'' may be omitted from the * signal name. The command or block specifies code to be run when the * signal is raised. * If the command is the string ``IGNORE'' or ``SIG_IGN'', the signal * will be ignored. * If the command is ``DEFAULT'' or ``SIG_DFL'', the Ruby's default handler * will be invoked. * If the command is ``EXIT'', the script will be terminated by the signal. * If the command is ``SYSTEM_DEFAULT'', the operating system's default * handler will be invoked. * Otherwise, the given command or block will be run. * The special signal name ``EXIT'' or signal number zero will be * invoked just prior to program termination. * trap returns the previous handler for the given signal. * *     Signal.trap(0, proc { puts "Terminating: #{$$}" }) *     Signal.trap("CLD")  { puts "Child died" } *     fork && Process.wait * * produces: *     Terminating: 27461 *     Child died *     Terminating: 27460 */static VALUEsig_trap(int argc, VALUE *argv){    int sig;    sighandler_t func;    VALUE cmd;    rb_secure(2);    rb_check_arity(argc, 1, 2);    sig = trap_signm(argv[0]);    if (reserved_signal_p(sig)) {        const char *name = signo2signm(sig);        if (name)            rb_raise(rb_eArgError, "can't trap reserved signal: SIG%s", name);        else            rb_raise(rb_eArgError, "can't trap reserved signal: %d", sig);    }    if (argc == 1) {	cmd = rb_block_proc();	func = sighandler;    }    else {	cmd = argv[1];	func = trap_handler(&cmd, sig);    }    if (OBJ_TAINTED(cmd)) {	rb_raise(rb_eSecurityError, "Insecure: tainted signal trap");    }    return trap(sig, func, cmd);}
开发者ID:yugui,项目名称:ruby,代码行数:65,


示例18: getchr

static intgetchr(void){	int	n;	if (ed.lastc = ed.peekc) {		ed.peekc = 0;		return ed.lastc;	}	if (ed.global) {		if (ed.lastc = *ed.global++)			return ed.lastc;		ed.global = 0;		return EOF;	}	if (!ed.input) {		if (!(ed.input = sfgetr(sfstdin, '/n', 1))) {			trap();			return EOF;		}		if ((n = sfvalue(sfstdin) - 2) >= 0 && ed.input[n] == '/r')			ed.input[n--] = 0;		ed.spbeg = ed.input;		ed.spend = (n >= 0 && ed.input[n] == '//') ? (ed.input + n) : (char*)0;	}	if (!(ed.lastc = *ed.input++)) {		ed.input = 0;		ed.lastc = '/n';	}	return ed.lastc;}
开发者ID:ISLEcode,项目名称:kornshell,代码行数:31,


示例19: powerpc_crit_interrupt

void powerpc_crit_interrupt(struct trapframe *framep){	printf("powerpc_crit_interrupt: critical interrupt!/n");	dump_frame(framep);	trap(framep);}
开发者ID:coyizumi,项目名称:cs111,代码行数:7,


示例20: killhall

/* -------------------------------------------------------------------- */void killhall(void){    int empty = TRUE, i;    if (thisHall == 0 || thisHall == 1)    {        mPrintf("/nThe Main and Maintenance hallways cannot be killed.");        return;    }        /* Check hall for any rooms */    for (i = 0; i < MAXROOMS; i++)    {        if ( hallBuf->hall[thisHall].hroomflags[i].inhall          && roomTab[i].rtflags.INUSE) empty = FALSE;    }    if (!empty)     {        mPrintf("/n Hall still has rooms.");        return;    }    if (getYesNo(confirm, 0))    {        hallBuf->hall[thisHall].h_inuse = FALSE;        hallBuf->hall[thisHall].owned   = FALSE;        putHall();       sprintf(msgBuf->mbtext,       "Hallway %s deleted", hallBuf->hall[thisHall].hallname );       trap(msgBuf->mbtext, T_SYSOP);    }}
开发者ID:dylancarlson,项目名称:atlas,代码行数:36,


示例21: test_trap

void test_trap(void){  I0 = 0;  I0 = 0;  *pcToLoad = 0x012244; //*pcToLoad + 1 = 0x012245  //pcl =0x45//pch =0x22//pce =0x01   YL = 0XE4;  YH = 0XD6;  XL = 0XC9;  XH = 0X68;  A  = 0XBB;  CC = 0X55;  	uint8_t instr[] = {0XBB};  TEST_ASSERT_EQUAL_INT8(1, trap(instr));  TEST_ASSERT_EQUAL_INT16(0x012245, *pcToLoad);  TEST_ASSERT_EQUAL_INT8(0X55, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0XBB, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0X68, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0XC9, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0XD6, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0XE4, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0X01, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0X22, mcu_pop());  TEST_ASSERT_EQUAL_INT8(0X45, mcu_pop());    TEST_ASSERT_EQUAL_INT8(1, I0);  TEST_ASSERT_EQUAL_INT8(1, I1);}
开发者ID:Raydivine,项目名称:STM8-Simulator,代码行数:32,


示例22: sig_trap

/* * call-seq: *   Signal.trap( signal, command ) -> obj *   Signal.trap( signal ) {| | block } -> obj * * Specifies the handling of signals. The first parameter is a signal * name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on) or a * signal number. The characters ``SIG'' may be omitted from the * signal name. The command or block specifies code to be run when the * signal is raised. * If the command is the string ``IGNORE'' or ``SIG_IGN'', the signal * will be ignored. * If the command is ``DEFAULT'' or ``SIG_DFL'', the Ruby's default handler * will be invoked. * If the command is ``EXIT'', the script will be terminated by the signal. * If the command is ``SYSTEM_DEFAULT'', the operating system's default * handler will be invoked. * Otherwise, the given command or block will be run. * The special signal name ``EXIT'' or signal number zero will be * invoked just prior to program termination. * trap returns the previous handler for the given signal. * *     Signal.trap(0, proc { puts "Terminating: #{$$}" }) *     Signal.trap("CLD")  { puts "Child died" } *     fork && Process.wait * * produces: *     Terminating: 27461 *     Child died *     Terminating: 27460 */static VALUEsig_trap(int argc, VALUE *argv){    struct trap_arg arg;    rb_secure(2);    if (argc < 1 || argc > 2) {	rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..2)", argc);    }    arg.sig = trap_signm(argv[0]);    if (argc == 1) {	arg.cmd = rb_block_proc();	arg.func = sighandler;    }    else {	arg.cmd = argv[1];	arg.func = trap_handler(&arg.cmd, arg.sig);    }    if (OBJ_TAINTED(arg.cmd)) {	rb_raise(rb_eSecurityError, "Insecure: tainted signal trap");    }#if USE_TRAP_MASK    /* disable interrupt */    sigfillset(&arg.mask);    pthread_sigmask(SIG_BLOCK, &arg.mask, &arg.mask);    return rb_ensure(trap, (VALUE)&arg, trap_ensure, (VALUE)&arg);#else    return trap(&arg);#endif}
开发者ID:217,项目名称:ruby,代码行数:64,


示例23: return

void *sbrk(intptr_t incr){        uintptr_t oldbrk;        /* If we don't have a saved break, find it from the kernel */        if (!__curbrk) {                if (0 > (long)(__curbrk = (void *) trap(SYS_brk, (uint32_t) NULL))) {                        return (void *) -1;                }        }        oldbrk = (uintptr_t) __curbrk;        /* Increment or decrement the saved break */        if (incr < 0) {                if ((uintptr_t) - incr > oldbrk) {                        return (void *) -1;                } else if (brk((void *)(oldbrk - (uintptr_t) - incr)) < 0) {                        return (void *) -1;                }        } else if (incr > 0) {                if (brk((void *)(oldbrk + (uintptr_t) incr)) < 0) {                        return (void *) -1;                }        }        return (void *) oldbrk;}
开发者ID:AnupreetKJohar,项目名称:weenix,代码行数:28,


示例24: trap

void Assembler::movsd(XMMRegister src, Indirect dest) {    int rex = 0;    int src_idx = src.regnum;    int dest_idx = dest.base.regnum;    if (src_idx >= 8) {        rex |= REX_R;        src_idx -= 8;    }    if (dest_idx >= 8) {        trap();        rex |= REX_B;        dest_idx -= 8;    }    emitByte(0xf2);    if (rex)        emitRex(rex);    emitByte(0x0f);    emitByte(0x11);    bool needssib = (dest_idx == 0b100);    int mode = getModeFromOffset(dest.offset);    emitModRM(mode, src_idx, dest_idx);    if (needssib)        emitSIB(0b00, 0b100, dest_idx);    if (mode == 0b01) {        emitByte(dest.offset);    } else if (mode == 0b10) {        emitInt(dest.offset, 4);    }}
开发者ID:jmgc,项目名称:pyston,代码行数:34,


示例25: chdir

int chdir(const char *path){        argstr_t args;        args.as_len = strlen(path);        args.as_str = path;        return trap(SYS_chdir, (uint32_t) &args);}
开发者ID:AnupreetKJohar,项目名称:weenix,代码行数:7,


示例26: trap_tss

voidtrap_tss(struct i386tss *tss, int trapno, int code){	struct trapframe tf;	tf.tf_gs = tss->tss_gs;	tf.tf_fs = tss->tss_fs;	tf.tf_es = tss->__tss_es;	tf.tf_ds = tss->__tss_ds;	tf.tf_edi = tss->__tss_edi;	tf.tf_esi = tss->__tss_esi;	tf.tf_ebp = tss->tss_ebp;	tf.tf_ebx = tss->__tss_ebx;	tf.tf_edx = tss->__tss_edx;	tf.tf_ecx = tss->__tss_ecx;	tf.tf_eax = tss->__tss_eax;	tf.tf_trapno = trapno;	tf.tf_err = code | TC_TSS;	tf.tf_eip = tss->__tss_eip;	tf.tf_cs = tss->__tss_cs;	tf.tf_eflags = tss->__tss_eflags;	tf.tf_esp = tss->tss_esp;	tf.tf_ss = tss->__tss_ss;	trap(&tf);}
开发者ID:goroutines,项目名称:rumprun,代码行数:25,


示例27: main

/// serial mainint main() {  int n;  float h, a, b, t, total;  LOCK;  proc_id++;  UNLOCK;  LOCK;  if (proc_id == 1){  printf("Digite o numero de subintervalos:/n");  /// interval count  scanf("%d", &n);  printf("Digite o inicio e o final do intervalo:/n");  /// interval start  scanf("%f", &a);  /// interval end  scanf("%f", &b);    /// interval size  h=(b-a)/n;  total = trap(a,b,n,h);    printf("A estimativa foi: %.15e/n",total);  }  proc_id++;    return 0;}
开发者ID:slackhideo,项目名称:mc723p3,代码行数:31,


示例28: main

voidmain(void){  trap();  for (;;)    ;}
开发者ID:lronaldo,项目名称:cpctelera,代码行数:7,


示例29: while

void *galloc(long size) {    void *ret;    while (( ret = malloc(size))==NULL )	trap();    memset(ret,0x3c,size);		/* fill with random junk for debugging */return( ret );}
开发者ID:luigiScarso,项目名称:luatexjit,代码行数:7,



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


C++ trap_AAS_Time函数代码示例
C++ transpose函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。