rem
stringlengths
0
83.5k
add
stringlengths
0
223k
context
stringlengths
10
471k
meta
stringlengths
120
236
GEN V=cgetg(l+2,t_VEC); long i; long v=T[1]; V[1] = (long) Fl_to_Flx(1, v); if (l==0) return V; V[2] = (long) vecsmall_copy(x); if (l==1) return V; V[3] = (long) Flxq_sqr(x,T,p); for(i=4;i<l+2;i++) V[i] = (long) Flxq_mul((GEN) V[i-1],x,T,p); #if 0 TODO: Karim proposes to use squaring: V[i] = (long) ((i&1)?Flxq_sqr((GEN) V[(i+1)>>1],T,p) :Flxq_mul((GEN) V[i-1],x,T,p)); Please profile it. #endif
GEN V = cgetg(l+2,t_VEC); long i, v = T[1]; gel(V,1) = Fl_to_Flx(1, v); if (l==0) return V; gel(V,2) = vecsmall_copy(x); if (l==1) return V; gel(V,3) = Flxq_sqr(x,T,p); if ((degpol(x)<<1) < degpol(T)) { for(i = 4; i < l+2; i++) gel(V,i) = Flxq_mul(gel(V,i-1),x,T,p); } else { for(i = 4; i < l+2; i++) { gel(V,i) = (i&1)? Flxq_sqr(gel(V, (i+1)>>1),T,p) : Flxq_mul(gel(V, i-1),x,T,p); } }
Flxq_powers(GEN x, long l, GEN T, ulong p){ GEN V=cgetg(l+2,t_VEC); long i; long v=T[1]; V[1] = (long) Fl_to_Flx(1, v); if (l==0) return V; V[2] = (long) vecsmall_copy(x); if (l==1) return V; V[3] = (long) Flxq_sqr(x,T,p); for(i=4;i<l+2;i++) V[i] = (long) Flxq_mul((GEN) V[i-1],x,T,p);#if 0 TODO: Karim proposes to use squaring: V[i] = (long) ((i&1)?Flxq_sqr((GEN) V[(i+1)>>1],T,p) :Flxq_mul((GEN) V[i-1],x,T,p)); Please profile it.#endif return V;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/0653bf4e80ffba66b9dad8b9b9bf38de88f14841/Flx.c/buggy/src/basemath/Flx.c
if ((opt->flags & OPT_INITONLY) && phase != PHASE_INITIALIZE) {
if ((opt->flags & OPT_INITONLY) && pppd_phase != PHASE_INITIALIZE) {
process_option(opt, argv) option_t *opt; char **argv;{ u_int32_t v; int iv, a; char *sv; int (*parser) __P((char **)); if ((opt->flags & OPT_PREPASS) == 0 && prepass) return 1; if ((opt->flags & OPT_INITONLY) && phase != PHASE_INITIALIZE) { option_error("it's too late to use the %s option", opt->name); return 0; } if ((opt->flags & OPT_PRIV) && !privileged_option) { option_error("using the %s option requires root privilege", opt->name); return 0; } if ((opt->flags & OPT_ENABLE) && *(bool *)(opt->addr2) == 0) { option_error("%s option is disabled", opt->name); return 0; } if ((opt->flags & OPT_PRIVFIX) && !privileged_option) { struct option_info *ip = (struct option_info *) opt->addr2; if (ip && ip->priv) { option_error("%s option cannot be overridden", opt->name); return 0; } } switch (opt->type) { case o_bool: v = opt->flags & OPT_VALUE; *(bool *)(opt->addr) = v; if (opt->addr2 && (opt->flags & OPT_A2COPY)) *(bool *)(opt->addr2) = v; break; case o_int: iv = 0; if ((opt->flags & OPT_NOARG) == 0) { if (!int_option(*argv, &iv)) return 0; if ((((opt->flags & OPT_LLIMIT) && iv < opt->lower_limit) || ((opt->flags & OPT_ULIMIT) && iv > opt->upper_limit)) && !((opt->flags & OPT_ZEROOK && iv == 0))) { char *zok = (opt->flags & OPT_ZEROOK)? " zero or": ""; switch (opt->flags & OPT_LIMITS) { case OPT_LLIMIT: option_error("%s value must be%s >= %d", opt->name, zok, opt->lower_limit); break; case OPT_ULIMIT: option_error("%s value must be%s <= %d", opt->name, zok, opt->upper_limit); break; case OPT_LIMITS: option_error("%s value must be%s between %d and %d", opt->name, opt->lower_limit, opt->upper_limit); break; } return 0; } } a = opt->flags & OPT_VALUE; if (a >= 128) a -= 256; /* sign extend */ iv += a; if (opt->flags & OPT_INC) iv += *(int *)(opt->addr); if ((opt->flags & OPT_NOINCR) && !privileged_option) { int oldv = *(int *)(opt->addr); if ((opt->flags & OPT_ZEROINF) ? (oldv != 0 && (iv == 0 || iv > oldv)) : (iv > oldv)) { option_error("%s value cannot be increased", opt->name); return 0; } } *(int *)(opt->addr) = iv; if (opt->addr2 && (opt->flags & OPT_A2COPY)) *(int *)(opt->addr2) = iv; break; case o_uint32: if (opt->flags & OPT_NOARG) { v = opt->flags & OPT_VALUE; } else if (!number_option(*argv, &v, 16)) return 0; if (opt->flags & OPT_OR) v |= *(u_int32_t *)(opt->addr); *(u_int32_t *)(opt->addr) = v; if (opt->addr2 && (opt->flags & OPT_A2COPY)) *(u_int32_t *)(opt->addr2) = v; break; case o_string: if (opt->flags & OPT_STATIC) { strlcpy((char *)(opt->addr), *argv, opt->upper_limit); } else { sv = strdup(*argv); if (sv == NULL) novm("option argument"); if ( *(char **)(opt->addr) != NULL ) { free((void *)*(char **)(opt->addr)); *(char **)(opt->addr) = NULL; } *(char **)(opt->addr) = sv; } break; case o_special_noarg: case o_special: parser = (int (*) __P((char **))) opt->addr; if (!(*parser)(argv)) return 0; break; } if (opt->addr2) { if (opt->flags & OPT_A2INFO) { struct option_info *ip = (struct option_info *) opt->addr2; ip->priv = privileged_option; ip->source = option_source; } else if ((opt->flags & (OPT_A2COPY|OPT_ENABLE)) == 0) *(bool *)(opt->addr2) = 1; } return 1;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/48cdb95aa2444a386a911be1a8251483d79a9935/options.c/clean/cpukit/pppd/options.c
_factorback(GEN fa, GEN e, GEN (*_mul)(GEN,GEN), GEN (*_pow)(GEN,GEN))
_factorback(GEN fa, GEN e, GEN (*_mul)(void*,GEN,GEN), GEN (*_pow)(void*,GEN,GEN), void *data)
_factorback(GEN fa, GEN e, GEN (*_mul)(GEN,GEN), GEN (*_pow)(GEN,GEN)){ pari_sp av = avma; long k,l,lx,t = typ(fa); GEN p,x; if (e) /* supplied vector of exponents */ p = fa; else /* genuine factorization */ { if (t == t_MAT) { l = lg(fa); if (l == 1) return gen_1; if (l != 3) err(talker,"not a factorisation in factorback"); } else { if (!is_vec_t(t)) err(talker,"not a factorisation in factorback"); return gerepileupto(av, divide_conquer_prod(fa, _mul)); } p = gel(fa,1); e = gel(fa,2); } lx = lg(p); t = t_INT; /* dummy */ /* check whether e is an integral vector of correct length */ if (is_vec_t(typ(e)) && lx == lg(e)) { for (k=1; k<lx; k++) if (typ(e[k]) != t_INT) break; if (k == lx) t = t_MAT; } if (t != t_MAT) err(talker,"not a factorisation in factorback"); if (lx == 1) return gen_1; x = cgetg(lx,t_VEC); for (l=1,k=1; k<lx; k++) if (signe(e[k])) gel(x,l++) = _pow(gel(p,k),gel(e,k)); setlg(x,l); return gerepileupto(av, divide_conquer_prod(x, _mul));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d5847452a0a61f4b94c584ee5aed865e7709a077/polarit2.c/clean/src/basemath/polarit2.c
return gerepileupto(av, divide_conquer_prod(fa, _mul));
return gerepileupto(av, divide_conquer_assoc(fa, _mul,data));
_factorback(GEN fa, GEN e, GEN (*_mul)(GEN,GEN), GEN (*_pow)(GEN,GEN)){ pari_sp av = avma; long k,l,lx,t = typ(fa); GEN p,x; if (e) /* supplied vector of exponents */ p = fa; else /* genuine factorization */ { if (t == t_MAT) { l = lg(fa); if (l == 1) return gen_1; if (l != 3) err(talker,"not a factorisation in factorback"); } else { if (!is_vec_t(t)) err(talker,"not a factorisation in factorback"); return gerepileupto(av, divide_conquer_prod(fa, _mul)); } p = gel(fa,1); e = gel(fa,2); } lx = lg(p); t = t_INT; /* dummy */ /* check whether e is an integral vector of correct length */ if (is_vec_t(typ(e)) && lx == lg(e)) { for (k=1; k<lx; k++) if (typ(e[k]) != t_INT) break; if (k == lx) t = t_MAT; } if (t != t_MAT) err(talker,"not a factorisation in factorback"); if (lx == 1) return gen_1; x = cgetg(lx,t_VEC); for (l=1,k=1; k<lx; k++) if (signe(e[k])) gel(x,l++) = _pow(gel(p,k),gel(e,k)); setlg(x,l); return gerepileupto(av, divide_conquer_prod(x, _mul));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d5847452a0a61f4b94c584ee5aed865e7709a077/polarit2.c/clean/src/basemath/polarit2.c
gel(x,l++) = _pow(gel(p,k),gel(e,k));
gel(x,l++) = _pow(data,gel(p,k),gel(e,k));
_factorback(GEN fa, GEN e, GEN (*_mul)(GEN,GEN), GEN (*_pow)(GEN,GEN)){ pari_sp av = avma; long k,l,lx,t = typ(fa); GEN p,x; if (e) /* supplied vector of exponents */ p = fa; else /* genuine factorization */ { if (t == t_MAT) { l = lg(fa); if (l == 1) return gen_1; if (l != 3) err(talker,"not a factorisation in factorback"); } else { if (!is_vec_t(t)) err(talker,"not a factorisation in factorback"); return gerepileupto(av, divide_conquer_prod(fa, _mul)); } p = gel(fa,1); e = gel(fa,2); } lx = lg(p); t = t_INT; /* dummy */ /* check whether e is an integral vector of correct length */ if (is_vec_t(typ(e)) && lx == lg(e)) { for (k=1; k<lx; k++) if (typ(e[k]) != t_INT) break; if (k == lx) t = t_MAT; } if (t != t_MAT) err(talker,"not a factorisation in factorback"); if (lx == 1) return gen_1; x = cgetg(lx,t_VEC); for (l=1,k=1; k<lx; k++) if (signe(e[k])) gel(x,l++) = _pow(gel(p,k),gel(e,k)); setlg(x,l); return gerepileupto(av, divide_conquer_prod(x, _mul));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d5847452a0a61f4b94c584ee5aed865e7709a077/polarit2.c/clean/src/basemath/polarit2.c
return gerepileupto(av, divide_conquer_prod(x, _mul));
return gerepileupto(av, divide_conquer_assoc(x, _mul,data));
_factorback(GEN fa, GEN e, GEN (*_mul)(GEN,GEN), GEN (*_pow)(GEN,GEN)){ pari_sp av = avma; long k,l,lx,t = typ(fa); GEN p,x; if (e) /* supplied vector of exponents */ p = fa; else /* genuine factorization */ { if (t == t_MAT) { l = lg(fa); if (l == 1) return gen_1; if (l != 3) err(talker,"not a factorisation in factorback"); } else { if (!is_vec_t(t)) err(talker,"not a factorisation in factorback"); return gerepileupto(av, divide_conquer_prod(fa, _mul)); } p = gel(fa,1); e = gel(fa,2); } lx = lg(p); t = t_INT; /* dummy */ /* check whether e is an integral vector of correct length */ if (is_vec_t(typ(e)) && lx == lg(e)) { for (k=1; k<lx; k++) if (typ(e[k]) != t_INT) break; if (k == lx) t = t_MAT; } if (t != t_MAT) err(talker,"not a factorisation in factorback"); if (lx == 1) return gen_1; x = cgetg(lx,t_VEC); for (l=1,k=1; k<lx; k++) if (signe(e[k])) gel(x,l++) = _pow(gel(p,k),gel(e,k)); setlg(x,l); return gerepileupto(av, divide_conquer_prod(x, _mul));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d5847452a0a61f4b94c584ee5aed865e7709a077/polarit2.c/clean/src/basemath/polarit2.c
buchgenforcefu(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2,long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,nf_UNITS|nf_FORCE,prec); }
buchgenforcefu(B_ARGS) { return B_CALL(nf_UNITS|nf_FORCE); }
buchgenforcefu(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2,long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,nf_UNITS|nf_FORCE,prec);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/4fedb725a485039bb8dc1210c2d85733501b6a04/compat.c/clean/src/language/compat.c
buchgen(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2, long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,0,prec); }
buchgen(B_ARGS) { return B_CALL(0); }
buchgen(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2, long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,0,prec);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/4fedb725a485039bb8dc1210c2d85733501b6a04/compat.c/clean/src/language/compat.c
buchinitforcefu(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2,long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,nf_INIT|nf_UNITS|nf_FORCE,prec); }
buchinitforcefu(B_ARGS) { return B_CALL(nf_INIT|nf_UNITS|nf_FORCE); }
buchinitforcefu(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2,long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,nf_INIT|nf_UNITS|nf_FORCE,prec);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/4fedb725a485039bb8dc1210c2d85733501b6a04/compat.c/clean/src/language/compat.c
buchinit(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2,long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,nf_INIT,prec); }
buchinit(B_ARGS) { return B_CALL(nf_INIT); }
buchinit(GEN g1,GEN g2,GEN g3,GEN g4, GEN g5,long l1,long l2,long prec) { return buchall(g1,gtodouble(g2),gtodouble(g3),l1,nf_INIT,prec);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/4fedb725a485039bb8dc1210c2d85733501b6a04/compat.c/clean/src/language/compat.c
mapOverAll(0,disableUniversePort,0);
DFLT_BASE; mapOverAll(base,0,disableUniversePort,0);
vmeUniverseDisableAllSlaves(void){ mapOverAll(0,disableUniversePort,0);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
return cfgUniversePort(1,port,address_space,vme_address,local_address,length);
DFLT_BASE; return cfgUniversePort(base,1,port,address_space,vme_address,local_address,length);
vmeUniverseMasterPortCfg( unsigned long port, unsigned long address_space, unsigned long vme_address, unsigned long local_address, unsigned long length){ return cfgUniversePort(1,port,address_space,vme_address,local_address,length);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
return cfgUniversePort(0,port,address_space,vme_address,local_address,length);
DFLT_BASE; return cfgUniversePort(base,0,port,address_space,vme_address,local_address,length);
vmeUniverseSlavePortCfg( unsigned long port, unsigned long address_space, unsigned long vme_address, unsigned long local_address, unsigned long length){ return cfgUniversePort(0,port,address_space,vme_address,local_address,length);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
if ((rval=vmeUniverseFindPciBase(0,&vmeUniverse0BaseAddr))) {
if ( (rval=vmeUniverseFindPciBase(0,&vmeUniverse0BaseAddr)) < 0 ) {
vmeUniverseInit(void){int rval; if ((rval=vmeUniverseFindPciBase(0,&vmeUniverse0BaseAddr))) { uprintf(stderr,"unable to find the universe in pci config space\n"); } else { uprintf(stderr,"Universe II PCI-VME bridge detected at 0x%08x, IRQ %d\n", (unsigned int)vmeUniverse0BaseAddr, vmeUniverse0PciIrqLine); } return rval;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
vmeUniverse0PciIrqLine = rval; rval = 0;
vmeUniverseInit(void){int rval; if ((rval=vmeUniverseFindPciBase(0,&vmeUniverse0BaseAddr))) { uprintf(stderr,"unable to find the universe in pci config space\n"); } else { uprintf(stderr,"Universe II PCI-VME bridge detected at 0x%08x, IRQ %d\n", (unsigned int)vmeUniverse0BaseAddr, vmeUniverse0PciIrqLine); } return rval;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
vmeUniverseReset(void){ /* disable/reset special cycles (ADOH, RMW) */ vmeUniverseWriteReg(0, UNIV_REGOFF_SCYC_CTL); vmeUniverseWriteReg(0, UNIV_REGOFF_SCYC_ADDR); vmeUniverseWriteReg(0, UNIV_REGOFF_SCYC_EN); /* set coupled window timeout to 0 (release VME after each transaction) * CRT (coupled request timeout) is unused by Universe II */ vmeUniverseWriteReg(UNIV_LMISC_CRT_128_US, UNIV_REGOFF_LMISC); /* disable/reset DMA engine */ vmeUniverseWriteReg(0, UNIV_REGOFF_DCTL); vmeUniverseWriteReg(0, UNIV_REGOFF_DTBC); vmeUniverseWriteReg(0, UNIV_REGOFF_DLA); vmeUniverseWriteReg(0, UNIV_REGOFF_DVA); vmeUniverseWriteReg(0, UNIV_REGOFF_DCPP); /* disable location monitor */ vmeUniverseWriteReg(0, UNIV_REGOFF_LM_CTL); /* disable universe register access from VME bus */ vmeUniverseWriteReg(0, UNIV_REGOFF_VRAI_CTL); /* disable VME bus image of VME CSR */ vmeUniverseWriteReg(0, UNIV_REGOFF_VCSR_CTL); /* I had problems with a Joerger vtr10012_8 card who would * only be accessible after tweaking the U2SPEC register * (the t27 parameter helped). * I use the same settings here that are used by the * Synergy VGM-powerpc BSP for vxWorks. */ if (2==UNIV_REV(vmeUniverse0BaseAddr)) vmeUniverseWriteReg(UNIV_U2SPEC_DTKFLTR | UNIV_U2SPEC_MASt11 | UNIV_U2SPEC_READt27_NODELAY | UNIV_U2SPEC_POSt28_FAST | UNIV_U2SPEC_PREt28_FAST, UNIV_REGOFF_U2SPEC); /* disable interrupts, reset routing */ vmeUniverseWriteReg(0, UNIV_REGOFF_LINT_EN); vmeUniverseWriteReg(0, UNIV_REGOFF_LINT_MAP0); vmeUniverseWriteReg(0, UNIV_REGOFF_LINT_MAP1); vmeUniverseWriteReg(0, UNIV_REGOFF_VINT_EN); vmeUniverseWriteReg(0, UNIV_REGOFF_VINT_MAP0); vmeUniverseWriteReg(0, UNIV_REGOFF_VINT_MAP1); vmeUniverseDisableAllSlaves(); vmeUniverseDisableAllMasters(); vmeUniverseWriteReg(UNIV_VCSR_CLR_SYSFAIL, UNIV_REGOFF_VCSR_CLR); /* clear interrupt status bits */ vmeUniverseWriteReg(UNIV_LINT_STAT_CLR, UNIV_REGOFF_LINT_STAT); vmeUniverseWriteReg(UNIV_VINT_STAT_CLR, UNIV_REGOFF_VINT_STAT); vmeUniverseWriteReg(UNIV_V_AMERR_V_STAT, UNIV_REGOFF_V_AMERR); vmeUniverseWriteReg( vmeUniverseReadReg(UNIV_REGOFF_PCI_CSR) | UNIV_PCI_CSR_D_PE | UNIV_PCI_CSR_S_SERR | UNIV_PCI_CSR_R_MA | UNIV_PCI_CSR_R_TA | UNIV_PCI_CSR_S_TA, UNIV_REGOFF_PCI_CSR); vmeUniverseWriteReg(UNIV_L_CMDERR_L_STAT, UNIV_REGOFF_L_CMDERR); vmeUniverseWriteReg( UNIV_DGCS_STOP | UNIV_DGCS_HALT | UNIV_DGCS_DONE | UNIV_DGCS_LERR | UNIV_DGCS_VERR | UNIV_DGCS_P_ERR, UNIV_REGOFF_DGCS);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
mapOverAll(1,disableUniversePort,0);
DFLT_BASE; mapOverAll(base,1,disableUniversePort,0);
vmeUniverseDisableAllMasters(void){ mapOverAll(1,disableUniversePort,0);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
showUniversePorts(0,f);
DFLT_BASE; showUniversePorts(base,0,f);
vmeUniverseSlavePortsShow(FILE *f){ showUniversePorts(0,f);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
showUniversePorts(1,f);
DFLT_BASE; showUniversePorts(base,1,f);
vmeUniverseMasterPortsShow(FILE *f){ showUniversePorts(1,f);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/784e792a04c600b79d535ad81a5ba32b4f4de33e/vmeUniverse.c/clean/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
if (x && isclone(x)) x = forcecopy(x); ep->value = (flag == COPY_VAL)? gclone(x): x;
ep->value = (flag == COPY_VAL)? gclone(x): (x && isclone(x))? forcecopy(x): x;
new_val_cell(entree *ep, GEN x, char flag){ var_cell *v = (var_cell*) gpmalloc(sizeof(var_cell)); v->value = (GEN)ep->value; v->prev = (var_cell*) ep->args; v->flag = flag; /* beware: f(p) = Nv = 0 * Nv = p; f(Nv) --> this call would destroy p [ isclone ] */ if (x && isclone(x)) x = forcecopy(x); ep->value = (flag == COPY_VAL)? gclone(x): x; /* Do this last. In case the clone is <C-C>'ed before completion ! */ ep->args = (void*) v;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d6bc6f7c8515f98a50f281cca0bb8c335aed5b17/anal.c/clean/src/language/anal.c
ep->args = (void*) v;
ep->args = (void*)v;
new_val_cell(entree *ep, GEN x, char flag){ var_cell *v = (var_cell*) gpmalloc(sizeof(var_cell)); v->value = (GEN)ep->value; v->prev = (var_cell*) ep->args; v->flag = flag; /* beware: f(p) = Nv = 0 * Nv = p; f(Nv) --> this call would destroy p [ isclone ] */ if (x && isclone(x)) x = forcecopy(x); ep->value = (flag == COPY_VAL)? gclone(x): x; /* Do this last. In case the clone is <C-C>'ed before completion ! */ ep->args = (void*) v;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d6bc6f7c8515f98a50f281cca0bb8c335aed5b17/anal.c/clean/src/language/anal.c
init_graph()
init_graph(void)
init_graph(){ int n; rectgraph = (PariRect**) gpmalloc(sizeof(PariRect*)*NUMRECT); for (n=0; n<NUMRECT; n++) { PariRect *e = (PariRect*) gpmalloc(sizeof(PariRect)); e->head = e->tail = NULL; e->sizex = e->sizey = 0; current_color[n] = DEFAULT_COLOR; rectgraph[n] = e; }}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6f0450eaf26bb1653fbb257487c2cbc116d69406/plotport.c/clean/src/graph/plotport.c
kill_link = 1;
pppd_kill_link = 1;
static void timeout_terminate(void *arg){ /* set pppd global variables to disconnect */ persist = 0; kill_link = 1;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/48cdb95aa2444a386a911be1a8251483d79a9935/rtemspppd.c/buggy/c/src/libnetworking/pppd/rtemspppd.c
P[i]=cmpii((GEN)T[i],mod2)<0?licopy((GEN)T[i]):lsubii((GEN)T[i],mod);
P[i]=cmpii((GEN)T[i],mod2)<=0?licopy((GEN)T[i]):lsubii((GEN)T[i],mod);
FpX_center(GEN T,GEN mod){/*OK centermod exists, but is not so clean*/ pari_sp av; long i, l=lg(T); GEN P,mod2; P=cgetg(l,t_POL); P[1]=T[1]; av=avma; mod2=gclone(shifti(mod,-1));/*clone*/ avma=av; for(i=2;i<l;i++) P[i]=cmpii((GEN)T[i],mod2)<0?licopy((GEN)T[i]):lsubii((GEN)T[i],mod); gunclone(mod2);/*unclone*/ return P;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6839d65ca40cc7f2612af001abf6bc83b8dda8c5/polarit3.c/clean/src/basemath/polarit3.c
return gerepileupto(ltop,gcopy(res));
return gerepilecopy(ltop,res);
Fp_factor_irred(GEN P,GEN l, GEN Q){ ulong ltop=avma,av; GEN SP,SQ,MP,MQ,M,MF,E,V,IR,res; long np=degpol(P),nq=degpol(Q); long i,d=cgcd(np,nq); long vp=varn(P),vq=varn(Q); if (d==1) { res=cgetg(2,t_COL); res[1]=lcopy(P); return res; } MF=matrixpow(nq,nq,FpXQ_pow(polx[vq],l,Q,l),Q,l); Fp_intersect(d,P,Q,l,&SP,&SQ,NULL,MF); av=avma; E=Fp_factorgalois(P,l,d,vq); E=polpol_to_mat(E,np); MP = matrixpow(np,d,SP,P,l); IR = (GEN)FpM_sindexrank(MP,l)[1]; E = rowextract_p(E, IR); M = rowextract_p(MP,IR); M = FpM_inv(M,l); MQ = matrixpow(nq,d,SQ,Q,l); M = FpM_mul(MQ,M,l); M = FpM_mul(M,E,l); M = gerepileupto(av,M); V = cgetg(d+1,t_VEC); V[1]=(long)M; for(i=2;i<=d;i++) V[i]=(long)FpM_mul(MF,(GEN)V[i-1],l); res=cgetg(d+1,t_COL); for(i=1;i<=d;i++) res[i]=(long)mat_to_polpol((GEN)V[i],vp,vq); return gerepileupto(ltop,gcopy(res));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/polarit3.c/buggy/src/basemath/polarit3.c
m = *++p1, j = BITS_IN_LONG;
m = *++p1; j = BITS_IN_LONG;
u_FpXQ_pow(GEN x, GEN n, GEN pol, ulong p){ ulong av = avma; GEN p1 = n+2, y = x; long m,i,j; m = *p1; j = 1+bfffo(m); m <<= j; j = BITS_IN_LONG-j; for (i=lgefint(n)-2;;) { for (; j; m<<=1,j--) { y = u_FpXQ_sqr(y,pol,p); if (m<0) y = u_FpXQ_mul(y,x,pol,p); } if (--i == 0) break; m = *++p1, j = BITS_IN_LONG; } return gerepileupto(av, y);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/67e0913cc6b0011171acdacbe36f8ae12cdf3367/polarit3.c/clean/src/basemath/polarit3.c
y=x; j=1+bfffo(m); m<<=j; j = BITS_IN_LONG-j;
y=x; j=1+bfffo((ulong)m); m<<=j; j = BITS_IN_LONG-j;
powgi(GEN x, GEN n){ long i,j,m,tx, sn=signe(n); ulong lim,av; GEN y, p1; if (typ(n) != t_INT) err(talker,"not an integral exponent in powgi"); if (!sn) return puiss0(x); switch(tx=typ(x)) {/* catch some types here, instead of trying gpowgs() first, because of * the simpler call interface to puissii() and powmodulo() -- even though * for integer/rational bases other than 0,+-1 and non-wordsized * exponents the result will be certain to overflow. --GN */ case t_INT: { long sx=signe(x), sr = (sx<0 && mod2(n))? -1: 1; if (sn>0) return puissii(x,n,sr); if (!sx) err(talker, "division by zero in powgi"); if (is_pm1(x)) return (sr < 0)? icopy(x): gun; /* n<0, |x|>1 */ y=cgetg(3,t_FRAC); setsigne(n,1); /* temporarily replace n by abs(n) */ y[1]=(sr>0)? un: lnegi(gun); y[2]=(long)puissii(x,n,1); setsigne(n,-1); return y; } case t_INTMOD: y=cgetg(3,tx); copyifstack(x[1],y[1]); y[2]=(long)powmodulo((GEN)x[2],n,(GEN)x[1]); return y; case t_FRAC: case t_FRACN: { GEN a = (GEN)x[1], b = (GEN)x[2]; long sr = (mod2(n) && (signe(a)!=signe(b))) ? -1 : 1; if (sn > 0) { if (!signe(a)) return gzero; } else { /* n < 0 */ if (!signe(a)) err(talker, "division by zero fraction in powgi"); /* +-1/b inverts to an integer */ if (is_pm1(a)) return puissii(b,n,sr); y = b; b = a; a = y; } /* HACK: puissii disregards the sign of n */ y = cgetg(3,tx); y[1] = (long)puissii(a,n,sr); y[2] = (long)puissii(b,n,1); return y; } case t_PADIC: { long e = itos(n)*valp(x); GEN mod, p = (GEN)x[2]; if (!signe(x[4])) { if (sn < 0) err(talker, "division by 0 p-adic in powgi"); return padiczero(p, e); } y = cgetg(5,t_PADIC); mod = (GEN)x[3]; i = ggval(n, p); if (i == 0) mod = icopy(mod); else { mod = mulii(mod, gpowgs(p,i)); mod = gerepileuptoint((long)y, mod); } y[1] = evalprecp(precp(x)+i) | evalvalp(e); icopyifstack(p, y[2]); y[3] = (long)mod; y[4] = (long)powmodulo((GEN)x[4], n, mod); return y; } case t_QFR: if (signe(x[4])) return powrealform(x,n); case t_POL: if (ismonome(x)) return pow_monome(x,n); default: av=avma; lim=stack_lim(av,1); p1 = n+2; m = *p1; y=x; j=1+bfffo(m); m<<=j; j = BITS_IN_LONG-j; for (i=lgefint(n)-2;;) { for (; j; m<<=1,j--) { y=gsqr(y); if (low_stack(lim, stack_lim(av,1))) { if(DEBUGMEM>1) err(warnmem,"[1]: powgi"); y = gerepileupto(av, y); } if (m<0) y=gmul(y,x); if (low_stack(lim, stack_lim(av,1))) { if(DEBUGMEM>1) err(warnmem,"[2]: powgi"); y = gerepileupto(av, y); } } if (--i == 0) break; m = *++p1; j = BITS_IN_LONG; } if (sn < 0) y = ginv(y); return av==avma? gcopy(y): gerepileupto(av,y); }}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6f0450eaf26bb1653fbb257487c2cbc116d69406/trans1.c/buggy/src/basemath/trans1.c
_u_Fp_addmul_OK(GEN b, long k, long i, ulong m, ulong p)
_u_Fp_addmul_OK(ulong *b, long k, long i, ulong m, ulong p)
_u_Fp_addmul_OK(GEN b, long k, long i, ulong m, ulong p){ b[k] += m * b[i]; if (b[k] & MASK) b[k] %= p;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/0413a80bd91a41fc053e0149a3c6bf7d1e6f290c/alglin1.c/buggy/src/basemath/alglin1.c
else return gerepile(av0,tetpil,FlxX_ZXX(z));
else return gerepile(av0,tetpil,z);
FpXQX_divrem(GEN x, GEN y, GEN T, GEN p, GEN *pr){ long vx, dx, dy, dz, i, j, sx, lrem; pari_sp av0, av, tetpil; GEN z,p1,rem,lead; if (!p) return poldivrem(x,y,pr); if (!T) return FpX_divrem(x,y,p,pr); if (!signe(y)) err(gdiver); vx=varn(x); dy=degpol(y); dx=degpol(x); if (dx < dy) { if (pr) { av0 = avma; x = FpXQX_red(x, T, p); if (pr == ONLY_DIVIDES) { avma=av0; return signe(x)? NULL: zeropol(vx); } if (pr == ONLY_REM) return x; *pr = x; } return zeropol(vx); } lead = leading_term(y); if (!dy) /* y is constant */ { if (pr && pr != ONLY_DIVIDES) { if (pr == ONLY_REM) return zeropol(vx); *pr = zeropol(vx); } av0 = avma; x = FpXQX_normalize(x, T,p); tetpil = avma; return gerepile(av0,tetpil,FpXQX_red(x,T,p)); } av0 = avma; dz = dx-dy; if (OK_ULONG(p)) { /* assume ab != 0 mod p */ { GEN *gptr[2]; ulong pp = (ulong)p[2]; long v = varn(T); GEN a = ZXX_FlxX(x, pp, v); GEN b = ZXX_FlxX(y, pp, v); GEN t = ZX_Flx(T, pp); z = FlxqX_divrem(a,b,t,pp,pr); tetpil=avma; if (pr && pr != ONLY_DIVIDES && pr != ONLY_REM) *pr = FlxX_ZXX(*pr); else return gerepile(av0,tetpil,FlxX_ZXX(z)); gptr[0]=pr; gptr[1]=&z; gerepilemanysp(av0,tetpil,gptr,2); return z; } } lead = gcmp1(lead)? NULL: gclone(Fq_inv(lead,T,p)); avma = av0; z = cgetg(dz+3,t_POL); z[1] = x[1]; x += 2; y += 2; z += 2; p1 = (GEN)x[dx]; av = avma; z[dz] = lead? lpileupto(av, Fq_mul(p1,lead, T, p)): lcopy(p1); for (i=dx-1; i>=dy; i--) { av=avma; p1=(GEN)x[i]; for (j=i-dy+1; j<=i && j<=dz; j++) p1 = Fq_sub(p1, Fq_mul((GEN)z[j],(GEN)y[i-j],NULL,p),NULL,p); if (lead) p1 = Fq_mul(p1, lead, NULL,p); tetpil=avma; z[i-dy] = lpile(av,tetpil,Fq_red(p1,T,p)); } if (!pr) { if (lead) gunclone(lead); return z-2; } rem = (GEN)avma; av = (pari_sp)new_chunk(dx+3); for (sx=0; ; i--) { p1 = (GEN)x[i]; for (j=0; j<=i && j<=dz; j++) p1 = Fq_sub(p1, Fq_mul((GEN)z[j],(GEN)y[i-j],NULL,p),NULL,p); tetpil=avma; p1 = Fq_red(p1, T, p); if (signe(p1)) { sx = 1; break; } if (!i) break; avma=av; } if (pr == ONLY_DIVIDES) { if (lead) gunclone(lead); if (sx) { avma=av0; return NULL; } avma = (pari_sp)rem; return z-2; } lrem=i+3; rem -= lrem; rem[0] = evaltyp(t_POL) | evallg(lrem); rem[1] = z[-1]; p1 = gerepile((pari_sp)rem,tetpil,p1); rem += 2; rem[i]=(long)p1; for (i--; i>=0; i--) { av=avma; p1 = (GEN)x[i]; for (j=0; j<=i && j<=dz; j++) p1 = Fq_sub(p1, Fq_mul((GEN)z[j],(GEN)y[i-j], NULL,p), NULL,p); tetpil=avma; rem[i]=lpile(av,tetpil, Fq_red(p1, T, p)); } rem -= 2; if (lead) gunclone(lead); if (!sx) (void)FpXQX_renormalize(rem, lrem); if (pr == ONLY_REM) return gerepileupto(av0,rem); *pr = rem; return z-2;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/531598acb4efbbf66658923c50d6254b07bc021f/polarit3.c/buggy/src/basemath/polarit3.c
GEN g = mppgcd(lead,p);
GEN g = gcdii(lead,p);
FpX_gcd_check(GEN x, GEN y, GEN p){ GEN a,b,c; pari_sp av=avma; a = FpX_red(x, p); b = FpX_red(y, p); while (signe(b)) { GEN lead = leading_term(b); GEN g = mppgcd(lead,p); if (!is_pm1(g)) return gerepileupto(av,g); c = FpX_rem(a,b,p); a=b; b=c; } avma = av; return gun;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/polarit3.c/buggy/src/basemath/polarit3.c
unsigned8 *buffer; unsigned32 maximum; unsigned32 count = 0;
uint8_t *buffer; uint32_t maximum; uint32_t count = 0;
rtems_device_driver console_read( rtems_device_major_number major, rtems_device_minor_number minor, void * arg){ rtems_libio_rw_args_t *rw_args; unsigned8 *buffer; unsigned32 maximum; unsigned32 count = 0; rw_args = (rtems_libio_rw_args_t *) arg; buffer = rw_args->buffer; maximum = rw_args->count; for (count = 0; count < maximum; count++) { buffer[ count ] = inbyte(minor); if (buffer[ count ] == '\n' || buffer[ count ] == '\r') { buffer[ count++ ] = '\n'; buffer[ count ] = 0; outbyte( minor, '\n' ); /* newline */ break; } else if (buffer[ count ] == '\b' && count > 0 ) { outbyte( minor, '\b' ); /* move back one space */ outbyte( minor, ' ' ); /* erase the character */ outbyte( minor, '\b' ); /* move back one space */ count-=2; } else outbyte( minor, buffer[ count ] ); /* echo the character */ } rw_args->bytes_moved = count; return (count > 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/1d5c9757d724075bf9f4592a400ac3edba38b8d0/console.c/clean/c/src/lib/libbsp/i960/rxgen960/console/console.c
long i, lx;
long i, j, lx, hx;
centermod_i(GEN x, GEN p, GEN ps2){ long i, lx; gpmem_t av; GEN y,p1; if (!ps2) ps2 = shifti(p,-1); switch(typ(x)) { case t_INT: y=modii(x,p); if (cmpii(y,ps2)>0) return subii(y,p); return y; case t_POL: lx=lgef(x); y=cgetg(lx,t_POL); y[1]=x[1]; for (i=2; i<lx; i++) { av=avma; p1=modii((GEN)x[i],p); if (cmpii(p1,ps2)>0) p1=subii(p1,p); y[i]=lpileupto(av,p1); } return normalizepol_i(y, lx); case t_COL: lx=lg(x); y=cgetg(lx,t_COL); for (i=1; i<lx; i++) { p1=modii((GEN)x[i],p); if (cmpii(p1,ps2)>0) p1=subii(p1,p); y[i]=(long)p1; } return y; } return x;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/eba2fe5ccc5aa3212798bdc178680c89662e2f98/polarit2.c/buggy/src/basemath/polarit2.c
case t_MAT: lx=lg(x); y=cgetg(lx,t_MAT); if (lx == 1) return y; hx = lg(x[1]); for (j=1; j<lx; j++) { GEN cx = (GEN)x[j], cy = cgetg(hx,t_COL); y[j] = (long)cy; for (i=1; i<hx; i++) { p1=modii((GEN)cx[i], p); if (cmpii(p1,ps2)>0) p1=subii(p1,p); cy[i]=(long)p1; } } return y;
centermod_i(GEN x, GEN p, GEN ps2){ long i, lx; gpmem_t av; GEN y,p1; if (!ps2) ps2 = shifti(p,-1); switch(typ(x)) { case t_INT: y=modii(x,p); if (cmpii(y,ps2)>0) return subii(y,p); return y; case t_POL: lx=lgef(x); y=cgetg(lx,t_POL); y[1]=x[1]; for (i=2; i<lx; i++) { av=avma; p1=modii((GEN)x[i],p); if (cmpii(p1,ps2)>0) p1=subii(p1,p); y[i]=lpileupto(av,p1); } return normalizepol_i(y, lx); case t_COL: lx=lg(x); y=cgetg(lx,t_COL); for (i=1; i<lx; i++) { p1=modii((GEN)x[i],p); if (cmpii(p1,ps2)>0) p1=subii(p1,p); y[i]=(long)p1; } return y; } return x;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/eba2fe5ccc5aa3212798bdc178680c89662e2f98/polarit2.c/buggy/src/basemath/polarit2.c
x = (int)x; while (x>1) { ft *= x; x--; }
x = floor(x); while (x>1) { ft *= x; x--; }
fact(double x){ double ft = 1.0; x = (int)x; while (x>1) { ft *= x; x--; } return ft ;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/60f679bca2ebb52b8ebed03490b1973c9f8ee1c9/thue.c/buggy/src/modules/thue.c
PARI_get_psplot()
PARI_get_psplot(void)
PARI_get_psplot(){ pari_psplot.height = JSCR - 60; pari_psplot.width = ISCR - 40; pari_psplot.fheight = 15; pari_psplot.fwidth = 6; pari_psplot.hunit = 5; pari_psplot.vunit = 5;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6f0450eaf26bb1653fbb257487c2cbc116d69406/plotport.c/buggy/src/graph/plotport.c
return POSIX_NOT_IMPLEMENTED();
return 0;
int sigaction( int sig, const struct sigaction *act, struct sigaction *oact){ if ( !act ) set_errno_and_return_minus_one( EFAULT ); if ( !is_valid_signo(sig) ) set_errno_and_return_minus_one( EINVAL ); if ( oact ) *oact = _POSIX_signals_Vectors[ sig ]; /* XXX need to interpret some stuff here */ /* XXX some signals cannot be ignored */ _POSIX_signals_Vectors[ sig ] = *act; return POSIX_NOT_IMPLEMENTED();}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/98ed15e30fffa76a0dc298e1d68cf21a70f90bae/psignal.c/buggy/cpukit/posix/src/psignal.c
_Thread_Enable_dispatch();
int pthread_setspecific( pthread_key_t key, const void *value){ register POSIX_Keys_Control *the_key; unsigned32 index; unsigned32 class; Objects_Locations location; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { case OBJECTS_ERROR: return EINVAL; case OBJECTS_REMOTE: return EINVAL; /* should never happen */ case OBJECTS_LOCAL: index = _Objects_Get_index( _Thread_Executing->Object.id ); class = _Objects_Get_class( _Thread_Executing->Object.id ); the_key->Values[ class ][ index ] = (void *) value; return 0; } return POSIX_BOTTOM_REACHED();}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b521ae2fa7def4a3f4e8ea044897e9670937f4bd/key.c/buggy/c/src/exec/posix/src/key.c
_Thread_Enable_dispatch();
int pthread_key_delete( pthread_key_t key){ register POSIX_Keys_Control *the_key; Objects_Locations location; unsigned32 the_class; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { case OBJECTS_ERROR: return EINVAL; case OBJECTS_REMOTE: return 0; /* should never happen */ case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); the_key->is_active = FALSE; for ( the_class = OBJECTS_CLASSES_FIRST_THREAD_CLASS; the_class <= OBJECTS_CLASSES_LAST_THREAD_CLASS; the_class++ ) _Workspace_Free( the_key->Values[ the_class ] ); /* * NOTE: The destructor is not called and it is the responsibility * of the application to free the memory. */ _POSIX_Keys_Free( the_key ); return 0; } return POSIX_BOTTOM_REACHED();}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b521ae2fa7def4a3f4e8ea044897e9670937f4bd/key.c/buggy/c/src/exec/posix/src/key.c
* Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc().
* Set up mbuf cluster data strutures
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/clean/cpukit/libnetworking/rtems/rtems_glue.c
m_clalloc (nmbclusters, M_DONTWAIT);
p = malloc ((nmbclusters*MCLBYTES)+MCLBYTES-1); p = (char *)(((unsigned long)p + (MCLBYTES-1)) & ~(MCLBYTES-1)); if (p == NULL) rtems_panic ("Can't get network cluster memory."); mbutl = (struct mbuf *)p; for (i = 0; i < nmbclusters; i++) { ((union mcluster *)p)->mcl_next = mclfree; mclfree = (union mcluster *)p; p += MCLBYTES; mbstat.m_clfree++; } mbstat.m_clusters = nmbclusters;
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/clean/cpukit/libnetworking/rtems/rtems_glue.c
rtems_panic ("No memory for mbuf cluster reference counts.");
rtems_panic ("Can't get mbuf cluster reference counts memory.");
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/clean/cpukit/libnetworking/rtems/rtems_glue.c
m_mballoc (nmbuf, M_DONTWAIT);
/* * Set up mbuf data structures */ p = malloc(nmbuf * MSIZE); if (p == NULL) rtems_panic ("Can't get network memory."); for (i = 0; i < nmbuf; i++) { ((struct mbuf *)p)->m_next = mmbfree; mmbfree = (struct mbuf *)p; p += MSIZE; } mbstat.m_mbufs = nmbuf;
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/clean/cpukit/libnetworking/rtems/rtems_glue.c
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/clean/cpukit/libnetworking/rtems/rtems_glue.c
p=cgetr(prec); gaffect(ginv(a),p); a=p; p=cgetr(prec); gaffect(ginv(b),p); b=p;
a = fix(ginv(a), prec); b = fix(ginv(b), prec);
qromi(entree *ep, GEN a, GEN b, char *ch, long prec){ GEN ss,dss,s,h,q1,p1,p,qlint,del,ddel,x,sum; long av = avma, av1,tetpil,j,j1,j2,lim,it,sig; p=cgetr(prec); gaffect(ginv(a),p); a=p; p=cgetr(prec); gaffect(ginv(b),p); b=p; qlint=subrr(b,a); sig= -signe(qlint); if (!sig) { avma=av; return gzero; } if (sig>0) { setsigne(qlint,1); s=a; a=b; b=s; } s=new_chunk(JMAXP); h=new_chunk(JMAXP); h[0] = (long)realun(prec); x=divsr(2,addrr(a,b)); push_val(ep, x); p1=gmul(lisexpr(ch),mulrr(x,x)); s[0]=lmul(qlint,p1); for (it=1,j=1; j<JMAX; j++, it*=3) { h[j] = ldivrs((GEN)h[j-1],9); av1=avma; del=divrs(qlint,3*it); ddel=shiftr(del,1); x=addrr(a,shiftr(del,-1)); sum=gzero; for (j1=1; j1<=it; j1++) { q1 = ginv(x); ep->value = (void*)q1; p1=gmul(lisexpr(ch), gsqr(q1)); sum=gadd(sum,p1); x=addrr(x,ddel); q1 = ginv(x); ep->value = (void*)q1; p1=gmul(lisexpr(ch), gsqr(q1)); sum=gadd(sum,p1); x=addrr(x,del); } sum = gmul(sum,del); p1 = gdivgs((GEN)s[j-1],3); tetpil=avma; s[j]=lpile(av1,tetpil,gadd(p1,sum)); if (j>=KLOC) { tetpil=avma; ss=polint_i(h+j-KLOC,s+j-KLOC,gzero,KLOC+1,&dss); j1=gexpo(ss); j2=gexpo(dss); lim=bit_accuracy(prec)-(3*j/2)-6; if (j1-j2 > lim || j1 < -lim) { pop_val(ep); if (gcmp0(gimag(ss))) ss=greal(ss); tetpil=avma; return gerepile(av,tetpil,gmulsg(sig,ss)); } } } err(intger2); return NULL; /* not reached */}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/ab84d9d566e599edd5c4c488b65be4019420ae2b/sumiter.c/buggy/src/language/sumiter.c
for (i=1; i<lv; i++) tabE[i] = tabTH[i] = tabeta[i] = zero;
inittabs(int lv){ int i; tabaall = (GEN*)cgetg(lv,t_VECSMALL); tabtall = (GEN*)cgetg(lv,t_VECSMALL); tabcyc = (GEN*)cgetg(lv,t_VEC); tabE = cgetg(lv,t_VEC); tabTH= cgetg(lv,t_VEC); tabeta=cgetg(lv,t_VEC); sgt = cgetg(lv,t_VECSMALL); ctsgt= cgetg(lv,t_VECSMALL); for (i=1; i<lv; i++) sgt[i] = ctsgt[i] = 0;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/0e8725a00d2c201f2fea372cdf3ebfbc61a9340c/aprcl.c/clean/src/modules/aprcl.c
&IMFS_linearfile_handlers,
int IMFS_initialize( rtems_filesystem_mount_table_entry_t *temp_mt_entry){ IMFS_initialize_support( temp_mt_entry, &IMFS_ops, &IMFS_memfile_handlers, &IMFS_directory_handlers ); return 0;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/0ef748fb45137bac811ded19dfad2034f924505a/imfs_init.c/buggy/cpukit/libfs/src/imfs/imfs_init.c
long i,lx,vx,av,tetpil, tx = typ(x);
ulong av,tetpil, tx = typ(x); long i,lx,vx;
chinois(GEN x, GEN y){ long i,lx,vx,av,tetpil, tx = typ(x); GEN z,p1,p2,d,u,v; if (gegal(x,y)) return gcopy(x); if (tx == typ(y)) switch(tx) { case t_POLMOD: if (gegal((GEN)x[1],(GEN)y[1])) /* same modulus */ { z=cgetg(3,tx); z[1]=lcopy((GEN)x[1]); z[2]=(long)chinois((GEN)x[2],(GEN)y[2]); return z; } /* fall through */ case t_INTMOD: z=cgetg(3,tx); av=avma; d=gbezout((GEN)x[1],(GEN)y[1],&u,&v); if (!gegal(gmod((GEN)x[2],d), gmod((GEN)y[2],d))) break; p1 = gdiv((GEN)x[1],d); p2 = gadd((GEN)x[2], gmul(gmul(u,p1), gadd((GEN)y[2],gneg((GEN)x[2])))); tetpil=avma; z[1]=lmul(p1,(GEN)y[1]); z[2]=lmod(p2,(GEN)z[1]); gerepilemanyvec(av,tetpil,z+1,2); return z; case t_POL: lx=lgef(x); vx=varn(x); z=cgetg(lx,tx); if (lx!=lgef(y) || vx!=varn(y)) break; z[1]=evalsigne(1)|evallgef(lx)|evalvarn(vx); for (i=2; i<lx; i++) z[i]=(long)chinois((GEN)x[i],(GEN)y[i]); return z; case t_VEC: case t_COL: case t_MAT: lx=lg(x); z=cgetg(lx,tx); if (lx!=lg(y)) break; for (i=1; i<lx; i++) z[i]=(long)chinois((GEN)x[i],(GEN)y[i]); return z; } err(talker,"incompatible arguments in chinois"); return NULL; /* not reached */}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/9749d3e46caef3f61b412b608c8ac51b8f010460/arith1.c/buggy/src/basemath/arith1.c
case t_VECSMALL: lx=lg(x); y=cgetg(lx,tx); for (i=1; i<lx; i++) y[i] = -x[i]; break;
gneg_i(GEN x){ long tx=typ(x),lx,i; GEN y; if (gcmp0(x)) return x; switch(tx) { case t_INT: case t_REAL: return mpneg(x); case t_INTMOD: y=cgetg(3,t_INTMOD); y[1]=x[1]; y[2] = lsubii((GEN)y[1],(GEN)x[2]); break; case t_FRAC: case t_FRACN: case t_RFRAC: case t_RFRACN: y=cgetg(3,tx); y[2]=x[2]; y[1]=(long)gneg_i((GEN)x[1]); break; case t_PADIC: y = cgetg(5,t_PADIC); y[2]=x[2]; y[3]=x[3]; y[1] = evalprecp(precp(x)) | evalvalp(valp(x)); y[4]=lsubii((GEN)x[3],(GEN)x[4]); break; case t_POLMOD: y=cgetg(3,t_POLMOD); y[1]=x[1]; y[2]=(long)gneg_i((GEN)x[2]); break; case t_QUAD: y=cgetg(4,t_QUAD); y[1]=x[1]; y[2]=(long)gneg_i((GEN)x[2]); y[3]=(long)gneg_i((GEN)x[3]); break; case t_COMPLEX: case t_VEC: case t_COL: case t_MAT: lx=lg(x); y=cgetg(lx,tx); for (i=1; i<lx; i++) y[i]=(long)gneg_i((GEN)x[i]); break; case t_POL: case t_SER: lx=lg(x); y=cgetg(lx,tx); y[1]=x[1]; for (i=2; i<lx; i++) y[i]=(long)gneg_i((GEN)x[i]); break; default: err(typeer,"negation"); return NULL; /* not reached */ } return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/b72a7d60d8b5d994b71f0ccd687bbeabbd2ffe23/gen2.c/clean/src/basemath/gen2.c
if (j < e) k /= u_pow(p, e - j);
if (j < e) k /= npownn(p, e - j);
gisanypower(GEN x, GEN *pty){ long tx = typ(x); ulong k, h; if (tx == t_FRAC) { pari_sp av = avma; GEN fa, P, E, a = (GEN)x[1], b = (GEN)x[2]; long i, j, p, e; int sw = (cmpii(a, b) > 0); if (sw) swap(a, b); k = isanypower(a, pty? &a: NULL); if (!k) { avma = av; return 0; } fa = factoru(k); P = (GEN)fa[1]; E = (GEN)fa[2]; h = k; for (i = lg(P) - 1; i > 0; i--) { p = P[i]; e = E[i]; for (j = 0; j < e; j++) if (!is_kth_power(b, p, &b, NULL)) break; if (j < e) k /= u_pow(p, e - j); } if (k == 1) { avma = av; return 0; } if (!pty) { avma = av; return k; } if (k != h) a = gpowgs(a, h/k); *pty = gerepilecopy(av, mkfrac(a, b)); return k; } if (tx == t_INT) return isanypower(x, pty); err(talker, "missing exponent"); return 0; /* not reached */}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/b03001ef86c74799b6280212f7a40aee0823ed89/arith1.c/clean/src/basemath/arith1.c
long lx, av = avma; ulong k,l;
long lx,k,l, av = avma;
mpfact(long n){ long lx, av = avma; ulong k,l; GEN x; if (n<2) { if (n<0) err(facter); return gun; } if (n < 60) { x = gdeux; for (k=3; k<=n; k++) x = mulsi(k,x); return gerepileuptoint(av,x); } lx = 1; x = cgetg(1 + n/2, t_VEC); for (k=2;; k++) { l = n+2-k; if (l <= k) break; x[lx++] = (long)muluu(k,l); } if (l == k) x[lx++] = lstoi(k); setlg(x, lx); return gerepileuptoint(av, divide_conquer_prod(x, mulii));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/9749d3e46caef3f61b412b608c8ac51b8f010460/arith1.c/buggy/src/basemath/arith1.c
long av,tetpil,lx,i,tx=typ(x);
long lx,i,tx=typ(x); ulong av,tetpil;
content(GEN x){ long av,tetpil,lx,i,tx=typ(x); GEN p1,p2; if (is_scalar_t(tx)) return tx==t_POLMOD? content((GEN)x[2]): gcopy(x); av = avma; switch(tx) { case t_RFRAC: case t_RFRACN: p1=content((GEN)x[1]); p2=content((GEN)x[2]); tetpil=avma; return gerepile(av,tetpil,gdiv(p1,p2)); case t_VEC: case t_COL: case t_MAT: lx = lg(x); if (lx==1) return gun; p1=content((GEN)x[1]); for (i=2; i<lx; i++) p1 = ggcd(p1,content((GEN)x[i])); return gerepileupto(av,p1); case t_POL: if (!signe(x)) return gzero; lx = lgef(x); break; case t_SER: if (!signe(x)) return gzero; lx = lg(x); break; case t_QFR: case t_QFI: lx = 4; break; default: err(typeer,"content"); return NULL; /* not reached */ } for (i=lontyp[tx]; i<lx; i++) if (typ(x[i]) != t_INT) break; lx--; p1=(GEN)x[lx]; if (i > lx) { /* integer coeffs */ while (lx>lontyp[tx]) { lx--; p1=mppgcd(p1,(GEN)x[lx]); if (is_pm1(p1)) { avma=av; return gun; } } } else { while (lx>lontyp[tx]) { lx--; p1=ggcd(p1,(GEN)x[lx]); } if (isinexactreal(p1)) { avma=av; return gun; } } return av==avma? gcopy(p1): gerepileupto(av,p1);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/9749d3e46caef3f61b412b608c8ac51b8f010460/polarit2.c/clean/src/basemath/polarit2.c
affrr(p2,y); avma = av; return y;
affr_fixlg(p2,y); avma = av; return y;
exp1r_abs(GEN x){ long l = lg(x), l2 = l+1, ex = expo(x), l1, i, n, m, s; GEN y = cgetr(l), p1, p2, p3, X, unr; pari_sp av2, av = avma; double a, b, beta, gama = 2.0 /* optimized for SUN3 */; /* KB: 3.0 is better for UltraSparc */ if (ex >= EXMAX) err(talker,"exponent too large in exp"); beta = 5. + bit_accuracy_mul(l, LOG2); a = sqrt(beta/(gama*LOG2)); b = (BITS_IN_LONG-1-ex) + log2(a * (gama/2.718281828459045) / (double)(ulong)x[2]); if (a >= b) { n = (long)(1+a*gama); m = (long)(1+a-b); l2 += m>>TWOPOTBITS_IN_LONG; } else { /* rare ! */ b = -1 - log((double)(ulong)x[2]) + (BITS_IN_LONG-1-ex)*LOG2; /*-1-log(x)*/ n = (long)(1 + beta/b); m = 0; } unr=realun(l2); p2 =realun(l2); setlg(p2,3); X = cgetr(l2); affrr(x, X); setsigne(X, 1); if (m) setexpo(X, ex-m); s = 0; l1 = 3; av2 = avma; for (i=n; i>=2; i--) { setlg(X,l1); p3 = divrs(X,i); s -= expo(p3); p1 = mulrr(p3,p2); setlg(p1,l1); l1 += s>>TWOPOTBITS_IN_LONG; if (l1>l2) l1=l2; s &= (BITS_IN_LONG-1); setlg(unr,l1); p1 = addrr_sign(unr,1, p1,1); setlg(p2,l1); affrr(p1,p2); avma = av2; } setlg(p2,l2); setlg(X,l2); p2 = mulrr(X,p2); for (i=1; i<=m; i++) { setlg(p2,l2); p2 = mulrr(p2, addsr(2,p2)); } affrr(p2,y); avma = av; return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/a0d8bd4ca3992fcf4e709bbc857cacac191dae1b/trans1.c/buggy/src/basemath/trans1.c
if (phase == PHASE_DEAD)
if (pppd_phase == PHASE_DEAD)
link_terminated(unit) int unit;{ if (phase == PHASE_DEAD) return; if (pap_logout_hook) { pap_logout_hook(); } new_phase(PHASE_DEAD); notice("Connection terminated.");}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/48cdb95aa2444a386a911be1a8251483d79a9935/auth.c/buggy/cpukit/pppd/auth.c
if (bl_num(x) < loc) return 0; /* older */
pop_val_if_newer(entree *ep, long loc){ var_cell *v = (var_cell*) ep->args; if (v == INITIAL) return 0; if (v->flag == COPY_VAL) { GEN x = (GEN)ep->value; if (DEBUGMEM>2) fprintferr("popping %s (bloc no %ld)\n", ep->name, bl_num(x)); if (bl_num(x) < loc) return 0; /* older */ killbloc((GEN)ep->value); } ep->value = v->value; ep->args = (void*) v->prev; free((void*)v); return 1;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d6bc6f7c8515f98a50f281cca0bb8c335aed5b17/anal.c/clean/src/language/anal.c
void _exit(int status)
void _exit( int status )
void _exit(int status){}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/07a3253de2c3f9bc2d96a351680ec72548dadd2d/no_libc.c/buggy/c/src/exec/libcsupport/src/no_libc.c
case 0: return kbessel(nu,gx,prec); case 1: return kbessel2(nu,gx,prec);
case 0: return kbesselnew(nu,gx,prec); case 1: return kbessel(nu,gx,prec); case 2: return kbessel2(nu,gx,prec); case 3: return kbesselnewalways(nu,gx,prec);
kbessel0(GEN nu, GEN gx, long flag, long prec){ switch(flag) { case 0: return kbessel(nu,gx,prec); case 1: return kbessel2(nu,gx,prec); default: err(flagerr,"besselk"); } return NULL; /* not reached */}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d824424e0a4051e3b938353b1b01e0b528104092/trans3.c/clean/src/basemath/trans3.c
GEN x,y,p1,p2,zf,zz,s,t,q,r,u,v,e,f,c,d,ak,pitemp,nu2,w; long l, lbin, k, k2, l1, n2, n;
GEN x,y,yfin,p1,p2,zf,zz,s,t,q,r,u,v,e,f,c,d,ak,pitemp,nu2,w; long l, lnew, lbin, k, k2, l1, n2, n, ex, rab=0;
kbessel(GEN nu, GEN gx, long prec){ GEN x,y,p1,p2,zf,zz,s,t,q,r,u,v,e,f,c,d,ak,pitemp,nu2,w; long l, lbin, k, k2, l1, n2, n; gpmem_t av, av1; if (typ(nu)==t_COMPLEX) return kbessel2(nu,gx,prec); l = (typ(gx)==t_REAL)? lg(gx): prec; y=cgetr(l); l1=l+1; av=avma; x = fix(gx, l); u=cgetr(l1); v=cgetr(l1); c=cgetr(l1); d=cgetr(l1); e=cgetr(l1); f=cgetr(l1); nu2=gmulgs(gsqr(nu),-4); n = (long) (bit_accuracy(l)*LOG2 + PI*sqrt(gtodouble(gnorm(nu)))) / 2; n2=(n<<1); pitemp=mppi(l1); /* this 10 should really be a 5, but then kbessel(15.99) enters oo loop */ lbin = 10 - bit_accuracy(l); av1=avma; if (gcmpgs(x,n)<0) { zf=gsqrt(gdivgs(pitemp,n2),prec); zz=cgetr(l1); gaffect(ginv(stoi(n2<<2)), zz); s=gun; t=gzero; for (k=n2,k2=2*n2-1; k > 0; k--,k2-=2) { if (k2 & ~(MAXHALFULONG>>1)) p1 = gadd(mulss(k2,k2),nu2); else p1 = gaddsg(k2*k2,nu2); ak=gdivgs(gmul(p1,zz),-k); s=gadd(gun,gmul(ak,s)); t=gaddsg(k2,gmul(ak,t)); } gmulz(s,zf,u); t=gmul2n(t,-1); gdivgsz(gadd(gmul(t,zf),gmul(u,nu)),-n2,v); avma=av1; affsr(n2,q=cgetr(l1)); r=gmul2n(x,1); av1=avma; for(;;) { p1=divsr(5,q); if (expo(p1) >= -1) p1=ghalf; p2=subsr(1,divrr(r,q)); if (gcmp(p1,p2)>0) p1=p2; gnegz(p1,c); gaffsg(1,d); affrr(u,e); affrr(v,f); for (k=1; ; k++) { w=gadd(gmul(gsubsg(k,ghalf),u), gmul(subrs(q,k),v)); w=gadd(w, gmul(nu,gsub(u,gmul2n(v,1)))); gdivgsz(gmul(q,v),k,u); gdivgsz(w,k,v); gmulz(d,c,d); gaddz(e,gmul(d,u),e); p1=gmul(d,v); gaddz(f,p1,f); if (gexpo(p1)-gexpo(f) <= lbin) break; avma=av1; } p1=u; u=e; e=p1; p1=v; v=f; f=p1; gmulz(q,gaddsg(1,c),q); if (expo(subrr(q,r)) <= lbin) break; } gmulz(u,gpui(gdivgs(x,n),nu,prec),y); } else { p2=gmul2n(x,1); zf=gsqrt(gdiv(pitemp,p2),prec); zz=ginv(gmul2n(p2,2)); s=gun; for (k=n2,k2=2*n2-1; k > 0; k--,k2-=2) { if (k2 & ~(MAXHALFULONG>>1)) p1=gadd(mulss(k2,k2),nu2); else p1=gaddsg(k2*k2,nu2); ak=gdivgs(gmul(p1,zz),k); s=gsub(gun,gmul(ak,s)); } gmulz(s,zf,y); } gdivz(y,mpexp(x),y); avma=av; return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d824424e0a4051e3b938353b1b01e0b528104092/trans3.c/clean/src/basemath/trans3.c
y=cgetr(l); l1=l+1; av=avma; x = fix(gx, l);
ex = gexpo(gx); if (ex < 0) { rab = 1 + ((-ex)>>TWOPOTBITS_IN_LONG); lnew = l + rab; prec += rab; } else lnew = l; yfin=cgetr(l); l1=lnew+1; av=avma; x = fix(gx, lnew); y=cgetr(lnew);
kbessel(GEN nu, GEN gx, long prec){ GEN x,y,p1,p2,zf,zz,s,t,q,r,u,v,e,f,c,d,ak,pitemp,nu2,w; long l, lbin, k, k2, l1, n2, n; gpmem_t av, av1; if (typ(nu)==t_COMPLEX) return kbessel2(nu,gx,prec); l = (typ(gx)==t_REAL)? lg(gx): prec; y=cgetr(l); l1=l+1; av=avma; x = fix(gx, l); u=cgetr(l1); v=cgetr(l1); c=cgetr(l1); d=cgetr(l1); e=cgetr(l1); f=cgetr(l1); nu2=gmulgs(gsqr(nu),-4); n = (long) (bit_accuracy(l)*LOG2 + PI*sqrt(gtodouble(gnorm(nu)))) / 2; n2=(n<<1); pitemp=mppi(l1); /* this 10 should really be a 5, but then kbessel(15.99) enters oo loop */ lbin = 10 - bit_accuracy(l); av1=avma; if (gcmpgs(x,n)<0) { zf=gsqrt(gdivgs(pitemp,n2),prec); zz=cgetr(l1); gaffect(ginv(stoi(n2<<2)), zz); s=gun; t=gzero; for (k=n2,k2=2*n2-1; k > 0; k--,k2-=2) { if (k2 & ~(MAXHALFULONG>>1)) p1 = gadd(mulss(k2,k2),nu2); else p1 = gaddsg(k2*k2,nu2); ak=gdivgs(gmul(p1,zz),-k); s=gadd(gun,gmul(ak,s)); t=gaddsg(k2,gmul(ak,t)); } gmulz(s,zf,u); t=gmul2n(t,-1); gdivgsz(gadd(gmul(t,zf),gmul(u,nu)),-n2,v); avma=av1; affsr(n2,q=cgetr(l1)); r=gmul2n(x,1); av1=avma; for(;;) { p1=divsr(5,q); if (expo(p1) >= -1) p1=ghalf; p2=subsr(1,divrr(r,q)); if (gcmp(p1,p2)>0) p1=p2; gnegz(p1,c); gaffsg(1,d); affrr(u,e); affrr(v,f); for (k=1; ; k++) { w=gadd(gmul(gsubsg(k,ghalf),u), gmul(subrs(q,k),v)); w=gadd(w, gmul(nu,gsub(u,gmul2n(v,1)))); gdivgsz(gmul(q,v),k,u); gdivgsz(w,k,v); gmulz(d,c,d); gaddz(e,gmul(d,u),e); p1=gmul(d,v); gaddz(f,p1,f); if (gexpo(p1)-gexpo(f) <= lbin) break; avma=av1; } p1=u; u=e; e=p1; p1=v; v=f; f=p1; gmulz(q,gaddsg(1,c),q); if (expo(subrr(q,r)) <= lbin) break; } gmulz(u,gpui(gdivgs(x,n),nu,prec),y); } else { p2=gmul2n(x,1); zf=gsqrt(gdiv(pitemp,p2),prec); zz=ginv(gmul2n(p2,2)); s=gun; for (k=n2,k2=2*n2-1; k > 0; k--,k2-=2) { if (k2 & ~(MAXHALFULONG>>1)) p1=gadd(mulss(k2,k2),nu2); else p1=gaddsg(k2*k2,nu2); ak=gdivgs(gmul(p1,zz),k); s=gsub(gun,gmul(ak,s)); } gmulz(s,zf,y); } gdivz(y,mpexp(x),y); avma=av; return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d824424e0a4051e3b938353b1b01e0b528104092/trans3.c/clean/src/basemath/trans3.c
gdivz(y,mpexp(x),y); avma=av; return y;
gdivz(y,mpexp(x),yfin); avma=av; return yfin;
kbessel(GEN nu, GEN gx, long prec){ GEN x,y,p1,p2,zf,zz,s,t,q,r,u,v,e,f,c,d,ak,pitemp,nu2,w; long l, lbin, k, k2, l1, n2, n; gpmem_t av, av1; if (typ(nu)==t_COMPLEX) return kbessel2(nu,gx,prec); l = (typ(gx)==t_REAL)? lg(gx): prec; y=cgetr(l); l1=l+1; av=avma; x = fix(gx, l); u=cgetr(l1); v=cgetr(l1); c=cgetr(l1); d=cgetr(l1); e=cgetr(l1); f=cgetr(l1); nu2=gmulgs(gsqr(nu),-4); n = (long) (bit_accuracy(l)*LOG2 + PI*sqrt(gtodouble(gnorm(nu)))) / 2; n2=(n<<1); pitemp=mppi(l1); /* this 10 should really be a 5, but then kbessel(15.99) enters oo loop */ lbin = 10 - bit_accuracy(l); av1=avma; if (gcmpgs(x,n)<0) { zf=gsqrt(gdivgs(pitemp,n2),prec); zz=cgetr(l1); gaffect(ginv(stoi(n2<<2)), zz); s=gun; t=gzero; for (k=n2,k2=2*n2-1; k > 0; k--,k2-=2) { if (k2 & ~(MAXHALFULONG>>1)) p1 = gadd(mulss(k2,k2),nu2); else p1 = gaddsg(k2*k2,nu2); ak=gdivgs(gmul(p1,zz),-k); s=gadd(gun,gmul(ak,s)); t=gaddsg(k2,gmul(ak,t)); } gmulz(s,zf,u); t=gmul2n(t,-1); gdivgsz(gadd(gmul(t,zf),gmul(u,nu)),-n2,v); avma=av1; affsr(n2,q=cgetr(l1)); r=gmul2n(x,1); av1=avma; for(;;) { p1=divsr(5,q); if (expo(p1) >= -1) p1=ghalf; p2=subsr(1,divrr(r,q)); if (gcmp(p1,p2)>0) p1=p2; gnegz(p1,c); gaffsg(1,d); affrr(u,e); affrr(v,f); for (k=1; ; k++) { w=gadd(gmul(gsubsg(k,ghalf),u), gmul(subrs(q,k),v)); w=gadd(w, gmul(nu,gsub(u,gmul2n(v,1)))); gdivgsz(gmul(q,v),k,u); gdivgsz(w,k,v); gmulz(d,c,d); gaddz(e,gmul(d,u),e); p1=gmul(d,v); gaddz(f,p1,f); if (gexpo(p1)-gexpo(f) <= lbin) break; avma=av1; } p1=u; u=e; e=p1; p1=v; v=f; f=p1; gmulz(q,gaddsg(1,c),q); if (expo(subrr(q,r)) <= lbin) break; } gmulz(u,gpui(gdivgs(x,n),nu,prec),y); } else { p2=gmul2n(x,1); zf=gsqrt(gdiv(pitemp,p2),prec); zz=ginv(gmul2n(p2,2)); s=gun; for (k=n2,k2=2*n2-1; k > 0; k--,k2-=2) { if (k2 & ~(MAXHALFULONG>>1)) p1=gadd(mulss(k2,k2),nu2); else p1=gaddsg(k2*k2,nu2); ak=gdivgs(gmul(p1,zz),k); s=gsub(gun,gmul(ak,s)); } gmulz(s,zf,y); } gdivz(y,mpexp(x),y); avma=av; return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d824424e0a4051e3b938353b1b01e0b528104092/trans3.c/clean/src/basemath/trans3.c
if (gegal(x, initial_value(ep))) return gcopy(z); #undef initial_value
geval(GEN x){ long av,tetpil,lx,i, tx = typ(x); GEN y,z; if (is_const_t(tx)) return gcopy(x); if (is_graphicvec_t(tx) || tx == t_RFRACN) { lx=lg(x); y=cgetg(lx, tx); for (i=1; i<lx; i++) y[i] = (long)geval((GEN)x[i]); return y; } switch(tx) { case t_STR: return flisexpr(GSTR(x)); case t_POLMOD: y=cgetg(3,tx); y[1]=(long)geval((GEN)x[1]); av=avma; z=geval((GEN)x[2]); tetpil=avma; y[2]=lpile(av,tetpil,gmod(z,(GEN)y[1])); return y; case t_POL: lx=lgef(x); if (lx==2) return gzero; { entree *ep = varentries[varn(x)]; if (!ep) return gcopy(x); z = (GEN)ep->value; } y=gzero; av=avma; for (i=lx-1; i>1; i--) { tetpil=avma; y = gadd(geval((GEN)x[i]), gmul(z,y)); } return gerepile(av,tetpil,y); case t_SER: err(impl, "evaluation of a power series"); case t_RFRAC: return gdiv(geval((GEN)x[1]),geval((GEN)x[2])); } err(typeer,"geval"); return NULL; /* not reached */}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/60cf9f6eee6a1eea2e2b5767cbe27adf0d900f4b/gen3.c/buggy/src/basemath/gen3.c
p1=cgetr(3); *s=p1; p1[1]=x[1]; p1[2]=0; *c=addsr(1,x); return;
*s=realzero_bit(expo(x)); *c=addsr(1,x); return;
mpsincos(GEN x, GEN *s, GEN *c){ long av,tetpil,mod8; GEN p1, *gptr[2]; if (typ(x)!=t_REAL) err(typeer,"mpsincos"); if (!signe(x)) { p1=cgetr(3); *s=p1; p1[1]=x[1]; p1[2]=0; *c=addsr(1,x); return; } av=avma; p1=mpsc1(x,&mod8); tetpil=avma; switch(mod8) { case 0: *c=addsr( 1,p1); *s=mpaut(p1); break; case 1: *s=addsr( 1,p1); *c=mpaut(p1); setsigne(*c,-signe(*c)); break; case 2: *c=subsr(-1,p1); *s=mpaut(p1); setsigne(*s,-signe(*s)); break; case 3: *s=subsr(-1,p1); *c=mpaut(p1); break; case 4: *c=addsr( 1,p1); *s=mpaut(p1); setsigne(*s,-signe(*s)); break; case 5: *s=addsr( 1,p1); *c=mpaut(p1); break; case 6: *c=subsr(-1,p1); *s=mpaut(p1); break; case 7: *s=subsr(-1,p1); *c=mpaut(p1); setsigne(*c,-signe(*c)); break; } gptr[0]=s; gptr[1]=c; gerepilemanysp(av,tetpil,gptr,2);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/1558baf8c3b715dd704e6dddf2c7f1f51dc47e84/trans1.c/buggy/src/basemath/trans1.c
cacr = 0x80008000; /* Data and instruction cache on */
cacr = 0x00000000; /* Data and instruction cache off */
void page_table_init( rtems_configuration_table *config_table){ unsigned char j1; /* State of J1 jumpers */ register unsigned long dtt0; /* Content of dtt0 */ register unsigned long cacr; /* Content of cacr */ /* * Logical base addr = 0x00 map starting at 0x00000000 * Logical address mask = 0x7F map up to 0x7FFFFFFF * E = 0b1 enable address translation * S-Field = 0b1X ignore FC2 when matching * U1, U0 = 0b00 user page attributes not used * CM = 0b01 cachable, copyback * W = 0b0 read/write access allowed */ dtt0 = 0x007FC020; cacr = 0x80008000; /* Data and instruction cache on */ /* Read the J1 header */ j1 = (unsigned char)(lcsr->vector_base & 0xFF); if ( j1 & 0x80 ) /* Jumper J1-7 if off, disable data caching */ cacr &= 0x7FFFFFFF; if ( j1 & 0x40 ) /* Jumper J1-6 if off, disable instruction caching */ cacr &= 0xFFFF7FFF; if ( j1 & 0x20 ) /* Jumper J1-5 is off, enable writethrough caching */ dtt0 &= 0xFFFFFF9F; /* do it ! */ asm volatile("movec %0, %%tc /* turn off paged address translation */ movec %0, %%cacr /* disable both caches */ cinva %%bc /* clear both caches */ movec %1,%%dtt0 /* block address translation on */ movec %1,%%itt0 movec %2,%%dtt1 movec %2,%%itt1 movec %3,%%cacr" /* data cache on */ :: "d" (0), "d" (dtt0), "d" (0xFF00C040), "d" (cacr));}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/8ef38186faea3d9b5e6f0f1242f668cb7e7a3d52/page_table.c/buggy/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c
if ( j1 & 0x80 ) /* Jumper J1-7 if off, disable data caching */ cacr &= 0x7FFFFFFF;
if ( j1 & 0x80 ) /* Jumper J1-7 if off, disable data caching */ cacr &= 0x7FFFFFFF;
void page_table_init( rtems_configuration_table *config_table){ unsigned char j1; /* State of J1 jumpers */ register unsigned long dtt0; /* Content of dtt0 */ register unsigned long cacr; /* Content of cacr */ /* * Logical base addr = 0x00 map starting at 0x00000000 * Logical address mask = 0x7F map up to 0x7FFFFFFF * E = 0b1 enable address translation * S-Field = 0b1X ignore FC2 when matching * U1, U0 = 0b00 user page attributes not used * CM = 0b01 cachable, copyback * W = 0b0 read/write access allowed */ dtt0 = 0x007FC020; cacr = 0x80008000; /* Data and instruction cache on */ /* Read the J1 header */ j1 = (unsigned char)(lcsr->vector_base & 0xFF); if ( j1 & 0x80 ) /* Jumper J1-7 if off, disable data caching */ cacr &= 0x7FFFFFFF; if ( j1 & 0x40 ) /* Jumper J1-6 if off, disable instruction caching */ cacr &= 0xFFFF7FFF; if ( j1 & 0x20 ) /* Jumper J1-5 is off, enable writethrough caching */ dtt0 &= 0xFFFFFF9F; /* do it ! */ asm volatile("movec %0, %%tc /* turn off paged address translation */ movec %0, %%cacr /* disable both caches */ cinva %%bc /* clear both caches */ movec %1,%%dtt0 /* block address translation on */ movec %1,%%itt0 movec %2,%%dtt1 movec %2,%%itt1 movec %3,%%cacr" /* data cache on */ :: "d" (0), "d" (dtt0), "d" (0xFF00C040), "d" (cacr));}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/8ef38186faea3d9b5e6f0f1242f668cb7e7a3d52/page_table.c/buggy/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c
if ( j1 & 0x40 ) /* Jumper J1-6 if off, disable instruction caching */ cacr &= 0xFFFF7FFF;
if ( j1 & 0x40 ) /* Jumper J1-6 if off, disable instruction caching */ cacr &= 0xFFFF7FFF;
void page_table_init( rtems_configuration_table *config_table){ unsigned char j1; /* State of J1 jumpers */ register unsigned long dtt0; /* Content of dtt0 */ register unsigned long cacr; /* Content of cacr */ /* * Logical base addr = 0x00 map starting at 0x00000000 * Logical address mask = 0x7F map up to 0x7FFFFFFF * E = 0b1 enable address translation * S-Field = 0b1X ignore FC2 when matching * U1, U0 = 0b00 user page attributes not used * CM = 0b01 cachable, copyback * W = 0b0 read/write access allowed */ dtt0 = 0x007FC020; cacr = 0x80008000; /* Data and instruction cache on */ /* Read the J1 header */ j1 = (unsigned char)(lcsr->vector_base & 0xFF); if ( j1 & 0x80 ) /* Jumper J1-7 if off, disable data caching */ cacr &= 0x7FFFFFFF; if ( j1 & 0x40 ) /* Jumper J1-6 if off, disable instruction caching */ cacr &= 0xFFFF7FFF; if ( j1 & 0x20 ) /* Jumper J1-5 is off, enable writethrough caching */ dtt0 &= 0xFFFFFF9F; /* do it ! */ asm volatile("movec %0, %%tc /* turn off paged address translation */ movec %0, %%cacr /* disable both caches */ cinva %%bc /* clear both caches */ movec %1,%%dtt0 /* block address translation on */ movec %1,%%itt0 movec %2,%%dtt1 movec %2,%%itt1 movec %3,%%cacr" /* data cache on */ :: "d" (0), "d" (dtt0), "d" (0xFF00C040), "d" (cacr));}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/8ef38186faea3d9b5e6f0f1242f668cb7e7a3d52/page_table.c/buggy/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c
if ( j1 & 0x20 ) /* Jumper J1-5 is off, enable writethrough caching */ dtt0 &= 0xFFFFFF9F;
if ( j1 & 0x20 ) /* Jumper J1-5 is off, enable writethrough caching */ dtt0 &= 0xFFFFFF9F; }
void page_table_init( rtems_configuration_table *config_table){ unsigned char j1; /* State of J1 jumpers */ register unsigned long dtt0; /* Content of dtt0 */ register unsigned long cacr; /* Content of cacr */ /* * Logical base addr = 0x00 map starting at 0x00000000 * Logical address mask = 0x7F map up to 0x7FFFFFFF * E = 0b1 enable address translation * S-Field = 0b1X ignore FC2 when matching * U1, U0 = 0b00 user page attributes not used * CM = 0b01 cachable, copyback * W = 0b0 read/write access allowed */ dtt0 = 0x007FC020; cacr = 0x80008000; /* Data and instruction cache on */ /* Read the J1 header */ j1 = (unsigned char)(lcsr->vector_base & 0xFF); if ( j1 & 0x80 ) /* Jumper J1-7 if off, disable data caching */ cacr &= 0x7FFFFFFF; if ( j1 & 0x40 ) /* Jumper J1-6 if off, disable instruction caching */ cacr &= 0xFFFF7FFF; if ( j1 & 0x20 ) /* Jumper J1-5 is off, enable writethrough caching */ dtt0 &= 0xFFFFFF9F; /* do it ! */ asm volatile("movec %0, %%tc /* turn off paged address translation */ movec %0, %%cacr /* disable both caches */ cinva %%bc /* clear both caches */ movec %1,%%dtt0 /* block address translation on */ movec %1,%%itt0 movec %2,%%dtt1 movec %2,%%itt1 movec %3,%%cacr" /* data cache on */ :: "d" (0), "d" (dtt0), "d" (0xFF00C040), "d" (cacr));}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/8ef38186faea3d9b5e6f0f1242f668cb7e7a3d52/page_table.c/buggy/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c
affrr(mptan(x), y); avma = av; return y;
affr_fixlg(mptan(x), y); avma = av; return y;
gtan(GEN x, long prec){ pari_sp av; GEN y, s, c; switch(typ(x)) { case t_REAL: return mptan(x); case t_COMPLEX: av = avma; gsincos(x,&s,&c,prec); return gerepileupto(av, gdiv(s,c)); case t_INT: case t_FRAC: y = cgetr(prec); av = avma; /* _not_ afrr: we want to be able to reduce mod Pi */ x = gadd(x, realzero(prec)); affrr(mptan(x), y); avma = av; return y; case t_INTMOD: case t_PADIC: err(typeer,"gtan"); default: av = avma; if (!(y = _toser(x))) break; if (gcmp0(y)) return gcopy(y); if (valp(y) < 0) err(negexper,"gtan"); gsincos(y,&s,&c,prec); return gerepileupto(av, gdiv(s,c)); } return transc(gtan,x,prec);}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/a0d8bd4ca3992fcf4e709bbc857cacac191dae1b/trans1.c/buggy/src/basemath/trans1.c
rtems_unsigned32 n = rtems_get_index(*next_id);
uint32_t n = rtems_get_index(*next_id);
rtems_monitor_init_task_next( void *object_info, rtems_monitor_init_task_t *canonical_init_task, rtems_id *next_id){ rtems_configuration_table *c = _Configuration_Table; rtems_initialization_tasks_table *itask; rtems_unsigned32 n = rtems_get_index(*next_id); if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks) goto failed; _Thread_Disable_dispatch(); itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n; /* * dummy up a fake id and name for this item */ canonical_init_task->id = n; canonical_init_task->name = itask->name; *next_id += 1; return (void *) itask;failed: *next_id = RTEMS_OBJECT_ID_FINAL; return 0;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3e08d4ee6242f1a0ea4afe9dc0a20800632184fe/mon-itask.c/clean/cpukit/libmisc/monitor/mon-itask.c
int arg; rtems_monitor_command_entry_t *command;
int arg; rtems_monitor_command_entry_t *command;
rtems_monitor_help_cmd( int argc, char **argv, unsigned32 command_arg, boolean verbose){ int arg; rtems_monitor_command_entry_t *command; command = (rtems_monitor_command_entry_t *) command_arg; if (argc == 1) rtems_monitor_command_usage(command, 0); else { for (arg=1; argv[arg]; arg++) rtems_monitor_command_usage(command, argv[arg]); }}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/32e2554f105163017052572a1830f3caa19ba625/mon-command.c/buggy/cpukit/libmisc/monitor/mon-command.c
command = (rtems_monitor_command_entry_t *) command_arg;
command = (rtems_monitor_command_entry_t *) command_arg;
rtems_monitor_help_cmd( int argc, char **argv, unsigned32 command_arg, boolean verbose){ int arg; rtems_monitor_command_entry_t *command; command = (rtems_monitor_command_entry_t *) command_arg; if (argc == 1) rtems_monitor_command_usage(command, 0); else { for (arg=1; argv[arg]; arg++) rtems_monitor_command_usage(command, argv[arg]); }}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/32e2554f105163017052572a1830f3caa19ba625/mon-command.c/buggy/cpukit/libmisc/monitor/mon-command.c
if (argc == 1) rtems_monitor_command_usage(command, 0); else { for (arg=1; argv[arg]; arg++) rtems_monitor_command_usage(command, argv[arg]); }
if (argc == 1) rtems_monitor_command_usage(command, 0); else { for (arg = 1; argv[arg]; arg++) rtems_monitor_command_usage(command, argv[arg]); }
rtems_monitor_help_cmd( int argc, char **argv, unsigned32 command_arg, boolean verbose){ int arg; rtems_monitor_command_entry_t *command; command = (rtems_monitor_command_entry_t *) command_arg; if (argc == 1) rtems_monitor_command_usage(command, 0); else { for (arg=1; argv[arg]; arg++) rtems_monitor_command_usage(command, argv[arg]); }}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/32e2554f105163017052572a1830f3caa19ba625/mon-command.c/buggy/cpukit/libmisc/monitor/mon-command.c
request.argument0 = (unsigned32) type; request.argument1 = (unsigned32) id;
request.argument0 = (uint32_t ) type; request.argument1 = (uint32_t ) id;
rtems_monitor_object_canonical_next_remote( rtems_monitor_object_type_t type, rtems_id id, void *canonical){ rtems_id next_id; rtems_status_code status; rtems_monitor_server_request_t request; rtems_monitor_server_response_t response; /* * Send request */ request.command = RTEMS_MONITOR_SERVER_CANONICAL; request.argument0 = (unsigned32) type; request.argument1 = (unsigned32) id; status = rtems_monitor_server_request(rtems_get_node(id), &request, &response); if (status != RTEMS_SUCCESSFUL) goto failed; /* * process response */ next_id = (rtems_id) response.result0; if (next_id != RTEMS_OBJECT_ID_FINAL) (void) memcpy(canonical, &response.payload, response.result1); return next_id;failed: return RTEMS_OBJECT_ID_FINAL;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3e08d4ee6242f1a0ea4afe9dc0a20800632184fe/mon-object.c/clean/cpukit/libmisc/monitor/mon-object.c
int argc = 0;
int argc = 0;
rtems_monitor_make_argv( char *cp, int *argc_p, char **argv){ int argc = 0; while ((cp = strtok(cp, " \t\n\r"))) { argv[argc++] = cp; cp = (char *) NULL; } argv[argc] = (char *) NULL; /* end of argv */ return *argc_p = argc;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/32e2554f105163017052572a1830f3caa19ba625/mon-command.c/buggy/cpukit/libmisc/monitor/mon-command.c
while ((cp = strtok(cp, " \t\n\r"))) { argv[argc++] = cp; cp = (char *) NULL; } argv[argc] = (char *) NULL; /* end of argv */
while ((cp = strtok(cp, " \t\n\r"))) { argv[argc++] = cp; cp = (char *) NULL; } argv[argc] = (char *) NULL; /* end of argv */
rtems_monitor_make_argv( char *cp, int *argc_p, char **argv){ int argc = 0; while ((cp = strtok(cp, " \t\n\r"))) { argv[argc++] = cp; cp = (char *) NULL; } argv[argc] = (char *) NULL; /* end of argv */ return *argc_p = argc;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/32e2554f105163017052572a1830f3caa19ba625/mon-command.c/buggy/cpukit/libmisc/monitor/mon-command.c
return *argc_p = argc;
return *argc_p = argc;
rtems_monitor_make_argv( char *cp, int *argc_p, char **argv){ int argc = 0; while ((cp = strtok(cp, " \t\n\r"))) { argv[argc++] = cp; cp = (char *) NULL; } argv[argc] = (char *) NULL; /* end of argv */ return *argc_p = argc;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/32e2554f105163017052572a1830f3caa19ba625/mon-command.c/buggy/cpukit/libmisc/monitor/mon-command.c
unsigned32 length = 0;
uint32_t length = 0;
rtems_monitor_extension_dump( rtems_monitor_extension_t *monitor_extension, boolean verbose){ unsigned32 length = 0; length += rtems_monitor_dump_id(monitor_extension->id); length += rtems_monitor_pad(11, length); length += rtems_monitor_dump_name(monitor_extension->name); length += rtems_monitor_pad(18, length); length += printf("create: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose); length += printf("; start: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose); length += printf("; restart: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose); length += printf("\n"); length = 0; length += rtems_monitor_pad(18, length); length += printf("delete: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose); length += printf("; switch: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose); length += printf("; begin: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose); length += printf("\n"); length = 0; length += rtems_monitor_pad(18, length); length += printf("exitted: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose); length += printf("; fatal: "); length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose); length += printf("\n"); length = 0; printf("\n");}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3e08d4ee6242f1a0ea4afe9dc0a20800632184fe/mon-extension.c/buggy/cpukit/libmisc/monitor/mon-extension.c
unsigned32 length = 0;
uint32_t length = 0;
rtems_monitor_dname_dump( rtems_monitor_dname_t *monitor_dname, boolean verbose){ unsigned32 length = 0; length += rtems_monitor_pad(6, length); length += rtems_monitor_dump_hex(monitor_dname->major); length += printf(":"); length += rtems_monitor_dump_hex(monitor_dname->minor); length += rtems_monitor_pad(16, length); length += printf("%.*s", (int) sizeof(monitor_dname->name_string), (char *) monitor_dname->name_string); length += printf("\n"); length = 0;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3e08d4ee6242f1a0ea4afe9dc0a20800632184fe/mon-dname.c/clean/cpukit/libmisc/monitor/mon-dname.c
xmpn_mirror(x,nx); if (x!=y) xmpn_mirror(y,ny);
xmpn_mirror((mp_limb_t *)x,nx); if (x!=y) xmpn_mirror((mp_limb_t *)y,ny);
quickmulii(GEN x, GEN y, long nx, long ny){ GEN z; xmpn_mirror(x,nx); if (x!=y) xmpn_mirror(y,ny); z=muliispec(x, y, nx, ny); xmpn_mirror(LIMBS(z),NLIMBS(z)); xmpn_mirror(x,nx); if (x!=y) xmpn_mirror(y,ny); return z;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/e49ea910f01dbedd25cd9e4e69246b62309876f6/mp.c/buggy/src/kernel/gmp/mp.c
xmpn_mirror(x,nx); if (x!=y) xmpn_mirror(y,ny);
xmpn_mirror((mp_limb_t *)x,nx); if (x!=y) xmpn_mirror((mp_limb_t *)y,ny);
quickmulii(GEN x, GEN y, long nx, long ny){ GEN z; xmpn_mirror(x,nx); if (x!=y) xmpn_mirror(y,ny); z=muliispec(x, y, nx, ny); xmpn_mirror(LIMBS(z),NLIMBS(z)); xmpn_mirror(x,nx); if (x!=y) xmpn_mirror(y,ny); return z;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/e49ea910f01dbedd25cd9e4e69246b62309876f6/mp.c/buggy/src/kernel/gmp/mp.c
rtems_unsigned32 source,
uint32_t source,
rtems_extension Fatal_extension( rtems_unsigned32 source, boolean is_internal, rtems_unsigned32 error){ int index; Error_Happened[ Case_in_switch ] = error; if ( First_Time_Through == 0 ) { Case_in_switch = FATAL_WORKSPACE_OF_ZERO; First_Time_Through = 1; setjmp( Restart_Context ); } else if ( Case_in_switch == FATAL_LAST ) { /* * Depending on the C library we use, we cannot get the * task exitted error so do not check for it. */ puts( "*** TEST FATAL ***" ); for ( index=0 ; index< FATAL_LAST ; index++ ) put_error( Error_Happened[ index ], Expected_Errors[ index ] ); puts( "NOT TESTING FATAL ERROR WHEN TASK EXITS -- C LIBRARY CATCHES THIS" ); puts( "*** END OF TEST FATAL ***" ); /* * returns to the default fatal error handler instead of * calling rtems_shutdown_executive */ return; } else { longjmp( Restart_Context, 1 ); } Process_case();}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/c87608fd821faf8c936d9ac51373186cc2f1f4e9/fatal.c/clean/testsuites/sptests/spfatal/fatal.c
rtems_unsigned32 error
uint32_t error
rtems_extension Fatal_extension( rtems_unsigned32 source, boolean is_internal, rtems_unsigned32 error){ int index; Error_Happened[ Case_in_switch ] = error; if ( First_Time_Through == 0 ) { Case_in_switch = FATAL_WORKSPACE_OF_ZERO; First_Time_Through = 1; setjmp( Restart_Context ); } else if ( Case_in_switch == FATAL_LAST ) { /* * Depending on the C library we use, we cannot get the * task exitted error so do not check for it. */ puts( "*** TEST FATAL ***" ); for ( index=0 ; index< FATAL_LAST ; index++ ) put_error( Error_Happened[ index ], Expected_Errors[ index ] ); puts( "NOT TESTING FATAL ERROR WHEN TASK EXITS -- C LIBRARY CATCHES THIS" ); puts( "*** END OF TEST FATAL ***" ); /* * returns to the default fatal error handler instead of * calling rtems_shutdown_executive */ return; } else { longjmp( Restart_Context, 1 ); } Process_case();}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/c87608fd821faf8c936d9ac51373186cc2f1f4e9/fatal.c/clean/testsuites/sptests/spfatal/fatal.c
unsigned int pvr = (_read_PVR() >> 16) ;
unsigned int pvr = (_read_PVR() >> 16);
SPR_RO(PVR)ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;ppc_cpu_revision_t current_ppc_revision = 0xff;ppc_cpu_id_t get_ppc_cpu_type(){ unsigned int pvr = (_read_PVR() >> 16) ; current_ppc_cpu = (ppc_cpu_id_t) pvr; switch (pvr) { case PPC_601 : case PPC_603 : case PPC_604 : case PPC_603e : case PPC_603ev: case PPC_750 : case PPC_604e : case PPC_604r : case PPC_620 : case PPC_860 : current_ppc_cpu = (ppc_cpu_id_t) pvr; return current_ppc_cpu; default : printk("Unknown PVR value. Please add it to <libcpu/powerpc/shared/cpu.h> \n"); return PPC_UNKNOWN; } }
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/eaedd00a84709a415fb8b6ab4329e0b1ac6a21c8/cpuIdent.c/clean/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
case PPC_601 : case PPC_603 : case PPC_604 : case PPC_603e : case PPC_603ev: case PPC_750 : case PPC_604e : case PPC_604r : case PPC_620 : case PPC_860 : current_ppc_cpu = (ppc_cpu_id_t) pvr; return current_ppc_cpu; default : printk("Unknown PVR value. Please add it to <libcpu/powerpc/shared/cpu.h> \n");
case PPC_601: case PPC_603: case PPC_604: case PPC_603: case PPC_603ev: case PPC_750: case PPC_604e: case PPC_604r: case PPC_620: case PPC_860: current_ppc_cpu = (ppc_cpu_id_t) pvr; return current_ppc_cpu; default: printk("Unknown PVR value of 0x%x. Please add it to <libcpu/powerpc/shared/cpu.h>\n", pvr );
SPR_RO(PVR)ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;ppc_cpu_revision_t current_ppc_revision = 0xff;ppc_cpu_id_t get_ppc_cpu_type(){ unsigned int pvr = (_read_PVR() >> 16) ; current_ppc_cpu = (ppc_cpu_id_t) pvr; switch (pvr) { case PPC_601 : case PPC_603 : case PPC_604 : case PPC_603e : case PPC_603ev: case PPC_750 : case PPC_604e : case PPC_604r : case PPC_620 : case PPC_860 : current_ppc_cpu = (ppc_cpu_id_t) pvr; return current_ppc_cpu; default : printk("Unknown PVR value. Please add it to <libcpu/powerpc/shared/cpu.h> \n"); return PPC_UNKNOWN; } }
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/eaedd00a84709a415fb8b6ab4329e0b1ac6a21c8/cpuIdent.c/clean/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
unsigned32 start, unsigned32 offset, unsigned32 count,
uint32_t start, uint32_t offset, uint32_t count,
_fat_block_write( rtems_filesystem_mount_table_entry_t *mt_entry, unsigned32 start, unsigned32 offset, unsigned32 count, const void *buff){ int rc = RC_OK; fat_fs_info_t *fs_info = mt_entry->fs_info; ssize_t cmpltd = 0; unsigned32 blk = start; unsigned32 ofs = offset; bdbuf_buffer *block = NULL; unsigned32 c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bps) rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_GET, &block); else rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_READ, &block); if (rc != RC_OK) return -1; memcpy((block->buffer + ofs), (buff + cmpltd), c); fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; blk++; ofs = 0; } return cmpltd;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/f91bbe6412aae92765ce43b22f4eef9f516a7289/fat.c/clean/cpukit/libfs/src/dosfs/fat.c
unsigned32 blk = start; unsigned32 ofs = offset;
uint32_t blk = start; uint32_t ofs = offset;
_fat_block_write( rtems_filesystem_mount_table_entry_t *mt_entry, unsigned32 start, unsigned32 offset, unsigned32 count, const void *buff){ int rc = RC_OK; fat_fs_info_t *fs_info = mt_entry->fs_info; ssize_t cmpltd = 0; unsigned32 blk = start; unsigned32 ofs = offset; bdbuf_buffer *block = NULL; unsigned32 c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bps) rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_GET, &block); else rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_READ, &block); if (rc != RC_OK) return -1; memcpy((block->buffer + ofs), (buff + cmpltd), c); fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; blk++; ofs = 0; } return cmpltd;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/f91bbe6412aae92765ce43b22f4eef9f516a7289/fat.c/clean/cpukit/libfs/src/dosfs/fat.c
unsigned32 c = 0;
uint32_t c = 0;
_fat_block_write( rtems_filesystem_mount_table_entry_t *mt_entry, unsigned32 start, unsigned32 offset, unsigned32 count, const void *buff){ int rc = RC_OK; fat_fs_info_t *fs_info = mt_entry->fs_info; ssize_t cmpltd = 0; unsigned32 blk = start; unsigned32 ofs = offset; bdbuf_buffer *block = NULL; unsigned32 c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bps) rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_GET, &block); else rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_READ, &block); if (rc != RC_OK) return -1; memcpy((block->buffer + ofs), (buff + cmpltd), c); fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; blk++; ofs = 0; } return cmpltd;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/f91bbe6412aae92765ce43b22f4eef9f516a7289/fat.c/clean/cpukit/libfs/src/dosfs/fat.c
* Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc().
* Set up mbuf cluster data strutures
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/buggy/c/src/exec/libnetworking/rtems/rtems_glue.c
m_clalloc (nmbclusters, M_DONTWAIT);
p = malloc ((nmbclusters*MCLBYTES)+MCLBYTES-1); p = (char *)(((unsigned long)p + (MCLBYTES-1)) & ~(MCLBYTES-1)); if (p == NULL) rtems_panic ("Can't get network cluster memory."); mbutl = (struct mbuf *)p; for (i = 0; i < nmbclusters; i++) { ((union mcluster *)p)->mcl_next = mclfree; mclfree = (union mcluster *)p; p += MCLBYTES; mbstat.m_clfree++; } mbstat.m_clusters = nmbclusters;
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/buggy/c/src/exec/libnetworking/rtems/rtems_glue.c
rtems_panic ("No memory for mbuf cluster reference counts.");
rtems_panic ("Can't get mbuf cluster reference counts memory.");
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/buggy/c/src/exec/libnetworking/rtems/rtems_glue.c
m_mballoc (nmbuf, M_DONTWAIT);
/* * Set up mbuf data structures */ p = malloc(nmbuf * MSIZE); if (p == NULL) rtems_panic ("Can't get network memory."); for (i = 0; i < nmbuf; i++) { ((struct mbuf *)p)->m_next = mmbfree; mmbfree = (struct mbuf *)p; p += MSIZE; } mbstat.m_mbufs = nmbuf;
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/buggy/c/src/exec/libnetworking/rtems/rtems_glue.c
bsd_init (){ /* * Set up mbuf data strutures * Cluster allocation *must* come first -- see comment on kmem_malloc(). */ m_clalloc (nmbclusters, M_DONTWAIT); mclrefcnt = malloc (nmbclusters); if (mclrefcnt == NULL) rtems_panic ("No memory for mbuf cluster reference counts."); memset (mclrefcnt, '\0', nmbclusters); m_mballoc (nmbuf, M_DONTWAIT); mbstat.m_mtypes[MT_FREE] = nmbuf; /* * Set up domains */ { extern struct domain routedomain; extern struct domain inetdomain; routedomain.dom_next = domains; domains = &routedomain; inetdomain.dom_next = domains; domains = &inetdomain; domaininit (NULL); } /* * Set up interfaces */ ifinit (NULL);}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/rtems_glue.c/buggy/c/src/exec/libnetworking/rtems/rtems_glue.c
fast_idle_extension.task_switch = fast_idle_switch_hook;
fast_idle_extension.thread_switch = fast_idle_switch_hook;
bsp_pretasking_hook(void){ bsp_libc_init();#if SIMHPPA_FAST_IDLE /* * Install the fast idle task switch extension * * on MP systems, might now want to do this; it confuses at least * one test (mp06) */#if 0 if (BSP_Configuration.User_multiprocessing_table == 0)#endif { rtems_extensions_table fast_idle_extension; rtems_id extension_id; rtems_status_code rc; memset(&fast_idle_extension, 0, sizeof(fast_idle_extension)); fast_idle_extension.task_switch = fast_idle_switch_hook; rc = rtems_extension_create(rtems_build_name('F', 'D', 'L', 'E'), &fast_idle_extension, &extension_id); if (rc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred(rc); }#endif#ifdef STACK_CHECKER_ON /* * Initialize the stack bounds checker * We can either turn it on here or from the app. */ Stack_check_Initialize();#endif}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3652ad356bf13abe0963c992cbbda96476d31609/bspstart.c/buggy/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
case PPC_603le: return "MPC603le";
SPR_RO(PVR)ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;ppc_cpu_revision_t current_ppc_revision = 0xff;char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu){ switch (cpu) { case PPC_601: return "MPC601"; case PPC_5XX: return "MPC5XX"; case PPC_603: return "MPC603"; case PPC_603ev: return "MPC603ev"; case PPC_604: return "MPC604"; case PPC_750: return "MPC750"; case PPC_7400: return "MPC7400"; case PPC_7455: return "MPC7455"; case PPC_604e: return "MPC604e"; case PPC_604r: return "MPC604r"; case PPC_620: return "MPC620"; case PPC_860: return "MPC860"; case PPC_8260: return "MPC8260"; case PPC_8245: return "MPC8245"; default: printk("Unknown CPU value of 0x%x. Please add it to " "<libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu ); } return "UNKNOWN";}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/56c4caeca69e71a42370d1171428a9091bdb6e77/cpuIdent.c/buggy/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
(unsigned long *)&make_private_module_public);
(void*)&make_private_module_public);
void *dlopen(const char *path, int mode){ void *module = 0; NSObjectFileImage ofi = 0; NSObjectFileImageReturnCode ofirc; static int (*make_private_module_public) (NSModule module) = 0; unsigned int flags = NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE; /* If we got no path, the app wants the global namespace, use -1 as the marker in this case */ if (!path) return (void *)-1; /* Create the object file image, works for things linked with the -bundle arg to ld */ ofirc = NSCreateObjectFileImageFromFile(path, &ofi); switch (ofirc) { case NSObjectFileImageSuccess: /* It was okay, so use NSLinkModule to link in the image */ if (!(mode & RTLD_LAZY)) flags += NSLINKMODULE_OPTION_BINDNOW; module = NSLinkModule(ofi, path,flags); /* Don't forget to destroy the object file image, unless you like leaks */ NSDestroyObjectFileImage(ofi); /* If the mode was global, then change the module, this avoids multiply defined symbol errors to first load private then make global. Silly, isn't it. */ if ((mode & RTLD_GLOBAL)) { if (!make_private_module_public) { _dyld_func_lookup("__dyld_NSMakePrivateModulePublic", (unsigned long *)&make_private_module_public); } make_private_module_public(module); } break; case NSObjectFileImageInappropriateFile: /* It may have been a dynamic library rather than a bundle, try to load it */ module = (void *)NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR); break; case NSObjectFileImageFailure: error(0,"Object file setup failure : \"%s\"", path); return 0; case NSObjectFileImageArch: error(0,"No object for this architecture : \"%s\"", path); return 0; case NSObjectFileImageFormat: error(0,"Bad object file format : \"%s\"", path); return 0; case NSObjectFileImageAccess: error(0,"Can't read object file : \"%s\"", path); return 0; } if (!module) error(0, "Can not open \"%s\"", path); return module;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/05ee266beabfe76897c853850e9516540f63d852/darwin.c/buggy/src/systems/darwin/darwin.c
make_private_module_public(module);
make_private_module_public((NSModule)module);
void *dlopen(const char *path, int mode){ void *module = 0; NSObjectFileImage ofi = 0; NSObjectFileImageReturnCode ofirc; static int (*make_private_module_public) (NSModule module) = 0; unsigned int flags = NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE; /* If we got no path, the app wants the global namespace, use -1 as the marker in this case */ if (!path) return (void *)-1; /* Create the object file image, works for things linked with the -bundle arg to ld */ ofirc = NSCreateObjectFileImageFromFile(path, &ofi); switch (ofirc) { case NSObjectFileImageSuccess: /* It was okay, so use NSLinkModule to link in the image */ if (!(mode & RTLD_LAZY)) flags += NSLINKMODULE_OPTION_BINDNOW; module = NSLinkModule(ofi, path,flags); /* Don't forget to destroy the object file image, unless you like leaks */ NSDestroyObjectFileImage(ofi); /* If the mode was global, then change the module, this avoids multiply defined symbol errors to first load private then make global. Silly, isn't it. */ if ((mode & RTLD_GLOBAL)) { if (!make_private_module_public) { _dyld_func_lookup("__dyld_NSMakePrivateModulePublic", (unsigned long *)&make_private_module_public); } make_private_module_public(module); } break; case NSObjectFileImageInappropriateFile: /* It may have been a dynamic library rather than a bundle, try to load it */ module = (void *)NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR); break; case NSObjectFileImageFailure: error(0,"Object file setup failure : \"%s\"", path); return 0; case NSObjectFileImageArch: error(0,"No object for this architecture : \"%s\"", path); return 0; case NSObjectFileImageFormat: error(0,"Bad object file format : \"%s\"", path); return 0; case NSObjectFileImageAccess: error(0,"Can't read object file : \"%s\"", path); return 0; } if (!module) error(0, "Can not open \"%s\"", path); return module;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/05ee266beabfe76897c853850e9516540f63d852/darwin.c/buggy/src/systems/darwin/darwin.c
long lx,ly,lz,dx,dy,av,tetpil,i,j;
ulong av = avma; long lx,ly,lz,dx,dy,i,j;
dirdiv(GEN x, GEN y){ long lx,ly,lz,dx,dy,av,tetpil,i,j; GEN z,p1; if (typ(x)!=t_VEC || typ(y)!=t_VEC) err(talker,"not a dirseries in dirmul"); av=avma; dx=dirval(x); dy=dirval(y); lx=lg(x); ly=lg(y); if (dy!=1) err(talker,"not an invertible dirseries in dirdiv"); lz=min(lx,ly*dx); p1=(GEN)y[1]; if (!gcmp1(p1)) { y=gdiv(y,p1); x=gdiv(x,p1); } else x=gcopy(x); z=cgetg(lz,t_VEC); for (i=1; i<dx; i++) z[i]=zero; for (j=dx; j<lz; j++) { p1=(GEN)x[j]; z[j]=(long)p1; if (!gcmp0(p1)) { if (gcmp1(p1)) for (i=j+j; i<lz; i+=j) x[i]=lsub((GEN)x[i],(GEN)y[i/j]); else { if (gcmp_1(p1)) for (i=j+j; i<lz; i+=j) x[i]=ladd((GEN)x[i],(GEN)y[i/j]); else for (i=j+j; i<lz; i+=j) x[i]=lsub((GEN)x[i],gmul(p1,(GEN)y[i/j])); } } } tetpil=avma; return gerepile(av,tetpil,gcopy(z));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/bibli2.c/buggy/src/basemath/bibli2.c
av=avma; dx=dirval(x); dy=dirval(y); lx=lg(x); ly=lg(y);
dx=dirval(x); dy=dirval(y); lx=lg(x); ly=lg(y);
dirdiv(GEN x, GEN y){ long lx,ly,lz,dx,dy,av,tetpil,i,j; GEN z,p1; if (typ(x)!=t_VEC || typ(y)!=t_VEC) err(talker,"not a dirseries in dirmul"); av=avma; dx=dirval(x); dy=dirval(y); lx=lg(x); ly=lg(y); if (dy!=1) err(talker,"not an invertible dirseries in dirdiv"); lz=min(lx,ly*dx); p1=(GEN)y[1]; if (!gcmp1(p1)) { y=gdiv(y,p1); x=gdiv(x,p1); } else x=gcopy(x); z=cgetg(lz,t_VEC); for (i=1; i<dx; i++) z[i]=zero; for (j=dx; j<lz; j++) { p1=(GEN)x[j]; z[j]=(long)p1; if (!gcmp0(p1)) { if (gcmp1(p1)) for (i=j+j; i<lz; i+=j) x[i]=lsub((GEN)x[i],(GEN)y[i/j]); else { if (gcmp_1(p1)) for (i=j+j; i<lz; i+=j) x[i]=ladd((GEN)x[i],(GEN)y[i/j]); else for (i=j+j; i<lz; i+=j) x[i]=lsub((GEN)x[i],gmul(p1,(GEN)y[i/j])); } } } tetpil=avma; return gerepile(av,tetpil,gcopy(z));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/bibli2.c/buggy/src/basemath/bibli2.c
tetpil=avma; return gerepile(av,tetpil,gcopy(z));
return gerepilecopy(av,z);
dirdiv(GEN x, GEN y){ long lx,ly,lz,dx,dy,av,tetpil,i,j; GEN z,p1; if (typ(x)!=t_VEC || typ(y)!=t_VEC) err(talker,"not a dirseries in dirmul"); av=avma; dx=dirval(x); dy=dirval(y); lx=lg(x); ly=lg(y); if (dy!=1) err(talker,"not an invertible dirseries in dirdiv"); lz=min(lx,ly*dx); p1=(GEN)y[1]; if (!gcmp1(p1)) { y=gdiv(y,p1); x=gdiv(x,p1); } else x=gcopy(x); z=cgetg(lz,t_VEC); for (i=1; i<dx; i++) z[i]=zero; for (j=dx; j<lz; j++) { p1=(GEN)x[j]; z[j]=(long)p1; if (!gcmp0(p1)) { if (gcmp1(p1)) for (i=j+j; i<lz; i+=j) x[i]=lsub((GEN)x[i],(GEN)y[i/j]); else { if (gcmp_1(p1)) for (i=j+j; i<lz; i+=j) x[i]=ladd((GEN)x[i],(GEN)y[i/j]); else for (i=j+j; i<lz; i+=j) x[i]=lsub((GEN)x[i],gmul(p1,(GEN)y[i/j])); } } } tetpil=avma; return gerepile(av,tetpil,gcopy(z));}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/bibli2.c/buggy/src/basemath/bibli2.c
if (typ(nmax)!=t_INT || signe(nmax) < 0) err(talker,"bad number of components in vector");
if (typ(nmax) != t_INT) err(typeer,"vector");
vecteur(GEN nmax, entree *ep, char *ch){ GEN y,p1; long i,m; long c[]={evaltyp(t_INT)|_evallg(3), evalsigne(1)|evallgefint(3), 0}; if (typ(nmax)!=t_INT || signe(nmax) < 0) err(talker,"bad number of components in vector"); m = itos(nmax); if (!ep || !ch) return zerovec(m); y = cgetg(m+1,t_VEC); push_val(ep, c); for (i=1; i<=m; i++) { c[2] = i; p1 = lisseq_nobreak(ch); y[i] = isonstack(p1)? (long)p1 : (long)forcecopy(p1); } pop_val(ep); return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/a359ce125544e6952961f755ac643cf90ca1ccb7/sumiter.c/buggy/src/language/sumiter.c
if (m < 0) err(talker,"negative number of components in vector");
vecteur(GEN nmax, entree *ep, char *ch){ GEN y,p1; long i,m; long c[]={evaltyp(t_INT)|_evallg(3), evalsigne(1)|evallgefint(3), 0}; if (typ(nmax)!=t_INT || signe(nmax) < 0) err(talker,"bad number of components in vector"); m = itos(nmax); if (!ep || !ch) return zerovec(m); y = cgetg(m+1,t_VEC); push_val(ep, c); for (i=1; i<=m; i++) { c[2] = i; p1 = lisseq_nobreak(ch); y[i] = isonstack(p1)? (long)p1 : (long)forcecopy(p1); } pop_val(ep); return y;}
2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/a359ce125544e6952961f755ac643cf90ca1ccb7/sumiter.c/buggy/src/language/sumiter.c
fs_info->ino_count = 1; fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers;
fs_info->ino_count = 1; fs_info->linearfile_handlers = linearfile_handlers; fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers;
int IMFS_initialize_support( rtems_filesystem_mount_table_entry_t *temp_mt_entry, rtems_filesystem_operations_table *op_table, rtems_filesystem_file_handlers_r *memfile_handlers, rtems_filesystem_file_handlers_r *directory_handlers){ IMFS_fs_info_t *fs_info; IMFS_jnode_t *jnode; /* * Create the root node */ temp_mt_entry->mt_fs_root.node_access = IMFS_create_node( NULL, IMFS_DIRECTORY, "", ( S_IFDIR | S_IRWXO | S_IRWXG| S_IRWXU ), NULL ); temp_mt_entry->mt_fs_root.handlers = directory_handlers; temp_mt_entry->mt_fs_root.ops = op_table; temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); if ( !fs_info ){ free(temp_mt_entry->mt_fs_root.node_access); return 1; } temp_mt_entry->fs_info = fs_info; /* * Set st_ino for the root to 1. */ fs_info->ino_count = 1; fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers; jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; return 0;}
10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/0ef748fb45137bac811ded19dfad2034f924505a/imfs_initsupp.c/buggy/c/src/libfs/src/imfs/imfs_initsupp.c