rem
stringlengths 0
83.5k
| add
stringlengths 0
223k
| context
stringlengths 10
471k
| meta
stringlengths 120
236
|
---|---|---|---|
if (DEBUGLEVEL>3) {fprintferr(" K%ld",k);flusherr();} | if (DEBUGLEVEL>3) {fprintferr("K%ld ",k);flusherr();} | lllfp_marked(int MARKED, GEN x, long D, long flag, long prec, int gram){ GEN xinit,L,h,B,L1,delta, Q, H = NULL; long retry = 2, lx = lg(x), hx, l, i, j, k, k1, n, kmax, KMAX; pari_sp av0 = avma, av, lim; int isexact, exact_can_leave, count, count_max = 8; const int in_place = (flag == 3); if (typ(x) != t_MAT) err(typeer,"lllfp"); n = lx-1; if (n <= 1) return idmat(n);#if 0 /* doesn't work yet */ return lll_scaled(MARKED, x, D);#endif hx = lg(x[1]); if (hx != lx) { if (gram) err(mattype1,"lllfp"); if (lx > hx) err(talker,"dependant vectors in lllfp"); } delta = divrs(stor(D-1, DEFAULTPREC), D); xinit = x; av = avma; lim = stack_lim(av,1); if (gram) { for (k=2,j=1; j<lx; j++) { GEN p1=(GEN)x[j]; for (i=1; i<=j; i++) if (typ(p1[i]) == t_REAL) { l = lg(p1[i]); if (l>k) k=l; } } } else { for (k=2,j=1; j<lx; j++) { GEN p1=(GEN)x[j]; for (i=1; i<hx; i++) if (typ(p1[i]) == t_REAL) { l = lg(p1[i]); if (l>k) k=l; } } } if (k == 2) { if (!prec) return lllint_marked(MARKED, x, D, gram, &h, NULL, NULL); x = mat_to_MP(x, prec); isexact = 1; } else { if (prec < k) prec = k; x = mat_to_mp(x, prec+1); isexact = 0; } /* kmax = maximum column index attained during this run * KMAX = same over all runs (after PRECPB) */ kmax = KMAX = 1; h = idmat(n);#ifdef LONG_IS_64BIT# define PREC_THRESHOLD 32# define PREC_DEC_THRESHOLD 7#else# define PREC_THRESHOLD 62# define PREC_DEC_THRESHOLD 12#endifPRECPB: switch(retry--) { case 2: break; /* entry */ case 1: if (DEBUGLEVEL>3) fprintferr("\n"); if (flag == 2) return _vec(h); if (isexact || (gram && kmax > 2)) { /* some progress but precision loss, try again */ if (prec < PREC_THRESHOLD) prec = (prec<<1)-2; else prec = (long)((prec-2) * 1.25 + 2); if (DEBUGLEVEL) err(warnprec,"lllfp",prec); if (isexact) { if (!in_place) H = H? gmul(H, h): h; xinit = gram? qf_base_change(xinit, h, 1): gmul(xinit, h); gerepileall(av, in_place? 1: 2, &xinit, &H); x = mat_to_MP(xinit, prec); h = idmat(n); retry = 1; /* never abort if x is exact */ count_max = min(count_max << 1, 512); if (DEBUGLEVEL>3) fprintferr("count_max = %ld\n", count_max); } else { x = gprec_w(xinit,prec); x = gram? qf_base_change(x, h, 1): gmul(x, h); gerepileall(av, 2, &h, &x); } kmax = 1; break; } /* fall through */ case 0: /* give up */ if (DEBUGLEVEL>3) fprintferr("\n"); if (DEBUGLEVEL) err(warner,"lllfp giving up"); if (flag) { avma=av; return NULL; } err(lllger3); } exact_can_leave = 1; count = 0; Q = zerovec(n); L = cgetg(lx,t_MAT); B = cgetg(lx,t_COL); for (j=1; j<lx; j++) { L[j] = (long)zerocol(n); B[j] = zero; } if (gram && !incrementalGS(x, L, B, 1)) { if (flag) return NULL; err(lllger3); } if (DEBUGLEVEL>5) fprintferr("k ="); for(k=2;;) { if (k > kmax) { kmax = k; if (KMAX < kmax) { KMAX = kmax; count_max = 8; } if (DEBUGLEVEL>3) {fprintferr(" K%ld",k);flusherr();} if (gram) j = incrementalGS(x, L, B, k); else j = Householder_get_mu(x, L, B, k, Q, prec); if (!j) goto PRECPB; count = 0; } else if (isexact && prec > PREC_DEC_THRESHOLD && k == kmax-1 && ++count > count_max) { /* try to reduce precision */ count = 0; prec = (prec+2) >> 1; if (DEBUGLEVEL>3) fprintferr("\n...LLL reducing precision to %ld\n",prec); if (!in_place) H = H? gmul(H, h): h; xinit = gram? qf_base_change(xinit, h, 1): gmul(xinit, h); gerepileall(av, in_place? 4: 5,&B,&L,&Q,&xinit, &H); x = mat_to_MP(xinit, prec); h = idmat(n); } else if (DEBUGLEVEL>5) fprintferr(" %ld",k); L1 = gcoeff(L,k,k-1); if (typ(L1) == t_REAL && expo(L1) + 20 > bit_accuracy(lg(L1))) { if (!gram) goto PRECPB; if (DEBUGLEVEL>3) fprintferr("\nRecomputing Gram-Schmidt, kmax = %ld\n", kmax); for (k1=1; k1<=kmax; k1++) if (!incrementalGS(x, L, B, k1)) goto PRECPB; } if (k != MARKED) { if (!gram) j = RED(k,k-1, x,h,L,KMAX); else j = RED_gram(k,k-1, x,h,L,KMAX); if (!j) goto PRECPB; } if (do_SWAP(x,h,L,B,kmax,k,delta,gram)) { if (MARKED == k) MARKED = k-1; else if (MARKED == k-1) MARKED = k; if (!B[k]) goto PRECPB; Q[k] = Q[k-1] = zero; exact_can_leave = 0; if (k>2) k--; } else { if (k != MARKED) for (l=k-2; l; l--) { if (!gram) j = RED(k,l, x,h,L,KMAX); else j = RED_gram(k,l, x,h,L,KMAX); if (!j) goto PRECPB; if (low_stack(lim, stack_lim(av,1))) { if(DEBUGMEM>1) err(warnmem,"lllfp[1], kmax = %ld", kmax); gerepileall(av, H? 7: 6, &B,&L,&h,&x,&Q,&xinit, &H); } } if (++k > n) { if (isexact) { if (exact_can_leave) { if (H) h = H; break; } if (DEBUGLEVEL>3) fprintferr("\nChecking LLL basis..."); if (!in_place) H = H? gmul(H, h): h; xinit = gram? qf_base_change(xinit, h, 1): gmul(xinit, h); prec = good_prec(xinit, kmax); if (DEBUGLEVEL>3) fprintferr("in precision %ld\n", prec); x = mat_to_MP(xinit, prec); h = idmat(n); exact_can_leave = 1; k = 2; kmax = 1; continue; } else if (!gram && Q[n-1] == zero) { if (DEBUGLEVEL>3) fprintferr("\nChecking LLL basis\n"); j = Householder_get_mu(gmul(xinit,h), L, B, n, Q, prec); if (!j) goto PRECPB; k = 2; continue; } break; } } if (low_stack(lim, stack_lim(av,1))) { if(DEBUGMEM>1) err(warnmem,"lllfp[2], kmax = %ld", kmax); gerepileall(av, H? 7: 6, &B,&L,&h,&x,&Q,&xinit, &H); } } if (in_place) h = gmul(xinit, h); if (DEBUGLEVEL>3) fprintferr("\n"); if (MARKED && MARKED != 1) swap(h[1], h[MARKED]); return gerepilecopy(av0, h);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/3ad1684e67032d383e793ff064ab7faa379f9ec3/bibli1.c/clean/src/basemath/bibli1.c |
p1 = ggcd(x1, y2); if (!gcmp1(p1)) { x1 = gdiv(x1,p1); y2 = gdiv(y2,p1); } p1 = ggcd(x2, y1); if (!gcmp1(p1)) { x2 = gdiv(x2,p1); y1 = gdiv(y1,p1); } | p1 = ggcd(x1, y2); if (!gcmp1(p1)) { x1 = gdeuc(x1,p1); y2 = gdeuc(y2,p1); } p1 = ggcd(x2, y1); if (!gcmp1(p1)) { x2 = gdeuc(x2,p1); y1 = gdeuc(y1,p1); } | mul_rfrac(GEN x1, GEN x2, GEN y1, GEN y2){ GEN z = cgetg(3,t_RFRAC), p1; pari_sp tetpil; p1 = ggcd(x1, y2); if (!gcmp1(p1)) { x1 = gdiv(x1,p1); y2 = gdiv(y2,p1); } p1 = ggcd(x2, y1); if (!gcmp1(p1)) { x2 = gdiv(x2,p1); y1 = gdiv(y1,p1); } tetpil = avma; gel(z,2) = gmul(x2,y2); gel(z,1) = gmul(x1,y1); p1 = fix_rfrac_if_pol(gel(z,1),gel(z,2)); if (p1) return gerepileupto((pari_sp)(z+3), p1); gerepilecoeffssp((pari_sp)z,tetpil,z+1,2); return z;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/ad2ccef0820f736818bd56d5e00b007cd62258fe/gen1.c/buggy/src/basemath/gen1.c |
shiftpol_i(GEN x, long v) | shiftpol_i(GEN x, long vx) | shiftpol_i(GEN x, long v){ long i, lz; GEN z; if (!v) return x; lz = lg(x)-v; z = cgetg(lz, t_POL); z[1] = x[1]; x += v; for (i=2; i<lz; i++) z[i] = x[i]; return z;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/gen2.c/buggy/src/basemath/gen2.c |
if (!v) return x; lz = lg(x)-v; | if (!vx) return x; lz = lg(x)-vx; | shiftpol_i(GEN x, long v){ long i, lz; GEN z; if (!v) return x; lz = lg(x)-v; z = cgetg(lz, t_POL); z[1] = x[1]; x += v; for (i=2; i<lz; i++) z[i] = x[i]; return z;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/gen2.c/buggy/src/basemath/gen2.c |
x += v; | x += vx; | shiftpol_i(GEN x, long v){ long i, lz; GEN z; if (!v) return x; lz = lg(x)-v; z = cgetg(lz, t_POL); z[1] = x[1]; x += v; for (i=2; i<lz; i++) z[i] = x[i]; return z;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/gen2.c/buggy/src/basemath/gen2.c |
if (DEBUGLEVEL) timer(); N1 = modii(N, et); | N1 = resii(N, et); | step6(GEN N, ulong t, GEN et){ GEN N1,r,p1; ulong i,av; if (DEBUGLEVEL) timer(); N1 = modii(N, et); r = gun; av = avma; for (i=1; i<t; i++) { avma = av; r = modii(mulii(r,N1), et); if (!signe(modii(N,r)) && !gcmp1(r) && !egalii(r,N)) { p1 = cgetg(3,t_VEC); p1[1] = (long)r; p1[2] = zero; return p1; } } if (DEBUGLEVEL) sgt6=timer(); return gun;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
avma = av; r = modii(mulii(r,N1), et); if (!signe(modii(N,r)) && !gcmp1(r) && !egalii(r,N)) | r = resii(mulii(r,N1), et); if (!signe(resii(N,r)) && !gcmp1(r) && !egalii(r,N)) | step6(GEN N, ulong t, GEN et){ GEN N1,r,p1; ulong i,av; if (DEBUGLEVEL) timer(); N1 = modii(N, et); r = gun; av = avma; for (i=1; i<t; i++) { avma = av; r = modii(mulii(r,N1), et); if (!signe(modii(N,r)) && !gcmp1(r) && !egalii(r,N)) { p1 = cgetg(3,t_VEC); p1[1] = (long)r; p1[2] = zero; return p1; } } if (DEBUGLEVEL) sgt6=timer(); return gun;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
if (DEBUGLEVEL) sgt6=timer(); | step6(GEN N, ulong t, GEN et){ GEN N1,r,p1; ulong i,av; if (DEBUGLEVEL) timer(); N1 = modii(N, et); r = gun; av = avma; for (i=1; i<t; i++) { avma = av; r = modii(mulii(r,N1), et); if (!signe(modii(N,r)) && !gcmp1(r) && !egalii(r,N)) { p1 = cgetg(3,t_VEC); p1[1] = (long)r; p1[2] = zero; return p1; } } if (DEBUGLEVEL) sgt6=timer(); return gun;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
|
int i, j; | int i, j, n = lg(L); | matrixbase2(GEN L, GEN T, GEN den){ ulong ltop = avma, lbot; int i, j; long x = varn(T); GEN M, P, Tp; if (DEBUGLEVEL >= 1) timer2(); M = cgetg(lg(L), t_MAT); Tp = deriv(T, x); for (i = 1; i < lg(L); i++) { M[i] = lgetg(lg(L), t_COL); P = gdiv(gdivround(T, gsub(polx[x], (GEN) L[i])), gsubst(Tp, x, (GEN) L[i])); for (j = 1; j < lg(L); j++) ((GEN *) M)[i][j] = P[1 + j]; } if (DEBUGLEVEL >= 1) msgtimer("matrixbase2"); lbot = avma; M = gmul(den, M); return gerepile(ltop, lbot, M);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/f55e360df08ebbc9b4d9b945e47ba627876265ee/galconj.c/buggy/src/basemath/galconj.c |
M = cgetg(lg(L), t_MAT); | M = cgetg(n, t_MAT); | matrixbase2(GEN L, GEN T, GEN den){ ulong ltop = avma, lbot; int i, j; long x = varn(T); GEN M, P, Tp; if (DEBUGLEVEL >= 1) timer2(); M = cgetg(lg(L), t_MAT); Tp = deriv(T, x); for (i = 1; i < lg(L); i++) { M[i] = lgetg(lg(L), t_COL); P = gdiv(gdivround(T, gsub(polx[x], (GEN) L[i])), gsubst(Tp, x, (GEN) L[i])); for (j = 1; j < lg(L); j++) ((GEN *) M)[i][j] = P[1 + j]; } if (DEBUGLEVEL >= 1) msgtimer("matrixbase2"); lbot = avma; M = gmul(den, M); return gerepile(ltop, lbot, M);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/f55e360df08ebbc9b4d9b945e47ba627876265ee/galconj.c/buggy/src/basemath/galconj.c |
for (i = 1; i < lg(L); i++) | for (i = 1; i < n; i++) | matrixbase2(GEN L, GEN T, GEN den){ ulong ltop = avma, lbot; int i, j; long x = varn(T); GEN M, P, Tp; if (DEBUGLEVEL >= 1) timer2(); M = cgetg(lg(L), t_MAT); Tp = deriv(T, x); for (i = 1; i < lg(L); i++) { M[i] = lgetg(lg(L), t_COL); P = gdiv(gdivround(T, gsub(polx[x], (GEN) L[i])), gsubst(Tp, x, (GEN) L[i])); for (j = 1; j < lg(L); j++) ((GEN *) M)[i][j] = P[1 + j]; } if (DEBUGLEVEL >= 1) msgtimer("matrixbase2"); lbot = avma; M = gmul(den, M); return gerepile(ltop, lbot, M);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/f55e360df08ebbc9b4d9b945e47ba627876265ee/galconj.c/buggy/src/basemath/galconj.c |
M[i] = lgetg(lg(L), t_COL); P = gdiv(gdivround(T, gsub(polx[x], (GEN) L[i])), gsubst(Tp, x, (GEN) L[i])); for (j = 1; j < lg(L); j++) | M[i] = lgetg(n, t_COL); P = gdiv(gdeuc(T, gsub(polx[x], (GEN)L[i])), gsubst(Tp, x, (GEN) L[i])); for (j = 1; j < n; j++) | matrixbase2(GEN L, GEN T, GEN den){ ulong ltop = avma, lbot; int i, j; long x = varn(T); GEN M, P, Tp; if (DEBUGLEVEL >= 1) timer2(); M = cgetg(lg(L), t_MAT); Tp = deriv(T, x); for (i = 1; i < lg(L); i++) { M[i] = lgetg(lg(L), t_COL); P = gdiv(gdivround(T, gsub(polx[x], (GEN) L[i])), gsubst(Tp, x, (GEN) L[i])); for (j = 1; j < lg(L); j++) ((GEN *) M)[i][j] = P[1 + j]; } if (DEBUGLEVEL >= 1) msgtimer("matrixbase2"); lbot = avma; M = gmul(den, M); return gerepile(ltop, lbot, M);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/f55e360df08ebbc9b4d9b945e47ba627876265ee/galconj.c/buggy/src/basemath/galconj.c |
buchinitfu(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,prec); } | buchinitfu(B_ARGS) { return B_CALL(nf_INIT|nf_UNITS); } | buchinitfu(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,prec);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/4fedb725a485039bb8dc1210c2d85733501b6a04/compat.c/clean/src/language/compat.c |
unsigned32 key1, unsigned32 key2, | uint32_t key1, uint32_t key2, | _hash_search( rtems_filesystem_mount_table_entry_t *mt_entry, Chain_Control *hash, unsigned32 key1, unsigned32 key2, fat_file_fd_t **ret ){ unsigned32 mod = (key1) % FAT_HASH_MODULE; Chain_Node *the_node = ((Chain_Control *)((hash) + mod))->first; for ( ; !_Chain_Is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; unsigned32 ck = fat_construct_key(mt_entry, ffd->info_cln, ffd->info_ofs); if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; } } the_node = the_node->next; } return -1; } | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/f91bbe6412aae92765ce43b22f4eef9f516a7289/fat_file.c/buggy/cpukit/libfs/src/dosfs/fat_file.c |
unsigned32 mod = (key1) % FAT_HASH_MODULE; | uint32_t mod = (key1) % FAT_HASH_MODULE; | _hash_search( rtems_filesystem_mount_table_entry_t *mt_entry, Chain_Control *hash, unsigned32 key1, unsigned32 key2, fat_file_fd_t **ret ){ unsigned32 mod = (key1) % FAT_HASH_MODULE; Chain_Node *the_node = ((Chain_Control *)((hash) + mod))->first; for ( ; !_Chain_Is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; unsigned32 ck = fat_construct_key(mt_entry, ffd->info_cln, ffd->info_ofs); if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; } } the_node = the_node->next; } return -1; } | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/f91bbe6412aae92765ce43b22f4eef9f516a7289/fat_file.c/buggy/cpukit/libfs/src/dosfs/fat_file.c |
unsigned32 ck = | uint32_t ck = | _hash_search( rtems_filesystem_mount_table_entry_t *mt_entry, Chain_Control *hash, unsigned32 key1, unsigned32 key2, fat_file_fd_t **ret ){ unsigned32 mod = (key1) % FAT_HASH_MODULE; Chain_Node *the_node = ((Chain_Control *)((hash) + mod))->first; for ( ; !_Chain_Is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; unsigned32 ck = fat_construct_key(mt_entry, ffd->info_cln, ffd->info_ofs); if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; } } the_node = the_node->next; } return -1; } | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/f91bbe6412aae92765ce43b22f4eef9f516a7289/fat_file.c/buggy/cpukit/libfs/src/dosfs/fat_file.c |
u1 = reducemodHNF(U, h, NULL); | u1 = reducemodHNF(u1, h, NULL); | buchrayall(GEN bnf,GEN module,long flag){ GEN nf,cyc,gen,genplus,fa2,sarch,hmatu,u,clg,logs; GEN dataunit,p1,p2,h,genray,met,u1,u2,U,cycgen; GEN racunit,bigres,bid,cycbid,genbid,x,y,funits,hmat,vecel; long RU,Ri,i,j,ngen,lh,lo,c,av=avma; bnf = checkbnf(bnf); nf = checknf(bnf); funits = check_units(bnf, "buchrayall"); RU = lg(funits); vecel = genplus = NULL; /* gcc -Wall */ bigres = (GEN)bnf[8]; cyc = gmael(bigres,1,2); gen = gmael(bigres,1,3); ngen = lg(cyc)-1; bid = zidealstarinitall(nf,module,1); cycbid = gmael(bid,2,2); genbid = gmael(bid,2,3); Ri = lg(cycbid)-1; lh = ngen+Ri; x = idealhermite(nf,module); if (Ri || flag & (nf_INIT|nf_GEN)) { vecel = cgetg(ngen+1,t_VEC); for (j=1; j<=ngen; j++) { p1 = idealcoprime(nf,(GEN)gen[j],x); if (isnfscalar(p1)) p1 = (GEN)p1[1]; vecel[j]=(long)p1; } } if (flag & nf_GEN) { genplus = cgetg(lh+1,t_VEC); for (j=1; j<=ngen; j++) genplus[j] = (long) idealmul(nf,(GEN)vecel[j],(GEN)gen[j]); for ( ; j<=lh; j++) genplus[j] = genbid[j-ngen]; } if (!Ri) { if (!(flag & nf_GEN)) clg = cgetg(3,t_VEC); else { clg = cgetg(4,t_VEC); clg[3] = (long)genplus; } clg[1] = mael(bigres,1,1); clg[2] = (long)cyc; if (!(flag & nf_INIT)) return gerepilecopy(av,clg); y = cgetg(7,t_VEC); y[1] = lcopy(bnf); y[2] = lcopy(bid); y[3] = lcopy(vecel); y[4] = (long)idmat(ngen); y[5] = lcopy(clg); u = cgetg(3,t_VEC); y[6] = (long)u; u[1] = lgetg(1,t_MAT); u[2] = (long)idmat(RU); return gerepileupto(av,y); } fa2 = (GEN)bid[4]; sarch = (GEN)fa2[lg(fa2)-1]; cycgen = check_and_build_cycgen(bnf); dataunit = cgetg(RU+1,t_MAT); racunit = gmael(bigres,4,2); dataunit[1] = (long)zideallog(nf,racunit,bid); for (j=2; j<=RU; j++) dataunit[j] = (long)zideallog(nf,(GEN)funits[j-1],bid); dataunit = concatsp(dataunit, diagonal(cycbid)); hmatu = hnfall(dataunit); hmat = (GEN)hmatu[1]; logs = cgetg(ngen+1, t_MAT); /* FIXME: cycgen[j] is not necessarily coprime to bid, but it is made coprime * in zideallog using canonical uniformizers [from bid data]: no need to * correct it here. The same ones will be used in isprincipalrayall. Hence * modification by vecel is useless. */ for (j=1; j<=ngen; j++) { p1 = (GEN)cycgen[j]; if (typ(vecel[j]) != t_INT) /* <==> != 1 */ p1 = arch_mul(to_famat_all((GEN)vecel[j], (GEN)cyc[j]), p1); logs[j] = (long)zideallog(nf,p1,bid); /* = log(genplus[j]) */ } /* [ cyc 0 ] * [-logs hmat] = relation matrix for Cl_f */ h = concatsp( vconcat(diagonal(cyc), gneg_i(logs)), vconcat(zeromat(ngen, Ri), hmat) ); h = hnf(h); met = smithall(h, &U, NULL); /* cf smithrel */ lo = lg(met)-1; for (c=1; c<=lo; c++) if (gcmp1(gcoeff(met,c,c))) break; setlg(met,c); if (flag & nf_GEN) { GEN Id = idmat(degpol(nf[1])), arch = (GEN)module[2]; u1 = ginv(U); setlg(u1,c); u1 = reducemodHNF(U, h, NULL); genray = cgetg(c,t_VEC); for (j=1; j<c; j++) { GEN *op, minus = Id, plus = Id; long av1 = avma, s; for (i=1; i<=lo; i++) { p1 = gcoeff(u1,i,j); if (!(s = signe(p1))) continue; if (s > 0) op = + else { op = − p1 = negi(p1); } p1 = idealpowmodidele(nf,(GEN)genplus[i],p1,x,sarch,arch); *op = *op==Id? p1 : idealmulmodidele(nf,*op,p1,x,sarch,arch); } if (minus == Id) p1 = plus; else { p2 = ideleaddone_aux(nf,minus,module); p1 = idealdivexact(nf,idealmul(nf,p2,plus),minus); p1 = idealmodidele(nf,p1,x,sarch,arch); } genray[j]=lpileupto(av1,p1); } clg = cgetg(4,t_VEC); clg[3] = lcopy(genray); } else clg = cgetg(3,t_VEC); met = mattodiagonal(met); clg[1] = (long)dethnf_i(h); clg[2] = (long)met; if (!(flag & nf_INIT)) return gerepileupto(av,clg); u2 = cgetg(Ri+1,t_MAT); u1 = cgetg(RU+1,t_MAT); u = (GEN)hmatu[2]; for (j=1; j<=RU; j++) { u1[j]=u[j]; setlg(u[j],RU+1); } u += RU; for (j=1; j<=Ri; j++) { u2[j]=u[j]; setlg(u[j],RU+1); } y = cgetg(7,t_VEC); y[1] = (long)bnf; y[2] = (long)bid; y[3] = (long)vecel; y[4] = (long)U; y[5] = (long)clg; u = cgetg(3,t_VEC); y[6] = (long)u; u[1] = lmul(u2, ginv(hmat)); u[2] = lmul(u1, lllint(u1)); return gerepilecopy(av,y);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/c905294cb104864ddcc6d29a35e77f42f710e2ef/buch3.c/clean/src/basemath/buch3.c |
if (!isfundamental(Disc)) err(warner,"not a fundamental discriminant in quadclassunit"); | buchquad(GEN D, double cbach, double cbach2, long RELSUP0, long flag, long prec){ pari_sp av0 = avma, av; long KCCO, i, j, s, **mat; long nrelsup, nreldep, LIMC, LIMC2, cp, nlze; GEN h, W, cyc, res, gen, dep, C, B, extramat, extraC; GEN R, resc, Res, z; double drc, lim, LOGD, LOGD2; const long MAXRELSUP = 7; Disc = D; if (typ(Disc)!=t_INT) err(typeer,"buchquad"); s = mod4(Disc); switch(signe(Disc)) { case -1: if (cmpis(Disc,-4) >= 0) { GEN p1=cgetg(6,t_VEC); p1[1]=p1[4]=p1[5]=un; p1[2]=p1[3]=lgetg(1,t_VEC); return p1; } if (s==2 || s==1) err(funder2,"buchquad"); PRECREG=0; break; case 1: if (s==2 || s==3) err(funder2,"buchquad"); if (flag) err(talker,"sorry, narrow class group not implemented. Use bnfnarrow"); PRECREG=1; break; default: err(talker,"zero discriminant in quadclassunit"); } if (carreparfait(Disc)) err(talker,"square argument in quadclassunit"); if (!isfundamental(Disc)) err(warner,"not a fundamental discriminant in quadclassunit"); buch_init(); RELSUP = RELSUP0; drc = fabs(gtodouble(Disc)); LOGD = log(drc); LOGD2 = LOGD * LOGD; lim = sqrt(drc); /* resc = sqrt(D) w / 2^r1 (2pi)^r2 ~ hR / L(chi,1) */ if (PRECREG) resc = dbltor(lim / 2.); else resc = dbltor(lim / PI); if (!PRECREG) lim /= sqrt(3.); R = gun; cp = (long)exp(sqrt(LOGD*log(LOGD)/8.0)); if (cp < 13) cp = 13; av = avma; cbach /= 2; mat = NULL;START: avma = av; cbach = check_bach(cbach,6.); if (mat) { desalloc(mat); mat = NULL; } nreldep = nrelsup = 0; LIMC = (long)(cbach*LOGD2); if (LIMC < cp) { LIMC = cp; cbach = LIMC / LOGD2; } LIMC2 = (long)(max(cbach,cbach2)*LOGD2); if (LIMC2 < LIMC) LIMC2 = LIMC; if (PRECREG) { PRECREG = max(prec+1, MEDDEFAULTPREC + 2*(expi(Disc)>>TWOPOTBITS_IN_LONG)); sqrtD = gsqrt(Disc,PRECREG); isqrtD = gfloor(sqrtD); } Res = FBquad(Disc,LIMC2,LIMC); if (!Res) goto START; subFB = subFBquad(Disc, lim + 0.5, KC); if (!subFB) goto START; powsubFB = powsubFBquad(CBUCH+1); limhash = ((ulong)LIMC < (MAXHALFULONG>>1))? LIMC*LIMC: (long)(HIGHBIT>>1); for (i=0; i<HASHT; i++) hashtab[i]=NULL; KCCO = KC + RELSUP; if (DEBUGLEVEL) fprintferr("KC = %ld, KCCO = %ld\n",KC,KCCO); mat = (long**)cgetalloc(NULL, KCCO+1, t_VEC); for (i=1; i<=KCCO; i++) { GEN t = cgetalloc(NULL, KC+1, t_VECSMALL); for (j=1; j<=KC; j++) t[j]=0; mat[i] = t; } s = lg(subFB)-1 + RELSUP; C = PRECREG? real_relations(KCCO,s,LIMC,mat) : imag_relations(KCCO,s,LIMC,mat); W = hnfspec(mat,vperm,&dep,&B,&C,lg(subFB)-1); nlze = lg(dep)>1? lg(dep[1])-1: lg(B[1])-1; if (nlze) {MORE: extramat = extra_relations(LIMC,nlze, &extraC); if (!extramat) { goto START; } W = hnfadd(W,vperm,&dep,&B,&C, extramat,extraC); nlze = lg(dep)>1? lg(dep[1])-1: lg(B[1])-1; KCCO += lg(extramat)-1; if (nlze) { if (++nreldep > 5) goto START; goto MORE; } } h = dethnf_i(W); if (DEBUGLEVEL) fprintferr("\n#### Tentative class number: %Z\n", h); z = mulrr(Res, resc); /* ~ hR if enough relations, a multiple otherwise */ switch(get_R(C, KCCO - (lg(B)-1) - (lg(W)-1), divir(h,z), &R)) { case PRECI: prec = (PRECREG<<1)-2; goto START; case RELAT: if (++nrelsup <= MAXRELSUP) { nlze = min(KC, nrelsup); goto MORE; } goto START; } /* DONE */ if (!quad_be_honest()) goto START; gen = get_clgp(Disc,W,&cyc,PRECREG); desalloc(mat); res=cgetg(6,t_VEC); res[1]=(long)h; res[2]=(long)cyc; res[3]=(long)gen; res[4]=(long)R; res[5]=ldiv(mpmul(R,h), z); return gerepilecopy(av0,res);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/715305d902d7f2ad671dc1e7c723528ccf2d3a61/buch1.c/buggy/src/basemath/buch1.c |
|
long av,tetpil,f, N=degpol(pol), m=lg(ideal)-1; | long f, N=degpol(pol), m=lg(ideal)-1; ulong av; | prime_two_elt(GEN nf, GEN p, GEN ideal){ GEN beta,a,pf, pol = (GEN)nf[1]; long av,tetpil,f, N=degpol(pol), m=lg(ideal)-1; if (!m) return gscalcol_i(p,N); /* we want v_p(Norm(beta)) = p^f, f = N-m */ av = avma; f = N-m; pf = gpuigs(p,f); ideal = centerlift(ideal); ideal = concatsp(gscalcol(p,N), ideal); ideal = ideal_better_basis(nf, ideal, p); beta = gmul((GEN)nf[7], ideal);#if 0 a = prime_two_elt_loop(beta,pol,p,pf); if (!a) err(bugparier, "prime_two_elt (failed)");#else a = random_prime_two_elt_loop(beta,pol,p,pf);#endif a = centermod(algtobasis_intern(nf,a), p); if (resii(divii(subres(gmul((GEN)nf[7],a),pol),pf),p) == gzero) a[1] = laddii((GEN)a[1],p); tetpil = avma; return gerepile(av,tetpil,gcopy(a));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/base2.c/clean/src/basemath/base2.c |
tetpil = avma; return gerepile(av,tetpil,gcopy(a)); | return gerepilecopy(av,a); | prime_two_elt(GEN nf, GEN p, GEN ideal){ GEN beta,a,pf, pol = (GEN)nf[1]; long av,tetpil,f, N=degpol(pol), m=lg(ideal)-1; if (!m) return gscalcol_i(p,N); /* we want v_p(Norm(beta)) = p^f, f = N-m */ av = avma; f = N-m; pf = gpuigs(p,f); ideal = centerlift(ideal); ideal = concatsp(gscalcol(p,N), ideal); ideal = ideal_better_basis(nf, ideal, p); beta = gmul((GEN)nf[7], ideal);#if 0 a = prime_two_elt_loop(beta,pol,p,pf); if (!a) err(bugparier, "prime_two_elt (failed)");#else a = random_prime_two_elt_loop(beta,pol,p,pf);#endif a = centermod(algtobasis_intern(nf,a), p); if (resii(divii(subres(gmul((GEN)nf[7],a),pol),pf),p) == gzero) a[1] = laddii((GEN)a[1],p); tetpil = avma; return gerepile(av,tetpil,gcopy(a));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/base2.c/clean/src/basemath/base2.c |
long i,j,ls,ltop=avma,lbot; | ulong ltop = avma; long i,j,ls; | bnfsunit(GEN bnf,GEN S,long prec){ long i,j,ls,ltop=avma,lbot; GEN p1,nf,classgp,gen,M,U,H; GEN sunit,card,sreg,res,pow,fa = cgetg(3, t_MAT); if (typ(S) != t_VEC) err(typeer,"bnfsunit"); bnf = checkbnf(bnf); nf=(GEN)bnf[7]; classgp=gmael(bnf,8,1); gen = (GEN)classgp[3]; sreg = gmael(bnf,8,2); res=cgetg(7,t_VEC); res[1]=res[2]=res[3]=lgetg(1,t_VEC); res[4]=(long)sreg; res[5]=(long)classgp; res[6]=(long)S; ls=lg(S); /* M = relation matrix for the S class group (in terms of the class group * generators given by gen) * 1) ideals in S */ M = cgetg(ls,t_MAT); for (i=1; i<ls; i++) { p1 = (GEN)S[i]; checkprimeid(p1); M[i] = (long)isprincipal(bnf,p1); } /* 2) relations from bnf class group */ M = concatsp(M, diagonal((GEN) classgp[2])); /* S class group */ H = hnfall(M); U = (GEN)H[2]; H= (GEN)H[1]; card = gun; if (lg(H) > 1) { /* non trivial (rare!) */ GEN SNF, ClS = cgetg(4,t_VEC); SNF = smith2(H); p1 = (GEN)SNF[3]; card = dethnf_i(p1); ClS[1] = (long)card; /* h */ for(i=1; i<lg(p1); i++) if (gcmp1((GEN)p1[i])) break; setlg(p1,i); ClS[2]=(long)p1; /* cyc */ p1=cgetg(i,t_VEC); pow=ZM_inv((GEN)SNF[1],gun); fa[1] = (long)gen; for(i--; i; i--) { fa[2] = pow[i]; p1[i] = (long)factorback_i(fa, nf, 1); } ClS[3]=(long)p1; /* gen */ res[5]=(long) ClS; } /* S-units */ if (ls>1) { GEN den, Sperm, perm, dep, B, U1 = U; long lH, lB, fl = nf_GEN|nf_FORCE; /* U1 = upper left corner of U, invertible. S * U1 = principal ideals * whose generators generate the S-units */ setlg(U1,ls); p1 = cgetg(ls, t_MAT); /* p1 is junk for mathnfspec */ for (i=1; i<ls; i++) { setlg(U1[i],ls); p1[i] = lgetg(1,t_COL); } H = mathnfspec(U1,&perm,&dep,&B,&p1); lH = lg(H); lB = lg(B); if (lg(dep) > 1 && lg(dep[1]) > 1) err(bugparier,"bnfsunit"); /* [ H B ] [ H^-1 - H^-1 B ] * perm o HNF(U1) = [ 0 Id ], inverse = [ 0 Id ] * (permute the rows) * S * HNF(U1) = _integral_ generators for S-units = sunit */ Sperm = cgetg(ls, t_VEC); sunit = cgetg(ls, t_VEC); for (i=1; i<ls; i++) Sperm[i] = S[perm[i]]; /* S o perm */ setlg(Sperm, lH); fa[1] = (long)Sperm; for (i=1; i<lH; i++) sunit[i] = isprincipalfact(bnf,Sperm,(GEN)H[i],NULL,fl)[2]; for (j=1; j<lB; j++,i++) sunit[i] = isprincipalfact(bnf,Sperm,(GEN)B[j],(GEN)Sperm[i],fl)[2]; p1 = cgetg(4,t_VEC); den = dethnf_i(H); H = ZM_inv(H,den); p1[1] = (long)perm; p1[2] = (long)concatsp(H, gneg(gmul(H,B))); /* top part of inverse * den */ p1[3] = (long)den; /* keep denominator separately */ sunit = basistoalg(nf,sunit); res[2] = (long)p1; /* HNF in split form perm + (H B) [0 Id missing] */ res[1] = (long)lift_intern(sunit); } /* S-regulator */ sreg = gmul(sreg,card); for (i=1; i<ls; i++) { GEN p = (GEN)S[i]; if (typ(p) == t_VEC) p = (GEN) p[1]; sreg = gmul(sreg,glog(p,prec)); } res[4]=(long) sreg; lbot=avma; return gerepile(ltop,lbot,gcopy(res));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/buch4.c/buggy/src/basemath/buch4.c |
res[4]=(long) sreg; lbot=avma; return gerepile(ltop,lbot,gcopy(res)); | res[4]=(long) sreg; return gerepilecopy(ltop,res); | bnfsunit(GEN bnf,GEN S,long prec){ long i,j,ls,ltop=avma,lbot; GEN p1,nf,classgp,gen,M,U,H; GEN sunit,card,sreg,res,pow,fa = cgetg(3, t_MAT); if (typ(S) != t_VEC) err(typeer,"bnfsunit"); bnf = checkbnf(bnf); nf=(GEN)bnf[7]; classgp=gmael(bnf,8,1); gen = (GEN)classgp[3]; sreg = gmael(bnf,8,2); res=cgetg(7,t_VEC); res[1]=res[2]=res[3]=lgetg(1,t_VEC); res[4]=(long)sreg; res[5]=(long)classgp; res[6]=(long)S; ls=lg(S); /* M = relation matrix for the S class group (in terms of the class group * generators given by gen) * 1) ideals in S */ M = cgetg(ls,t_MAT); for (i=1; i<ls; i++) { p1 = (GEN)S[i]; checkprimeid(p1); M[i] = (long)isprincipal(bnf,p1); } /* 2) relations from bnf class group */ M = concatsp(M, diagonal((GEN) classgp[2])); /* S class group */ H = hnfall(M); U = (GEN)H[2]; H= (GEN)H[1]; card = gun; if (lg(H) > 1) { /* non trivial (rare!) */ GEN SNF, ClS = cgetg(4,t_VEC); SNF = smith2(H); p1 = (GEN)SNF[3]; card = dethnf_i(p1); ClS[1] = (long)card; /* h */ for(i=1; i<lg(p1); i++) if (gcmp1((GEN)p1[i])) break; setlg(p1,i); ClS[2]=(long)p1; /* cyc */ p1=cgetg(i,t_VEC); pow=ZM_inv((GEN)SNF[1],gun); fa[1] = (long)gen; for(i--; i; i--) { fa[2] = pow[i]; p1[i] = (long)factorback_i(fa, nf, 1); } ClS[3]=(long)p1; /* gen */ res[5]=(long) ClS; } /* S-units */ if (ls>1) { GEN den, Sperm, perm, dep, B, U1 = U; long lH, lB, fl = nf_GEN|nf_FORCE; /* U1 = upper left corner of U, invertible. S * U1 = principal ideals * whose generators generate the S-units */ setlg(U1,ls); p1 = cgetg(ls, t_MAT); /* p1 is junk for mathnfspec */ for (i=1; i<ls; i++) { setlg(U1[i],ls); p1[i] = lgetg(1,t_COL); } H = mathnfspec(U1,&perm,&dep,&B,&p1); lH = lg(H); lB = lg(B); if (lg(dep) > 1 && lg(dep[1]) > 1) err(bugparier,"bnfsunit"); /* [ H B ] [ H^-1 - H^-1 B ] * perm o HNF(U1) = [ 0 Id ], inverse = [ 0 Id ] * (permute the rows) * S * HNF(U1) = _integral_ generators for S-units = sunit */ Sperm = cgetg(ls, t_VEC); sunit = cgetg(ls, t_VEC); for (i=1; i<ls; i++) Sperm[i] = S[perm[i]]; /* S o perm */ setlg(Sperm, lH); fa[1] = (long)Sperm; for (i=1; i<lH; i++) sunit[i] = isprincipalfact(bnf,Sperm,(GEN)H[i],NULL,fl)[2]; for (j=1; j<lB; j++,i++) sunit[i] = isprincipalfact(bnf,Sperm,(GEN)B[j],(GEN)Sperm[i],fl)[2]; p1 = cgetg(4,t_VEC); den = dethnf_i(H); H = ZM_inv(H,den); p1[1] = (long)perm; p1[2] = (long)concatsp(H, gneg(gmul(H,B))); /* top part of inverse * den */ p1[3] = (long)den; /* keep denominator separately */ sunit = basistoalg(nf,sunit); res[2] = (long)p1; /* HNF in split form perm + (H B) [0 Id missing] */ res[1] = (long)lift_intern(sunit); } /* S-regulator */ sreg = gmul(sreg,card); for (i=1; i<ls; i++) { GEN p = (GEN)S[i]; if (typ(p) == t_VEC) p = (GEN) p[1]; sreg = gmul(sreg,glog(p,prec)); } res[4]=(long) sreg; lbot=avma; return gerepile(ltop,lbot,gcopy(res));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/buch4.c/buggy/src/basemath/buch4.c |
tty->rawOutBufState = rob_busy; | osend (const char *buf, int len, struct rtems_termios_tty *tty){ unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (!tty->device.outputUsesInterrupts) { (*tty->device.write)(tty->minor, buf, len); return; } newHead = tty->rawOutBufHead; while (len) { /* * Performance improvement could be made here. * Copy multiple bytes to raw buffer: * if (len > 1) && (space to buffer end, or tail > 1) * ncopy = MIN (len, space to buffer end or tail) * memcpy (raw buffer, buf, ncopy) * buf += ncopy * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE; rtems_interrupt_disable (level); while (newHead == tty->rawOutBufTail) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf[tty->rawOutBufHead] = *buf++; tty->rawOutBufHead = newHead; if (tty->rawOutBufState == rob_idle) { tty->rawOutBufState = rob_busy; (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1); } rtems_interrupt_enable (level); len--; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b3fd16416cc283f2c8340ac7cb06270cf51adb5f/termios.c/buggy/c/src/exec/libcsupport/src/termios.c |
|
tty->rawOutBufState = rob_busy; | osend (const char *buf, int len, struct rtems_termios_tty *tty){ unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (!tty->device.outputUsesInterrupts) { (*tty->device.write)(tty->minor, buf, len); return; } newHead = tty->rawOutBufHead; while (len) { /* * Performance improvement could be made here. * Copy multiple bytes to raw buffer: * if (len > 1) && (space to buffer end, or tail > 1) * ncopy = MIN (len, space to buffer end or tail) * memcpy (raw buffer, buf, ncopy) * buf += ncopy * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE; rtems_interrupt_disable (level); while (newHead == tty->rawOutBufTail) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf[tty->rawOutBufHead] = *buf++; tty->rawOutBufHead = newHead; if (tty->rawOutBufState == rob_idle) { tty->rawOutBufState = rob_busy; (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1); } rtems_interrupt_enable (level); len--; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b3fd16416cc283f2c8340ac7cb06270cf51adb5f/termios.c/buggy/c/src/exec/libcsupport/src/termios.c |
|
svg_matrix_multiply(&c->gm, &c->gm, &tm); | svg_matrix_multiply(&c->gm, &tm, &c->gm); | void svg_render_solid(SDL_svg_context *c){int i,j;int colorstops;//void (*renderfunc)(SDL_svg_context *c, int x, int y, int w);IPoint *path;svg_paint_t *paint;const svg_color_t *rgb;int alpha;svg_matrix_t tm; c->renderfunc = 0; path = c->path; paint = c->paint; switch(paint->type) { case SVG_PAINT_TYPE_COLOR: rgb = &paint->p.color; alpha = 255.0 * c->FillOpacity; c->solidcolor = maprgb(c->surface, svg_color_get_red(rgb), svg_color_get_green(rgb), svg_color_get_blue(rgb)) | (alpha << 24); c->renderfunc = solidstrip; break; case SVG_PAINT_TYPE_GRADIENT: colorstops = paint->p.gradient->num_stops; for(i=0;i<colorstops-1;++i) { int c1,c2; int r1,g1,b1,a1,r2,g2,b2,a2; unsigned long t; int v; c1=NUM_GRADIENT_COLORS*i/(colorstops-1); c2=NUM_GRADIENT_COLORS*(i+1)/(colorstops-1); t=paint->p.gradient->stops[i].color.rgb; a1=255.0 * paint->p.gradient->stops[i].opacity; r1 = (t>>16) & 255; g1 = (t>>8) & 255; b1 = t & 255; t=paint->p.gradient->stops[i+1].color.rgb; a2=255.0 * paint->p.gradient->stops[i+1].opacity; r2 = (t>>16) & 255; g2 = (t>>8) & 255; b2 = t & 255; r2-=r1; g2-=g1; b2-=b1; a2-=a1; v=c2-c1-1; for(j=0;j<=v;++j) { c->gradient_colors[c1+j]=maprgb(c->surface, r1 + r2*j/v, g1 + g2*j/v, b1 + b2*j/v) | ((a1 + a2*j/v)<<24); } } c->gradient_policy = paint->p.gradient->spread; if (paint->p.gradient->type == SVG_GRADIENT_LINEAR) { c->renderfunc = lineargradient; c->gradient_p1 = (IPoint) { ConvertLength(&paint->p.gradient->u.linear.x1), ConvertLength(&paint->p.gradient->u.linear.y1)}; c->gradient_p2 = (IPoint) { ConvertLength(&paint->p.gradient->u.linear.x2), ConvertLength(&paint->p.gradient->u.linear.y2)}; } else if(paint->p.gradient->type == SVG_GRADIENT_RADIAL) { c->renderfunc = radialgradient; c->gradient_p1 = (IPoint) { ConvertLength(&paint->p.gradient->u.radial.cx), ConvertLength(&paint->p.gradient->u.radial.cy)}; c->gradient_p2 = (IPoint) { ConvertLength(&paint->p.gradient->u.radial.fx), ConvertLength(&paint->p.gradient->u.radial.fy)}; c->gradient_r = ConvertLength(&paint->p.gradient->u.radial.r); } else c->renderfunc = 0; if(paint->p.gradient->units==SVG_GRADIENT_UNITS_USER) { c->gradient_p1 = FixCoords(c, c->gradient_p1); c->gradient_p2 = FixCoords(c, c->gradient_p2); c->gradient_r = FixSizes(c, (IPoint) {c->gradient_r, 0.0}).x; c->gm.a = c->gm.d = 1.0; c->gm.c = c->gm.b = c->gm.e = c->gm.f = 0.0; } else // BBOX { IPoint vx, vy, tv; float xx,xy,yx,yy, det; tv = FixCoords(c, (IPoint) {c->minx, c->miny}); vx = FixCoords(c, (IPoint) {c->maxx, c->miny}); vy = FixCoords(c, (IPoint) {c->minx, c->maxy});// x' = x+e// y' = y+f// x'' = ax' + by'// y'' = cx' + dy' xx = vx.x - tv.x; xy = vx.y - tv.y; yx = vy.x - tv.x; yy = vy.y - tv.y; det = xx*yy - xy*yx; if(det != 0.0) { c->gm.a = yy / det; c->gm.c = -yx / det; c->gm.b = -xy / det; c->gm.d = xx / det; } else c->gm.a = c->gm.b = c->gm.c = c->gm.d = 0.0; c->gm.e = -(c->gm.a * tv.x + c->gm.c * tv.y); c->gm.f = -(c->gm.b * tv.x + c->gm.d * tv.y); }// go get the gradient transform svg_matrix_init(&tm, paint->p.gradient->transform[0], paint->p.gradient->transform[1], paint->p.gradient->transform[2], paint->p.gradient->transform[3], paint->p.gradient->transform[4], paint->p.gradient->transform[5]);// invert it tm = svg_matrix_invert(&tm);// apply it to our own gm svg_matrix_multiply(&c->gm, &c->gm, &tm); break; default: c->renderfunc = 0; break; } do_render(c);} | 1561 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1561/5859f1732411637af272c589b6e2947495542a8c/render.c/clean/render.c |
return FqX_red(derivpol(f), T, p); | return FpXQX_red(derivpol(f), T, p); | FqX_deriv(GEN f, GEN T, GEN p){ return FqX_red(derivpol(f), T, p);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/1feca87bb567e8a308f265fef168e4de5f3f221d/polarit1.c/clean/src/basemath/polarit1.c |
if ( the_object->name == the_name ) { | if ( the_object->name == name_to_use ) { | rtems_status_code _Objects_MP_Global_name_search ( Objects_Information *information, Objects_Name the_name, unsigned32 nodes_to_search, Objects_Id *the_id){ unsigned32 low_node; unsigned32 high_node; unsigned32 node_index; Chain_Control *the_chain; Chain_Node *the_node; Objects_MP_Control *the_object; if ( nodes_to_search > _Configuration_MP_table->maximum_nodes ) return ( RTEMS_INVALID_NODE ); if ( information->global_table == NULL ) return ( RTEMS_INVALID_NAME ); if ( nodes_to_search == RTEMS_SEARCH_ALL_NODES || nodes_to_search == RTEMS_SEARCH_OTHER_NODES ) { low_node = 1; high_node = _Configuration_MP_table->maximum_nodes; } else { low_node = high_node = nodes_to_search; } _Thread_Disable_dispatch(); for ( node_index = low_node ; node_index <= high_node ; node_index++ ) { /* * NOTE: The local node was search (if necessary) by * _Objects_Name_to_id before this was invoked. */ if ( !_Objects_Is_local_node( node_index ) ) { the_chain = &information->global_table[ node_index ]; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_object = (Objects_MP_Control *) the_node; if ( the_object->name == the_name ) { *the_id = the_object->Object.id; _Thread_Enable_dispatch(); return ( RTEMS_SUCCESSFUL ); } } } } _Thread_Enable_dispatch(); return ( RTEMS_INVALID_NAME );} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3235ad9a2cd717df901853ad5220a4aaffae84a9/objectmp.c/clean/cpukit/score/src/objectmp.c |
Objects_Name name, | rtems_name name, | void _Region_MP_Send_process_packet ( Region_MP_Remote_operations operation, Objects_Id region_id, Objects_Name name, Objects_Id proxy_id){ Region_MP_Packet *the_packet; unsigned32 node; switch ( operation ) { case REGION_MP_ANNOUNCE_CREATE: case REGION_MP_ANNOUNCE_DELETE: case REGION_MP_EXTRACT_PROXY: the_packet = _Region_MP_Get_packet(); the_packet->Prefix.the_class = RTEMS_MP_PACKET_REGION; the_packet->Prefix.length = sizeof ( Region_MP_Packet ); the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet ); the_packet->operation = operation; the_packet->Prefix.id = region_id; the_packet->name = name; the_packet->proxy_id = proxy_id; if ( operation == REGION_MP_EXTRACT_PROXY ) node = rtems_get_node( region_id ); else node = MPCI_ALL_NODES; _MPCI_Send_process_packet( node, &the_packet->Prefix ); break; case REGION_MP_GET_SEGMENT_REQUEST: case REGION_MP_GET_SEGMENT_RESPONSE: case REGION_MP_RETURN_SEGMENT_REQUEST: case REGION_MP_RETURN_SEGMENT_RESPONSE: break; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3235ad9a2cd717df901853ad5220a4aaffae84a9/regionmp.c/clean/cpukit/rtems/src/regionmp.c |
gb->bornesol = gerepileupto(ltop, ceil_safe(borneroots)); | gb->bornesol = gerepileupto(ltop, ceil_safe(mulrs(borneroots,2))); | galoisborne(GEN T, GEN dn, struct galois_borne *gb, long ppp){ gpmem_t ltop = avma, av2; GEN borne, borneroots, borneabs; int i, j; int n; GEN L, M, z, prep, den; long prec; den = initgaloisborne(T,dn, &L,&prep,NULL,&prec); if (!dn) den = gclone(den); M = vandermondeinverse(L, gmul(T, realun(prec)), den, prep); if (DEBUGLEVEL>=4) genmsgtimer(3,"vandermondeinverse"); borne = realzero(prec); n = degpol(T); for (i = 1; i <= n; i++) { z = gzero; for (j = 1; j <= n; j++) z = gadd(z, gabs(gcoeff(M,i,j), prec)); if (gcmp(z, borne) > 0) borne = z; } borneroots = realzero(prec); for (i = 1; i <= n; i++) { z = gabs((GEN) L[i], prec); if (gcmp(z, borneroots) > 0) borneroots = z; } borneabs = addsr(1, gmulsg(n, gpowgs(borneroots, n/ppp))); /*if (ppp == 1) borneabs = addsr(1, gmulsg(n, gpowgs(borneabs, 2)));*/ borneroots = addsr(1, gmul(borne, borneroots)); av2 = avma; /*We use d-1 test, so we must overlift to 2^BITS_IN_LONG*/ gb->valsol = logint(gmul2n(borneroots,2+BITS_IN_LONG), gb->l,NULL); gb->valabs = logint(gmul2n(borneabs,2), gb->l,NULL); gb->valabs = max(gb->valsol,gb->valabs); if (DEBUGLEVEL >= 4) fprintferr("GaloisConj:val1=%ld val2=%ld\n", gb->valsol, gb->valabs); avma = av2; gb->bornesol = gerepileupto(ltop, ceil_safe(borneroots)); if (DEBUGLEVEL >= 9) fprintferr("GaloisConj: Bound %Z\n",borneroots); gb->ladicsol = gpowgs(gb->l, gb->valsol); gb->ladicabs = gpowgs(gb->l, gb->valabs); gb->lbornesol = subii(gb->ladicsol,gb->bornesol); if (!dn) { dn = icopy(den); gunclone(den); } return dn;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/4e65706ae93bb2d05eb57b6b6749bcd874302c5e/galconj.c/buggy/src/basemath/galconj.c |
tabefin = cgetg(lv,t_VECSMALL); | inittabs(int lv){ int i; tabaall = (GEN*)cgetg(lv,t_VECSMALL); tabtall = (GEN*)cgetg(lv,t_VECSMALL); tabcyc = (GEN*)cgetg(lv,t_VEC); tabefin = cgetg(lv,t_VECSMALL); 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/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
|
*d = atol(s); | *d = get_int(s, 0); | testint(char *s, long *d){ if (!s) return; *d = atol(s); if (*d <= 0) err(talker,"arguments must be positive integers");} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/3a3e75b906e6442d0301f5f9d6bebf693017dba0/gp.c/clean/src/gp/gp.c |
GEN V=NULL; long n=lg(O[1])*2; GEN LN=cgetg(n,t_MAT); GEN Ll=cgetg(n,t_MAT); long i,nb,ok=0; for(i=1, nb=1; i<n; i++, nb*=4) | const long n=(BITS_IN_LONG>>1)-1; GEN NS=cgetg(n+1,t_MAT); GEN sym=NULL, W=cgetg(n+1,t_VECSMALL); long i, e=1; if (DEBUGLEVEL>=4) fprintferr("FixedField: Size: %ldx%ld\n",lg(O)-1,lg(O[1])-1); for(i=1;!sym && i<=n; i++) | fixedfieldsympol(GEN O, GEN mod, GEN l, GEN p, long v){ pari_sp ltop=avma; GEN V=NULL; long n=lg(O[1])*2; GEN LN=cgetg(n,t_MAT); GEN Ll=cgetg(n,t_MAT); long i,nb,ok=0; for(i=1, nb=1; i<n; i++, nb*=4) { gel(LN,i) = sympol_eval_newtonsum(i,O,mod); gel(Ll,i) = FpC_red(gel(LN,i),l); if (DEBUGLEVEL>=6) fprintferr("FixedField: LN[%d]=%Z \n",i,Ll[i]); ok = (ok || fixedfieldtests(Ll,i)); if (ok) if ((V=fixedfieldsurmer(O,mod,l,p,v,LN,i,nb))) { if (DEBUGLEVEL>=4) pariputsf("FixedField: Sym: %Z\n",gel(V,1)); return gerepilecopy(ltop,V); } } err(talker,"p too small in fixedfieldsympol"); return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
gel(LN,i) = sympol_eval_newtonsum(i,O,mod); gel(Ll,i) = FpC_red(gel(LN,i),l); if (DEBUGLEVEL>=6) fprintferr("FixedField: LN[%d]=%Z \n",i,Ll[i]); ok = (ok || fixedfieldtests(Ll,i)); if (ok) if ((V=fixedfieldsurmer(O,mod,l,p,v,LN,i,nb))) { if (DEBUGLEVEL>=4) pariputsf("FixedField: Sym: %Z\n",gel(V,1)); return gerepilecopy(ltop,V); } | GEN L = sympol_eval_newtonsum(e++, O, mod); if (lg(O)>2) while (vec_isconst(L)) L = sympol_eval_newtonsum(e++, O, mod); W[i] = e-1; gel(NS,i) = L; if (sympol_is1to1_lg(NS,i+1)) sym=fixedfieldsurmer(O,mod,l,p,v,NS,vecsmall_shorten(W,i)); | fixedfieldsympol(GEN O, GEN mod, GEN l, GEN p, long v){ pari_sp ltop=avma; GEN V=NULL; long n=lg(O[1])*2; GEN LN=cgetg(n,t_MAT); GEN Ll=cgetg(n,t_MAT); long i,nb,ok=0; for(i=1, nb=1; i<n; i++, nb*=4) { gel(LN,i) = sympol_eval_newtonsum(i,O,mod); gel(Ll,i) = FpC_red(gel(LN,i),l); if (DEBUGLEVEL>=6) fprintferr("FixedField: LN[%d]=%Z \n",i,Ll[i]); ok = (ok || fixedfieldtests(Ll,i)); if (ok) if ((V=fixedfieldsurmer(O,mod,l,p,v,LN,i,nb))) { if (DEBUGLEVEL>=4) pariputsf("FixedField: Sym: %Z\n",gel(V,1)); return gerepilecopy(ltop,V); } } err(talker,"p too small in fixedfieldsympol"); return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
err(talker,"p too small in fixedfieldsympol"); return NULL; | if (!sym) err(talker,"p too small in fixedfieldsympol"); if (DEBUGLEVEL>=2) fprintferr("FixedField: Found: %Z\n",gel(sym,1)); return gerepilecopy(ltop,sym); | fixedfieldsympol(GEN O, GEN mod, GEN l, GEN p, long v){ pari_sp ltop=avma; GEN V=NULL; long n=lg(O[1])*2; GEN LN=cgetg(n,t_MAT); GEN Ll=cgetg(n,t_MAT); long i,nb,ok=0; for(i=1, nb=1; i<n; i++, nb*=4) { gel(LN,i) = sympol_eval_newtonsum(i,O,mod); gel(Ll,i) = FpC_red(gel(LN,i),l); if (DEBUGLEVEL>=6) fprintferr("FixedField: LN[%d]=%Z \n",i,Ll[i]); ok = (ok || fixedfieldtests(Ll,i)); if (ok) if ((V=fixedfieldsurmer(O,mod,l,p,v,LN,i,nb))) { if (DEBUGLEVEL>=4) pariputsf("FixedField: Sym: %Z\n",gel(V,1)); return gerepilecopy(ltop,V); } } err(talker,"p too small in fixedfieldsympol"); return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
fixedfieldsurmer(GEN O, GEN mod, GEN l, GEN p, long v, GEN LN, long n, long m) | fixedfieldsurmer(GEN O, GEN mod, GEN l, GEN p, long v, GEN NS, GEN W) | fixedfieldsurmer(GEN O, GEN mod, GEN l, GEN p, long v, GEN LN, long n, long m){ long i,j; const long step=4; GEN sym=cgetg(n+1,t_VECSMALL); for (j=1;j<n;j++) sym[j]=step; sym[n]=0; for (i=0;i<m;i++) { pari_sp av=avma; GEN L,P; for (j=1;sym[j]==step;j++) sym[j]=0; sym[j]++; if (DEBUGLEVEL>=4) fprintferr("FixedField: Sym: %Z\n",sym); L=sympol_eval(sym, O, mod); if (L==gen_0 || !fixedfieldtest(FpC_red(L,l))) continue; P=FpX_center(FpV_roots_to_pol(L,mod,v),mod); if (!p || FpX_is_squarefree(P,p)) return mkvec3(sym,L,P); avma=av; } return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
const long step=4; | const long step=3; long n=lg(W)-1; long m=1<<((n-1)<<1); | fixedfieldsurmer(GEN O, GEN mod, GEN l, GEN p, long v, GEN LN, long n, long m){ long i,j; const long step=4; GEN sym=cgetg(n+1,t_VECSMALL); for (j=1;j<n;j++) sym[j]=step; sym[n]=0; for (i=0;i<m;i++) { pari_sp av=avma; GEN L,P; for (j=1;sym[j]==step;j++) sym[j]=0; sym[j]++; if (DEBUGLEVEL>=4) fprintferr("FixedField: Sym: %Z\n",sym); L=sympol_eval(sym, O, mod); if (L==gen_0 || !fixedfieldtest(FpC_red(L,l))) continue; P=FpX_center(FpV_roots_to_pol(L,mod,v),mod); if (!p || FpX_is_squarefree(P,p)) return mkvec3(sym,L,P); avma=av; } return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
if (DEBUGLEVEL>=4) fprintferr("FixedField: Sym: %Z\n",sym); L=sympol_eval(sym, O, mod); if (L==gen_0 || !fixedfieldtest(FpC_red(L,l))) continue; | if (DEBUGLEVEL>=6) fprintferr("FixedField: Sym: %Z\n",sym); L=sympol_eval(sym,NS); if (!vec_is1to1(FpC_red(L,l))) continue; | fixedfieldsurmer(GEN O, GEN mod, GEN l, GEN p, long v, GEN LN, long n, long m){ long i,j; const long step=4; GEN sym=cgetg(n+1,t_VECSMALL); for (j=1;j<n;j++) sym[j]=step; sym[n]=0; for (i=0;i<m;i++) { pari_sp av=avma; GEN L,P; for (j=1;sym[j]==step;j++) sym[j]=0; sym[j]++; if (DEBUGLEVEL>=4) fprintferr("FixedField: Sym: %Z\n",sym); L=sympol_eval(sym, O, mod); if (L==gen_0 || !fixedfieldtest(FpC_red(L,l))) continue; P=FpX_center(FpV_roots_to_pol(L,mod,v),mod); if (!p || FpX_is_squarefree(P,p)) return mkvec3(sym,L,P); avma=av; } return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
return mkvec3(sym,L,P); | return mkvec3(mkvec2(sym,W),L,P); | fixedfieldsurmer(GEN O, GEN mod, GEN l, GEN p, long v, GEN LN, long n, long m){ long i,j; const long step=4; GEN sym=cgetg(n+1,t_VECSMALL); for (j=1;j<n;j++) sym[j]=step; sym[n]=0; for (i=0;i<m;i++) { pari_sp av=avma; GEN L,P; for (j=1;sym[j]==step;j++) sym[j]=0; sym[j]++; if (DEBUGLEVEL>=4) fprintferr("FixedField: Sym: %Z\n",sym); L=sympol_eval(sym, O, mod); if (L==gen_0 || !fixedfieldtest(FpC_red(L,l))) continue; P=FpX_center(FpV_roots_to_pol(L,mod,v),mod); if (!p || FpX_is_squarefree(P,p)) return mkvec3(sym,L,P); avma=av; } return NULL;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/6a37ab20aeafe10cc8aba30df70738263c361968/galconj.c/buggy/src/basemath/galconj.c |
return | return (rtems_status_code) | rtems_status_code _Event_MP_Send_request_packet ( Event_MP_Remote_operations operation, Objects_Id event_id, rtems_event_set event_in){ Event_MP_Packet *the_packet; switch ( operation ) { case EVENT_MP_SEND_REQUEST: the_packet = _Event_MP_Get_packet(); the_packet->Prefix.the_class = MP_PACKET_EVENT; the_packet->Prefix.length = sizeof ( Event_MP_Packet ); the_packet->Prefix.to_convert = sizeof ( Event_MP_Packet ); the_packet->operation = operation; the_packet->Prefix.id = event_id; the_packet->event_in = event_in; return _MPCI_Send_request_packet( rtems_get_node( event_id ), &the_packet->Prefix, STATES_READY ); break; case EVENT_MP_SEND_RESPONSE: break; } /* * The following line is included to satisfy compilers which * produce warnings when a function does not end with a return. */ return RTEMS_SUCCESSFUL;} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/ffe316d5267c5e7ce99685be45efc9308b041dc6/eventmp.c/buggy/c/src/exec/rtems/src/eventmp.c |
long r, j, k, k2, d = n - m, d2 = d<<1; | const long d = n - m, d2 = d<<1, r = (m+1)>>1; long j, k, k2; | polzagreel(long n, long m, long prec){ long r, j, k, k2, d = n - m, d2 = d<<1; pari_sp av = avma; GEN Bx, g, h, v, b, s; if (d <= 0 || m < 0) return gzero; Bx = coefs_to_pol(3, gun, gun, gzero); /* x + x^2 */ v = cgetg(d+1,t_VEC); g = cgetg(d+1,t_VEC); v[d] = un; b = stor(d2, prec); g[d] = (long)b; for (k = 1; k < d; k++) { v[d-k] = un; for (j=1; j<k; j++) v[d-k+j] = laddii((GEN)v[d-k+j], (GEN)v[d-k+j+1]); /* v[d-k+j] = binom(k, j), j = 0..k */ k2 = k+k; b = divri(mulri(b,mulss(d2-k2+1,d2-k2)), mulss(k2,k2+1)); for (j=1; j<=k; j++) g[d-k+j] = lmpadd((GEN)g[d-k+j], mulri(b,(GEN)v[d-k+j])); g[d-k] = (long)b; } r = (m+1)>>1; g = gmul(vec_to_pol(g,0), gpowgs(Bx,r)); for (j=0; j<=r; j++) { if (j) g = derivpol(g); if (j || !(m&1)) { h = cgetg(n+3,t_POL); h[1] = evalsigne(1); h[2] = g[2]; for (k=1; k<n; k++) h[k+2] = ladd(gmulsg(k+k+1,(GEN)g[k+2]), gmulsg(k<<1,(GEN)g[k+1])); h[n+2] = lmulsg(n<<1, (GEN)g[n+1]); g = h; } } g = m? gmul2n(g,(m-1)>>1): gmul2n(g,-1); s = mulsi(d, mpfact(m+1)); return gerepileupto(av, gdiv(g,s));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/sumiter.c/buggy/src/language/sumiter.c |
r = (m+1)>>1; | polzagreel(long n, long m, long prec){ long r, j, k, k2, d = n - m, d2 = d<<1; pari_sp av = avma; GEN Bx, g, h, v, b, s; if (d <= 0 || m < 0) return gzero; Bx = coefs_to_pol(3, gun, gun, gzero); /* x + x^2 */ v = cgetg(d+1,t_VEC); g = cgetg(d+1,t_VEC); v[d] = un; b = stor(d2, prec); g[d] = (long)b; for (k = 1; k < d; k++) { v[d-k] = un; for (j=1; j<k; j++) v[d-k+j] = laddii((GEN)v[d-k+j], (GEN)v[d-k+j+1]); /* v[d-k+j] = binom(k, j), j = 0..k */ k2 = k+k; b = divri(mulri(b,mulss(d2-k2+1,d2-k2)), mulss(k2,k2+1)); for (j=1; j<=k; j++) g[d-k+j] = lmpadd((GEN)g[d-k+j], mulri(b,(GEN)v[d-k+j])); g[d-k] = (long)b; } r = (m+1)>>1; g = gmul(vec_to_pol(g,0), gpowgs(Bx,r)); for (j=0; j<=r; j++) { if (j) g = derivpol(g); if (j || !(m&1)) { h = cgetg(n+3,t_POL); h[1] = evalsigne(1); h[2] = g[2]; for (k=1; k<n; k++) h[k+2] = ladd(gmulsg(k+k+1,(GEN)g[k+2]), gmulsg(k<<1,(GEN)g[k+1])); h[n+2] = lmulsg(n<<1, (GEN)g[n+1]); g = h; } } g = m? gmul2n(g,(m-1)>>1): gmul2n(g,-1); s = mulsi(d, mpfact(m+1)); return gerepileupto(av, gdiv(g,s));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/sumiter.c/buggy/src/language/sumiter.c |
|
g = m? gmul2n(g,(m-1)>>1): gmul2n(g,-1); | g = gmul2n(g, r-1); | polzagreel(long n, long m, long prec){ long r, j, k, k2, d = n - m, d2 = d<<1; pari_sp av = avma; GEN Bx, g, h, v, b, s; if (d <= 0 || m < 0) return gzero; Bx = coefs_to_pol(3, gun, gun, gzero); /* x + x^2 */ v = cgetg(d+1,t_VEC); g = cgetg(d+1,t_VEC); v[d] = un; b = stor(d2, prec); g[d] = (long)b; for (k = 1; k < d; k++) { v[d-k] = un; for (j=1; j<k; j++) v[d-k+j] = laddii((GEN)v[d-k+j], (GEN)v[d-k+j+1]); /* v[d-k+j] = binom(k, j), j = 0..k */ k2 = k+k; b = divri(mulri(b,mulss(d2-k2+1,d2-k2)), mulss(k2,k2+1)); for (j=1; j<=k; j++) g[d-k+j] = lmpadd((GEN)g[d-k+j], mulri(b,(GEN)v[d-k+j])); g[d-k] = (long)b; } r = (m+1)>>1; g = gmul(vec_to_pol(g,0), gpowgs(Bx,r)); for (j=0; j<=r; j++) { if (j) g = derivpol(g); if (j || !(m&1)) { h = cgetg(n+3,t_POL); h[1] = evalsigne(1); h[2] = g[2]; for (k=1; k<n; k++) h[k+2] = ladd(gmulsg(k+k+1,(GEN)g[k+2]), gmulsg(k<<1,(GEN)g[k+1])); h[n+2] = lmulsg(n<<1, (GEN)g[n+1]); g = h; } } g = m? gmul2n(g,(m-1)>>1): gmul2n(g,-1); s = mulsi(d, mpfact(m+1)); return gerepileupto(av, gdiv(g,s));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/2edc82b0d172402925241429eca01a236af8dd01/sumiter.c/buggy/src/language/sumiter.c |
filltabs(Cache *C, Cache *Cp, Red *R, int p, int pk, ulong ltab) | filltabs(Cache *C, Cache *Cp, Red *R, int p, int pk, long ltab) | filltabs(Cache *C, Cache *Cp, Red *R, int p, int pk, ulong ltab){ pari_sp av; int i, j; long e; GEN tabt, taba, m; C->cyc = cyclo(pk,0); if (p > 2) { int LE = pk - pk/p + 1; GEN E = cgetg(LE, t_VECSMALL), eta = cgetg(pk+1,t_VEC); for (i=1,j=0; i<pk; i++) if (i%p) E[++j] = i; C->E = E; for (i=1; i<=pk; i++) { GEN z = FpX_res(gpowgs(polx[0],i-1), C->cyc, R->N); eta[i] = (long)centermod_i(z, R->N, R->N2); } C->eta = eta; } else if (pk >= 8) { int LE = (pk>>2) + 1; GEN E = cgetg(LE, t_VECSMALL); for (i=1,j=0; i<pk; i++) if ((i%8)==1 || (i%8)==3) E[++j] = i; C->E = E; } if (pk > 2 && smodis(R->N,pk) == 1) { GEN vpa, p1, p2, p3, a2 = NULL, a = finda(Cp, R->N, pk, p); int jj, ph = pk - pk/p; vpa = cgetg(ph+1,t_COL); vpa[1] = (long)a; if (pk > p) a2 = centermodii(sqri(a), R->N, R->N2); jj = 1; for (i=2; i<pk; i++) /* vpa = { a^i, (i,p) = 1 } */ if (i%p) { GEN z = mulii((i%p==1) ? a2 : a, (GEN)vpa[jj]); vpa[++jj] = (long)centermodii(z , R->N, R->N2); } if (!gcmp1( centermodii( mulii(a, (GEN)vpa[ph]), R->N, R->N2) )) return 0; p1 = cgetg(ph+1,t_MAT); p2 = cgetg(ph+1,t_COL); p1[1] = (long)p2; for (i=1; i<=ph; i++) p2[i] = un; j = 2; p1[j] = (long)vpa; p3 = vpa; for (j++; j <= ph; j++) { p2 = cgetg(ph+1,t_COL); p1[j] = (long)p2; for (i=1; i<=ph; i++) p2[i] = (long)centermodii(mulii((GEN)vpa[i],(GEN)p3[i]), R->N, R->N2); p3 = p2; } C->matvite = p1; C->matinvvite = FpM_inv(p1, R->N); } tabt = cgetg(ltab+1, t_VECSMALL); taba = cgetg(ltab+1, t_VECSMALL); av = avma; m = divis(R->N, pk); for (e=1; e<=ltab && signe(m); e++) { long s = vali(m); m = shifti(m,-s); tabt[e] = e==1? s: s + R->k; taba[e] = signe(m)? ((modBIL(m) & R->mask)+1)>>1: 0; m = shifti(m, -R->k); } setlg(taba, e); C->aall = taba; setlg(tabt, e); C->tall = tabt; avma = av; return 1;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/b28ee3138d460294f59f29974486484c436bb9e7/aprcl.c/clean/src/modules/aprcl.c |
TOP = (long)top; | read_opt(long argc, char **argv){ char *b=NULL, *p=NULL, *s=NULL, **pre; int i=1, initrc=1; long TOP; pari_outfile=stderr; while (i<argc) { char *t = argv[i++]; if (*t++ != '-') usage(argv[0]); switch(*t++) { case 'b': b = read_arg(&i,t,argc,argv); break; case 'p': p = read_arg(&i,t,argc,argv); break; case 's': s = read_arg(&i,t,argc,argv); break; case 'e': if (strncmp(t,"macs",4)) usage(argv[0]); under_emacs = 1; break; case 'q': quiet_mode = 1; break; case 't': if (strncmp(t,"est",3)) usage(argv[0]); disable_color = 1; test_mode = 1; /* fall through */ case 'f': initrc = 0; break; case '-': if (strcmp(t, "version") == 0) { print_version(); exit(0); } if (strcmp(t, "texmacs") == 0) { under_texmacs = 1; break; } /* fall through */ default: usage(argv[0]); } } if (under_texmacs) tm_start_output(); pre = initrc? gp_initrc(): NULL; /* override the values from gprc */ testint(b, &paribufsize); if (paribufsize < 10) paribufsize = 10; testint(p, &primelimit); testint(s, &TOP); top = (ulong)TOP; if (under_emacs || under_texmacs) disable_color=1; pari_outfile=stdout; return pre;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/c1265e9e2fe4efbebdbc8d964bd87bee500c750f/gp.c/buggy/src/gp/gp.c |
|
if ((status = apr_pool_create(&tmppool, request->respool)) != APR_SUCCESS) { return status; } | apr_pool_clear(tmppool); | static apr_status_t read_from_connection(serf_connection_t *conn){ apr_status_t status; apr_pool_t *tmppool; /* Whatever is coming in on the socket corresponds to the first request * on our chain. */ serf_request_t *request = conn->requests; /* assert: request != NULL */ /* Invoke response handlers until we have no more work. */ while (1) { if ((status = apr_pool_create(&tmppool, request->respool)) != APR_SUCCESS) { return status; } /* If the request doesn't have a response bucket, then call the * acceptor to get one created. */ if (request->resp_bkt == NULL) { request->resp_bkt = (*request->acceptor)(request, conn->skt, request->acceptor_baton, request->respool); } status = (*request->handler)(request->resp_bkt, request->handler_baton, tmppool); if (!APR_STATUS_IS_EOF(status)) { /* Whether success, or an error, there is no more to do unless * this request has been completed. */ goto error; } /* The request has been fully-delivered, and the response has * been fully-read. Remove it from our queue and loop to read * another response. */ conn->requests = request->next; /* The bucket is no longer needed, nor is the request's pool. */ serf_bucket_destroy(request->resp_bkt); apr_pool_destroy(request->respool); request = conn->requests; /* If we just ran out of requests, then update the pollset. We * don't want to read from this socket any more. We are definitely * done with this loop, too. */ if (request == NULL) { status = update_pollset(conn); return status; } } error: apr_pool_destroy(tmppool); return status;} | 1874 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1874/81115190c5dd8926f7ea04a061000bd22ac094e4/context.c/buggy/context.c |
request->respool); | tmppool); apr_pool_clear(tmppool); | static apr_status_t read_from_connection(serf_connection_t *conn){ apr_status_t status; apr_pool_t *tmppool; /* Whatever is coming in on the socket corresponds to the first request * on our chain. */ serf_request_t *request = conn->requests; /* assert: request != NULL */ /* Invoke response handlers until we have no more work. */ while (1) { if ((status = apr_pool_create(&tmppool, request->respool)) != APR_SUCCESS) { return status; } /* If the request doesn't have a response bucket, then call the * acceptor to get one created. */ if (request->resp_bkt == NULL) { request->resp_bkt = (*request->acceptor)(request, conn->skt, request->acceptor_baton, request->respool); } status = (*request->handler)(request->resp_bkt, request->handler_baton, tmppool); if (!APR_STATUS_IS_EOF(status)) { /* Whether success, or an error, there is no more to do unless * this request has been completed. */ goto error; } /* The request has been fully-delivered, and the response has * been fully-read. Remove it from our queue and loop to read * another response. */ conn->requests = request->next; /* The bucket is no longer needed, nor is the request's pool. */ serf_bucket_destroy(request->resp_bkt); apr_pool_destroy(request->respool); request = conn->requests; /* If we just ran out of requests, then update the pollset. We * don't want to read from this socket any more. We are definitely * done with this loop, too. */ if (request == NULL) { status = update_pollset(conn); return status; } } error: apr_pool_destroy(tmppool); return status;} | 1874 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1874/81115190c5dd8926f7ea04a061000bd22ac094e4/context.c/buggy/context.c |
return status; | goto error; | static apr_status_t read_from_connection(serf_connection_t *conn){ apr_status_t status; apr_pool_t *tmppool; /* Whatever is coming in on the socket corresponds to the first request * on our chain. */ serf_request_t *request = conn->requests; /* assert: request != NULL */ /* Invoke response handlers until we have no more work. */ while (1) { if ((status = apr_pool_create(&tmppool, request->respool)) != APR_SUCCESS) { return status; } /* If the request doesn't have a response bucket, then call the * acceptor to get one created. */ if (request->resp_bkt == NULL) { request->resp_bkt = (*request->acceptor)(request, conn->skt, request->acceptor_baton, request->respool); } status = (*request->handler)(request->resp_bkt, request->handler_baton, tmppool); if (!APR_STATUS_IS_EOF(status)) { /* Whether success, or an error, there is no more to do unless * this request has been completed. */ goto error; } /* The request has been fully-delivered, and the response has * been fully-read. Remove it from our queue and loop to read * another response. */ conn->requests = request->next; /* The bucket is no longer needed, nor is the request's pool. */ serf_bucket_destroy(request->resp_bkt); apr_pool_destroy(request->respool); request = conn->requests; /* If we just ran out of requests, then update the pollset. We * don't want to read from this socket any more. We are definitely * done with this loop, too. */ if (request == NULL) { status = update_pollset(conn); return status; } } error: apr_pool_destroy(tmppool); return status;} | 1874 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1874/81115190c5dd8926f7ea04a061000bd22ac094e4/context.c/buggy/context.c |
tmp_dirent.d_ino = the_jnode->stat_ino; | tmp_dirent.d_ino = the_jnode->st_ino; | int imfs_dir_read( rtems_libio_t *iop, void *buffer, unsigned32 count){ /* * Read up to element iop->offset in the directory chain of the * imfs_jnode_t struct for this file descriptor. */ Chain_Node *the_node; Chain_Control *the_chain; IMFS_jnode_t *the_jnode; int bytes_transferred; int current_entry; int first_entry; int last_entry; struct dirent tmp_dirent; the_jnode = (IMFS_jnode_t *)iop->file_info; the_chain = &the_jnode->info.directory.Entries; if ( Chain_Is_empty( the_chain ) ) return 0; /* Move to the first of the desired directory entries */ the_node = the_chain->first; bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent); /* The directory was not empty so try to move to the desired entry in chain*/ for( current_entry = 0; current_entry < last_entry; current_entry = current_entry + sizeof(struct dirent) ){ if ( Chain_Is_tail( the_chain, the_node ) ){ /* We hit the tail of the chain while trying to move to the first */ /* entry in the read */ return bytes_transferred; /* Indicate that there are no more */ /* entries to return */ } if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->stat_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); strcpy( tmp_dirent.d_name, the_jnode->name ); memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset = iop->offset + sizeof(struct dirent); bytes_transferred = bytes_transferred + sizeof( struct dirent ); } the_node = the_node->next; } /* Success */ return bytes_transferred;} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3af082818eaf759907a3b7863f5519418a069118/imfs_directory.c/clean/c/src/exec/libfs/src/imfs/imfs_directory.c |
if (typ(u) != t_POLMOD) u = to_polmod(u, (GEN)theta[1]); | rnfisnorm(GEN T, GEN x, long flag){ gpmem_t av = avma; GEN bnf = (GEN)T[1], rel = (GEN)T[2], relpol = (GEN)T[3], theta = (GEN)T[4]; GEN nf, aux, H, Y, M, A, suni, sunitrel, futu, tu, w; GEN prod, S1, S2; GEN res = cgetg(3,t_VEC); long L, i, drel, itu; if (typ(T) != t_VEC || lg(T) != 9) err(talker,"please apply rnfisnorminit first"); bnf = checkbnf(bnf); rel = checkbnf(rel); nf = checknf(bnf); x = basistoalg(nf,x); if (typ(x) != t_POLMOD) err(typeer, "rnfisnorm"); drel = degpol(relpol); if (gcmp0(x) || gcmp1(x) || (gcmp_1(x) && odd(drel))) { res[1] = (long)x; res[2] = un; return res; } /* build set T of ideals involved in the solutions */ prod = (GEN)T[5]; S1 = (GEN)T[6]; S2 = (GEN)T[7]; if (flag && !gcmp0((GEN)T[8])) err(warner,"useless flag in rnfisnorm: the extension is Galois"); if (flag > 0) { byteptr d = diffptr; long p = 0; if (maxprime() < flag) err(primer1); for(;;) { NEXT_PRIME_VIADIFF(p, d); if (p > flag) break; pr_append(nf,rel,stoi(p),&prod,&S1,&S2); } } else if (flag < 0) fa_pr_append(nf,rel,stoi(-flag),&prod,&S1,&S2); /* overkill: prime ideals dividing x would be enough */ fa_pr_append(nf,rel,idealnorm(nf,x), &prod,&S1,&S2); /* computation on T-units */ w = gmael3(rel,8,4,1); tu = gmael3(rel,8,4,2); futu = concatsp(check_units(rel,"rnfisnorm"), tu); suni = bnfsunit(bnf,S1,3); sunitrel = (GEN)bnfsunit(rel,S2,3)[1]; if (lg(sunitrel) > 1) sunitrel = lift_intern(basistoalg(rel,sunitrel)); sunitrel = concatsp(futu, sunitrel); A = lift(bnfissunit(bnf,suni,x)); L = lg(sunitrel); itu = lg(nf[6])-1; /* index of torsion unit in bnfsunit(nf) output */ M = cgetg(L+1,t_MAT); for (i=1; i<L; i++) { GEN u = poleval((GEN)sunitrel[i], theta); /* abstorel */ sunitrel[i] = (long)u; u = bnfissunit(bnf,suni, gnorm(u)); if (lg(u) == 1) err(bugparier,"rnfisnorm"); u[itu] = llift((GEN)u[itu]); /* lift root of 1 part */ M[i] = (long)u; } aux = zerocol(lg(A)-1); aux[itu] = (long)w; M[L] = (long)aux; H = hnfall0(M, 0); Y = gmul((GEN)H[2], inverseimage((GEN)H[1],A)); /* Y: sols of MY = A over Q */ setlg(Y, L); aux = factorback(sunitrel, gfloor(Y)); x = gdiv(x, gnorm(gmodulcp(lift(aux),relpol))); if (typ(x) == t_POLMOD && (typ(x[2]) != t_POL || !degpol(x[2]))) { x = (GEN)x[2]; /* rational number */ if (typ(x) == t_POL) x = (GEN)x[2]; } res[1] = (long)aux; res[2] = (long)x; return gerepilecopy(av, res);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/b8f7b3acc3955ff31c4ed1a197e5acaa057a5e98/buch4.c/clean/src/basemath/buch4.c |
|
Fq_gauss_get_col(GEN a, GEN b, GEN piv, long li, GEN T, GEN p) | Fq_gauss_get_col(GEN a, GEN b, GEN invpiv, long li, GEN T, GEN p) | Fq_gauss_get_col(GEN a, GEN b, GEN piv, long li, GEN T, GEN p){ GEN m, u=cgetg(li+1,t_COL); long i,j; u[li] = (long)FpXQ_mul((GEN)b[li], FpXQ_inv(piv,T,p), T,p); for (i=li-1; i>0; i--) { pari_sp av = avma; m = (GEN)b[i]; for (j=i+1; j<=li; j++) m = gsub(m, gmul(gcoeff(a,i,j), (GEN)u[j])); m = FpX_res(m, T,p); u[i] = lpileupto(av, FpXQ_mul(m, FpXQ_inv(gcoeff(a,i,i), T,p), T,p)); } return u;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/0413a80bd91a41fc053e0149a3c6bf7d1e6f290c/alglin1.c/buggy/src/basemath/alglin1.c |
u[li] = (long)FpXQ_mul((GEN)b[li], FpXQ_inv(piv,T,p), T,p); | u[li] = (long)FpXQ_mul((GEN)b[li], invpiv, T,p); | Fq_gauss_get_col(GEN a, GEN b, GEN piv, long li, GEN T, GEN p){ GEN m, u=cgetg(li+1,t_COL); long i,j; u[li] = (long)FpXQ_mul((GEN)b[li], FpXQ_inv(piv,T,p), T,p); for (i=li-1; i>0; i--) { pari_sp av = avma; m = (GEN)b[i]; for (j=i+1; j<=li; j++) m = gsub(m, gmul(gcoeff(a,i,j), (GEN)u[j])); m = FpX_res(m, T,p); u[i] = lpileupto(av, FpXQ_mul(m, FpXQ_inv(gcoeff(a,i,i), T,p), T,p)); } return u;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/0413a80bd91a41fc053e0149a3c6bf7d1e6f290c/alglin1.c/buggy/src/basemath/alglin1.c |
if (i==nb-1 && !isprime(gmael(fa,1,i))) p1 = powgi(gmael(fa,1,i),shifti(addis(e,1),-1)); | p1 = powgi(p,shifti(e,-1)); if ( i==nb-1 ) { if ( mod2(e) && !isprime(p) ) p1 = mulii(p1,p); } | indexpartial(GEN P){ ulong av = avma; long i, nb; GEN fa, p1, res = gun, dP,DP; dP = derivpol(P); if(DEBUGLEVEL>=5) gentimer(3); DP = ZX_disc(P); if(DEBUGLEVEL>=5) genmsgtimer(3,"IndexPartial: discriminant"); fa = auxdecomp(DP, 0); if(DEBUGLEVEL>=5) genmsgtimer(3,"IndexPartial: factorization"); nb = lg(fa[1]); for (i = 1; i < nb; i++) { GEN e=gmael(fa,2,i); if (DEBUGLEVEL>=5) gentimer(3); if (i==nb-1 && !isprime(gmael(fa,1,i))) p1 = powgi(gmael(fa,1,i),shifti(addis(e,1),-1)); else { p1 = powgi(gmael(fa,1,i),shifti(e,-1)); if (cmpis(e,2)>=0) p1=mppgcd(p1,respm(P,dP,p1)); } res=mulii(res,p1); if(DEBUGLEVEL>=5) genmsgtimer(3,"IndexPartial: factor %Z",p1); } return gerepileupto(av,res);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/440762184b16fece84642e8381efc1c815eca86e/galconj.c/buggy/src/basemath/galconj.c |
p1 = powgi(gmael(fa,1,i),shifti(e,-1)); if (cmpis(e,2)>=0) | if ( cmpis(e,2)>=0 ) | indexpartial(GEN P){ ulong av = avma; long i, nb; GEN fa, p1, res = gun, dP,DP; dP = derivpol(P); if(DEBUGLEVEL>=5) gentimer(3); DP = ZX_disc(P); if(DEBUGLEVEL>=5) genmsgtimer(3,"IndexPartial: discriminant"); fa = auxdecomp(DP, 0); if(DEBUGLEVEL>=5) genmsgtimer(3,"IndexPartial: factorization"); nb = lg(fa[1]); for (i = 1; i < nb; i++) { GEN e=gmael(fa,2,i); if (DEBUGLEVEL>=5) gentimer(3); if (i==nb-1 && !isprime(gmael(fa,1,i))) p1 = powgi(gmael(fa,1,i),shifti(addis(e,1),-1)); else { p1 = powgi(gmael(fa,1,i),shifti(e,-1)); if (cmpis(e,2)>=0) p1=mppgcd(p1,respm(P,dP,p1)); } res=mulii(res,p1); if(DEBUGLEVEL>=5) genmsgtimer(3,"IndexPartial: factor %Z",p1); } return gerepileupto(av,res);} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/440762184b16fece84642e8381efc1c815eca86e/galconj.c/buggy/src/basemath/galconj.c |
if ( (temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_1 << 16))) || (temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_0 << 16))) | if ((temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_0 << 16))) | void VIA_isa_bridge_interrupts_setup(void){ pci_isa_bridge_device pci_dev; unsigned int temp; unsigned char tmp; unsigned char maxBus; unsigned found = 0; maxBus = BusCountPCI(); pci_dev.function = 0; /* Assumes the bidge is the first function */ for (pci_dev.bus = 0; pci_dev.bus < maxBus; pci_dev.bus++) {#ifdef SCAN_PCI_PRINT printk("isa_bridge_interrupts_setup: Scanning bus %d\n", pci_dev.bus);#endif for (pci_dev.device = 0; pci_dev.device < PCI_MAX_DEVICES; pci_dev.device++) {#ifdef SCAN_PCI_PRINT printk("isa_bridge_interrupts_setup: Scanning device %d\n", pci_dev.device);#endif pci_read_config_dword(pci_dev.bus, pci_dev.device, pci_dev.function, PCI_VENDOR_ID, &temp);#ifdef SCAN_PCI_PRINT printk("Vendor/device = %x\n", temp);#endif if ( (temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_1 << 16))) || (temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_0 << 16))) ) { bridge = pci_dev; via_82c586 = &bridge;#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS /* * Should print : bus = 0, device = 11, function = 0 on a MCP750. */ printk("Via PCI/ISA bridge found at bus = %d, device = %d, function = %d\n", via_82c586->bus, via_82c586->device, via_82c586->function);#endif found = 1; goto loop_exit; } } }loop_exit: if (!found) BSP_panic("VIA_82C586 PCI/ISA bridge not found!n"); tmp = inb(0x810); if ( !(tmp & 0x2)) {#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk("This is a second generation MCP750 board\n"); printk("We must reprogram the PCI/ISA bridge...\n");#endif pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);#endif /* * Enable 4D0/4D1 ISA interrupt level/edge config registers */ tmp |= 0x20; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp); /* * Now program the ISA interrupt edge/level */ tmp = ELCRS_INT9_LVL | ELCRS_INT10_LVL | ELCRS_INT11_LVL; outb(tmp, ISA8259_S_ELCR); tmp = ELCRM_INT5_LVL; outb(tmp, ISA8259_M_ELCR);; /* * Set the Interrupt inputs to non-inverting level interrupt */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x54, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);#endif tmp = 0; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x54, tmp); } else {#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk("This is a first generation MCP750 board\n"); printk("We just show the actual value used by PCI/ISA bridge\n");#endif pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);#endif /* * Enable 4D0/4D1 ISA interrupt level/edge config registers */ tmp |= 0x20; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS tmp = inb(ISA8259_S_ELCR); printk(" PCI ISA bridge slave edge/level control bit = %x\n", (unsigned) tmp); tmp = inb(ISA8259_M_ELCR);; printk(" PCI ISA bridge master edge/level control bit = %x\n", (unsigned) tmp);#endif /* * Must disable the 4D0/4D1 ISA interrupt level/edge config registers * or the card will die a soon as we we will enable external interrupts */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp); tmp &= ~(0x20); pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp); /* * Show the Interrupt inputs inverting/non-inverting level status */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x54, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);#endif }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/338f1dc186d23648ebbfcf583f637b40ace19378/irq_init.c/buggy/c/src/lib/libbsp/powerpc/shared/irq/irq_init.c |
* Enable 4D0/4D1 ISA interrupt level/edge config registers */ tmp |= 0x20; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp); #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS tmp = inb(ISA8259_S_ELCR); printk(" PCI ISA bridge slave edge/level control bit = %x\n", (unsigned) tmp); tmp = inb(ISA8259_M_ELCR);; printk(" PCI ISA bridge master edge/level control bit = %x\n", (unsigned) tmp); #endif /* * Must disable the 4D0/4D1 ISA interrupt level/edge config registers * or the card will die a soon as we we will enable external interrupts */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp); tmp &= ~(0x20); pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp); /* | void VIA_isa_bridge_interrupts_setup(void){ pci_isa_bridge_device pci_dev; unsigned int temp; unsigned char tmp; unsigned char maxBus; unsigned found = 0; maxBus = BusCountPCI(); pci_dev.function = 0; /* Assumes the bidge is the first function */ for (pci_dev.bus = 0; pci_dev.bus < maxBus; pci_dev.bus++) {#ifdef SCAN_PCI_PRINT printk("isa_bridge_interrupts_setup: Scanning bus %d\n", pci_dev.bus);#endif for (pci_dev.device = 0; pci_dev.device < PCI_MAX_DEVICES; pci_dev.device++) {#ifdef SCAN_PCI_PRINT printk("isa_bridge_interrupts_setup: Scanning device %d\n", pci_dev.device);#endif pci_read_config_dword(pci_dev.bus, pci_dev.device, pci_dev.function, PCI_VENDOR_ID, &temp);#ifdef SCAN_PCI_PRINT printk("Vendor/device = %x\n", temp);#endif if ( (temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_1 << 16))) || (temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_0 << 16))) ) { bridge = pci_dev; via_82c586 = &bridge;#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS /* * Should print : bus = 0, device = 11, function = 0 on a MCP750. */ printk("Via PCI/ISA bridge found at bus = %d, device = %d, function = %d\n", via_82c586->bus, via_82c586->device, via_82c586->function);#endif found = 1; goto loop_exit; } } }loop_exit: if (!found) BSP_panic("VIA_82C586 PCI/ISA bridge not found!n"); tmp = inb(0x810); if ( !(tmp & 0x2)) {#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk("This is a second generation MCP750 board\n"); printk("We must reprogram the PCI/ISA bridge...\n");#endif pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);#endif /* * Enable 4D0/4D1 ISA interrupt level/edge config registers */ tmp |= 0x20; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp); /* * Now program the ISA interrupt edge/level */ tmp = ELCRS_INT9_LVL | ELCRS_INT10_LVL | ELCRS_INT11_LVL; outb(tmp, ISA8259_S_ELCR); tmp = ELCRM_INT5_LVL; outb(tmp, ISA8259_M_ELCR);; /* * Set the Interrupt inputs to non-inverting level interrupt */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x54, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);#endif tmp = 0; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x54, tmp); } else {#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk("This is a first generation MCP750 board\n"); printk("We just show the actual value used by PCI/ISA bridge\n");#endif pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);#endif /* * Enable 4D0/4D1 ISA interrupt level/edge config registers */ tmp |= 0x20; pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS tmp = inb(ISA8259_S_ELCR); printk(" PCI ISA bridge slave edge/level control bit = %x\n", (unsigned) tmp); tmp = inb(ISA8259_M_ELCR);; printk(" PCI ISA bridge master edge/level control bit = %x\n", (unsigned) tmp);#endif /* * Must disable the 4D0/4D1 ISA interrupt level/edge config registers * or the card will die a soon as we we will enable external interrupts */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, &tmp); tmp &= ~(0x20); pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x47, tmp); /* * Show the Interrupt inputs inverting/non-inverting level status */ pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function, 0x54, &tmp);#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);#endif }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/338f1dc186d23648ebbfcf583f637b40ace19378/irq_init.c/buggy/c/src/lib/libbsp/powerpc/shared/irq/irq_init.c |
|
(void)sprintf(s, SIZE, "not compiled in"); | (void)sprintf(s, "not compiled in"); | what_readline(char **buf){ char *s;#ifdef READLINE char *ver, *extra = stackmalloc(strlen(READLINE) + 32);# if defined(HAS_RL_LIBRARY_VERSION) || defined(FAKE_RL_LIBRARY_VERSION)# ifdef FAKE_RL_LIBRARY_VERSION extern char *rl_library_version;# endif if (strcmp(READLINE, rl_library_version)) { ver = (char*)rl_library_version; (void)sprintf(extra, " [was v%s in Configure]", READLINE); } else# endif { ver = READLINE; extra[0] = 0; } s = stackmalloc(3 + strlen(ver) + 8 + strlen(extra)); (void)sprintf(s, "v%s %s%s", ver, (GP_DATA->flags & USE_READLINE)? "enabled": "disabled", extra);#else s = stackmalloc(32); (void)sprintf(s, SIZE, "not compiled in");#endif *buf = s;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8133d487520228b68ba0f79ecfa8f852e980d940/gp.c/buggy/src/gp/gp.c |
if (l1>LGBITS) l1=LGBITS; | if ((ulong)l1>LGBITS) l1=LGBITS; | sfcont(GEN x, GEN x1, long k){ long av,lx=lg(x),tx=typ(x),e,i,j,l,l1,lx1,tetpil,f; GEN y,p1,p2,p3,p4,yp; if (is_scalar_t(tx)) { if (gcmp0(x)) { y=cgetg(2,t_VEC); y[1]=zero; return y; } switch(tx) { case t_INT: y=cgetg(2,t_VEC); y[1]=lcopy(x); return y; case t_REAL: l=avma; p1=cgetg(3,t_FRACN); p2 = rcopy(x); settyp(p2,t_INT); setlgefint(p2,lx); p1[1] = (long) p2; e = bit_accuracy(lx)-1-expo(x); if (e<0) err(talker,"integral part not significant in scfont"); l1 = (e>>TWOPOTBITS_IN_LONG)+3; p2=cgeti(l1); p2[1]= evalsigne(1)|evallgefint(l1); p2[2]= (1L<<(e&(BITS_IN_LONG-1))); for (i=3; i<l1; i++) p2[i]=0; p1[2]=(long) p2; p3=cgetg(3,t_FRACN); p3[2]=lcopy(p2); p3[1]=laddsi(signe(x),(GEN)p1[1]); p1=sfcont(p1,p1,k); tetpil=avma; return gerepile(l,tetpil,sfcont(p3,p1,k)); case t_FRAC: case t_FRACN: l=avma; lx1=lgefint(x[2]); l1 = (long) ((double) BYTES_IN_LONG/4.0*46.093443*(lx1-2)+3); if (k>0 && ++k > 0 && l1 > k) l1 = k; /* beware overflow */ if (l1>LGBITS) l1=LGBITS; if (lgefint(x[1]) >= lx1) p1=icopy((GEN)x[1]); else affii((GEN)x[1],p1=cgeti(lx1)); p2=icopy((GEN)x[2]); lx1=lg(x1); y=cgetg(l1,t_VEC); f=(x!=x1); i=0; while (!gcmp0(p2) && i<=l1-2) { i++; y[i]=ldvmdii(p1,p2,&p3); if (signe(p3)>=0) affii(p3,p1); else { p4=addii(p3,p2); affii(p4,p1); cgiv(p4); y[1]=laddsi(-1,(GEN)y[1]); } cgiv(p3); p4=p1; p1=p2; p2=p4; if (f) { if (i>=lx1) { i--; break; } if (!egalii((GEN)y[i],(GEN)x1[i])) { av=avma; if (gcmp1(absi(subii((GEN)x1[i],(GEN)y[i])))) { if (i>=lx1-1 || !gcmp1((GEN)x1[i+1])) affii((GEN)x1[i],(GEN)y[i]); } else i--; avma=av; break; } } } if (i>=2 && gcmp1((GEN)y[i])) { cgiv((GEN)y[i]); --i; cgiv((GEN)y[i]); y[i]=laddsi(1,(GEN)y[i]); } setlg(y,i+1); return gerepileupto(l, y); } err(typeer,"sfcont"); } switch(tx) { case t_POL: y=cgetg(2,t_VEC); y[1]=lcopy(x); break; case t_SER: av=avma; p1=gtrunc(x); tetpil=avma; y=gerepile(av,tetpil,sfcont(p1,p1,k)); break; case t_RFRAC: case t_RFRACN: av=avma; l1=lgef(x[1]); if (lgef(x[2])>l1) l1=lgef(x[2]); if (k>0 && l1>k+1) l1=k+1; yp=cgetg(l1,t_VEC); p1=(GEN)x[1]; i=0; p2=(GEN)x[2]; while (!gcmp0(p2) && i<=l1-2) { i++; yp[i]=ldivres(p1,p2,&p3); p1=p2; p2=p3; } tetpil=avma; y=cgetg(i+1,t_VEC); for (j=1; j<=i; j++) y[j]=lcopy((GEN)yp[j]); y=gerepile(av,tetpil,y); break; default: err(typeer,"sfcont"); return NULL; /* not reached */ } return y;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/9749d3e46caef3f61b412b608c8ac51b8f010460/arith1.c/buggy/src/basemath/arith1.c |
case PPC_7455: | case PPC_7455: | 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_5XX: case PPC_603: case PPC_603ev: case PPC_604: case PPC_604r: case PPC_750: case PPC_7400: case PPC_7455: case PPC_604e: case PPC_620: case PPC_860: case PPC_8260: case PPC_8245: return current_ppc_cpu; default: printk("Unknown PVR value of 0x%x. Please add it to " "<libcpu/powerpc/shared/include/cpuIdent.c>\n", pvr ); return PPC_UNKNOWN; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/56c4caeca69e71a42370d1171428a9091bdb6e77/cpuIdent.c/clean/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c |
powsubFBgen(GEN nf,GEN subFB,long a,long prec,long precint) | powsubFBgen(GEN nf,GEN subFB,long a,long prec) | powsubFBgen(GEN nf,GEN subFB,long a,long prec,long precint){ long i,j, n = lg(subFB); GEN *pow, arch0 = (GEN)init_idele(nf)[2]; if (DEBUGLEVEL) fprintferr("Computing powers for sub-factor base:\n"); powsubFB = cgetg(n, t_VEC); for (i=1; i<n; i++) { GEN vp = (GEN)vectbase[subFB[i]]; GEN z = cgetg(3,t_VEC); z[1]=vp[1]; z[2]=vp[2]; pow = (GEN*)cgetg(a+1,t_VEC); powsubFB[i] = (long)pow; pow[1]=cgetg(3,t_VEC); pow[1][1] = (long)z; pow[1][2] = (long)arch0; vp = prime_to_ideal(nf,vp); for (j=2; j<=a; j++) { pow[j] = mulred(nf,pow[j-1],vp,prec,precint); if (DEBUGLEVEL>1) fprintferr(" %ld",j); } if (DEBUGLEVEL>1) { fprintferr("\n"); flusherr(); } } if (DEBUGLEVEL) { if (DEBUGLEVEL>7) { fprintferr("**** POWERS IN SUB-FACTOR BASE ****\n\n"); for (i=1; i<n; i++) { fprintferr("powsubFB[%ld]:\n",i); for (j=1; j<=a; j++) fprintferr("^%ld = %Z\n", j,mael(powsubFB,i,j)); fprintferr("\n"); } } msgtimer("powsubFBgen"); }} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/df4471290da20ed117d7634b848dd9a8940d48d1/buch2.c/clean/src/basemath/buch2.c |
pow[j] = mulred(nf,pow[j-1],vp,prec,precint); | pow[j] = mulred(nf,pow[j-1],vp,prec); | powsubFBgen(GEN nf,GEN subFB,long a,long prec,long precint){ long i,j, n = lg(subFB); GEN *pow, arch0 = (GEN)init_idele(nf)[2]; if (DEBUGLEVEL) fprintferr("Computing powers for sub-factor base:\n"); powsubFB = cgetg(n, t_VEC); for (i=1; i<n; i++) { GEN vp = (GEN)vectbase[subFB[i]]; GEN z = cgetg(3,t_VEC); z[1]=vp[1]; z[2]=vp[2]; pow = (GEN*)cgetg(a+1,t_VEC); powsubFB[i] = (long)pow; pow[1]=cgetg(3,t_VEC); pow[1][1] = (long)z; pow[1][2] = (long)arch0; vp = prime_to_ideal(nf,vp); for (j=2; j<=a; j++) { pow[j] = mulred(nf,pow[j-1],vp,prec,precint); if (DEBUGLEVEL>1) fprintferr(" %ld",j); } if (DEBUGLEVEL>1) { fprintferr("\n"); flusherr(); } } if (DEBUGLEVEL) { if (DEBUGLEVEL>7) { fprintferr("**** POWERS IN SUB-FACTOR BASE ****\n\n"); for (i=1; i<n; i++) { fprintferr("powsubFB[%ld]:\n",i); for (j=1; j<=a; j++) fprintferr("^%ld = %Z\n", j,mael(powsubFB,i,j)); fprintferr("\n"); } } msgtimer("powsubFBgen"); }} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/df4471290da20ed117d7634b848dd9a8940d48d1/buch2.c/clean/src/basemath/buch2.c |
GEN p1, P = (GEN)x[1], b = (GEN)P[3], c = (GEN)P[2]; | GEN z, P, b, c, u = (GEN)x[2], v = (GEN)x[3]; | qtop(GEN x, GEN p, long d){ GEN p1, P = (GEN)x[1], b = (GEN)P[3], c = (GEN)P[2]; pari_sp av; if (gcmp0(x)) return zeropadic(p, d); av = avma; p1 = gsqrt(cvtop(subii(b, shifti(c,2)), p, egalii(p,gdeux)? d+2: d), 0); p1 = gmul2n(gsub(p1, b), -1); return gerepileupto(av, gadd((GEN)x[2], gmul((GEN)x[3], p1)));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/51c79d34cfaaf11cf2dc21314b36586a0e7a306e/gen2.c/buggy/src/basemath/gen2.c |
if (gcmp0(x)) return zeropadic(p, d); av = avma; p1 = gsqrt(cvtop(subii(b, shifti(c,2)), p, egalii(p,gdeux)? d+2: d), 0); p1 = gmul2n(gsub(p1, b), -1); return gerepileupto(av, gadd((GEN)x[2], gmul((GEN)x[3], p1))); | if (gcmp0(v)) return cvtop(u, p, d); P = (GEN)x[1]; b = (GEN)P[3]; c = (GEN)P[2]; av = avma; z = gsqrt(cvtop(subii(b, shifti(c,2)), p, egalii(p,gdeux)? d+2: d), 0); z = gmul2n(gsub(z, b), -1); return gerepileupto(av, gadd(u, gmul(v, z))); | qtop(GEN x, GEN p, long d){ GEN p1, P = (GEN)x[1], b = (GEN)P[3], c = (GEN)P[2]; pari_sp av; if (gcmp0(x)) return zeropadic(p, d); av = avma; p1 = gsqrt(cvtop(subii(b, shifti(c,2)), p, egalii(p,gdeux)? d+2: d), 0); p1 = gmul2n(gsub(p1, b), -1); return gerepileupto(av, gadd((GEN)x[2], gmul((GEN)x[3], p1)));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/51c79d34cfaaf11cf2dc21314b36586a0e7a306e/gen2.c/buggy/src/basemath/gen2.c |
sigemptyset( &old_mask ); | unsigned32 _CPU_ISR_Disable_support(void){ int status; sigset_t old_mask; status = sigprocmask(SIG_BLOCK, &_CPU_Signal_mask, &old_mask); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_CORE, TRUE, status ); if (memcmp((void *)&posix_empty_mask, (void *)&old_mask, sizeof(sigset_t))) return 1; return 0;} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/d83c39dc368a30fc6dd3928961c712014d5d8bca/cpu.c/buggy/cpukit/score/cpu/unix/cpu.c |
|
settyp(C, t_VEC); return gerepileupto(av, gcopy(C)); | settyp(C, t_VEC); return gerepilecopy(av, C); | polcompositum0(GEN A, GEN B, long flall){ ulong av = avma; long v,k; GEN C, LPRS; if (typ(A)!=t_POL || typ(B)!=t_POL) err(typeer,"polcompositum0"); if (degpol(A)<=0 || degpol(B)<=0) err(constpoler,"compositum"); v = varn(A); if (varn(B) != v) err(talker,"not the same variable in compositum"); C = content(A); if (!gcmp1(C)) A = gdiv(A, C); C = content(B); if (!gcmp1(C)) B = gdiv(B, C); check_pol_int(A,"compositum"); check_pol_int(B,"compositum"); if (!ZX_is_squarefree(A)) err(talker,"compositum: %Z not separable", A); if (!ZX_is_squarefree(B)) err(talker,"compositum: %Z not separable", B); k = 1; C = ZY_ZXY_resultant_all(A, B, &k, flall? &LPRS: NULL); C = squff2(C,0,0); /* C = Res_Y (A, B(X + kY)) guaranteed squarefree */ if (flall) { long i,l = lg(C); GEN w,a,b; /* a,b,c root of A,B,C = compositum, c = b - k a */ for (i=1; i<l; i++) { /* invmod possibly very costly */ a = gmul((GEN)LPRS[1], ZX_invmod((GEN)LPRS[2], (GEN)C[i])); a = gneg_i(gmod(a, (GEN)C[i])); b = gadd(polx[v], gmulsg(k,a)); w = cgetg(5,t_VEC); /* [C, a, b, n ] */ w[1] = C[i]; w[2] = (long)to_polmod(a, (GEN)w[1]); w[3] = (long)to_polmod(b, (GEN)w[1]); w[4] = lstoi(-k); C[i] = (long)w; } } settyp(C, t_VEC); return gerepileupto(av, gcopy(C));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/7168973a923818508c45aa17d871c53e9225fad1/base2.c/buggy/src/basemath/base2.c |
killv = (avma != (long)pol); | killv = (avma != (ulong)pol); | factor(GEN x){ long tx=typ(x),lx,av,tetpil,i,j,pa,v,r1; GEN y,p,p1,p2,p3,p4,p5,pol; if (is_matvec_t(tx)) { lx=lg(x); y=cgetg(lx,tx); for (i=1; i<lx; i++) y[i]=(long)factor((GEN)x[i]); return y; } if (gcmp0(x)) { y=cgetg(3,t_MAT); p1=cgetg(2,t_COL); y[1]=(long)p1; p1[1]=lcopy(x); p2=cgetg(2,t_COL); y[2]=(long)p2; p2[1]=un; return y; } av = avma; switch(tx) { case t_INT: return decomp(x); case t_FRACN: x = gred(x); /* fall through */ case t_FRAC: p1 = decomp((GEN)x[1]); p2 = decomp((GEN)x[2]); p2[2] = (long)gneg_i((GEN)p2[2]); return gerepileupto(av, gcopy(merge_factor_i(p1,p2))); case t_POL: tx=poltype(x,&p,&pol,&pa); switch(tx) { case 0: err(impl,"factor for general polynomials"); case t_INT: return factpol(x,0,1); case t_INTMOD: return factmod(x,p); case t_COMPLEX: y=cgetg(3,t_MAT); lx=lgef(x)-2; v=varn(x); p1=roots(x,pa); tetpil=avma; p2=cgetg(lx,t_COL); for (i=1; i<lx; i++) p2[i] = (long)deg1pol_i(gun, gneg((GEN)p1[i]), v); y[1]=lpile(av,tetpil,p2); p3=cgetg(lx,t_COL); for (i=1; i<lx; i++) p3[i] = un; y[2]=(long)p3; return y; case t_REAL: y=cgetg(3,t_MAT); lx=lgef(x)-2; v=varn(x); av=avma; p1=roots(x,pa); tetpil=avma; for(r1=1; r1<lx; r1++) if (signe(gmael(p1,r1,2))) break; lx=(r1+lx)>>1; p2=cgetg(lx,t_COL); for(i=1; i<r1; i++) p2[i] = (long)deg1pol_i(gun, negr(gmael(p1,i,1)), v); for( ; i<lx; i++) { GEN a = (GEN) p1[2*i-r1]; p = cgetg(5, t_POL); p2[i] = (long)p; p[1] = evalsigne(1) | evalvarn(v) | evallgef(5); p[2] = lnorm(a); p[3] = lmul2n((GEN)a[1],1); setsigne(p[3],-signe(p[3])); p[4] = un; } y[1]=lpile(av,tetpil,p2); p3=cgetg(lx,t_COL); for (i=1; i<lx; i++) p3[i] = un; y[2]=(long)p3; return y; case t_PADIC: return factorpadic4(x,p,pa); default: { long killv; x = dummycopy(x); lx=lgef(x); pol = dummycopy(pol); v = manage_var(4,NULL); for(i=2; i<lx; i++) { p1=(GEN)x[i]; switch(typ(p1)) { case t_QUAD: p1++; case t_COMPLEX: p2 = cgetg(3, t_POLMOD); x[i] = (long) p2; p2[1] = (long)pol; p2[2] = (long)deg1pol_i((GEN)p1[2], (GEN)p1[1], v); } } killv = (avma != (long)pol); if (killv) setvarn(pol, fetch_var()); switch (typ2(tx)) { case t_INT: p1 = polfnf(x,pol); break; case t_INTMOD: p1 = factmod9(x,p,pol); break; default: err(impl,"factor of general polynomial"); return NULL; /* not reached */ } switch (typ1(tx)) { case t_POLMOD: if (killv) delete_var(); return gerepileupto(av,p1); case t_COMPLEX: p5 = gi; break; case t_QUAD: p5=cgetg(4,t_QUAD); p5[1]=(long)pol; p5[2]=zero; p5[3]=un; break; default: err(impl,"factor of general polynomial"); return NULL; /* not reached */ } p2=(GEN)p1[1]; for(i=1; i<lg(p2); i++) { p3=(GEN)p2[i]; for(j=2; j<lgef(p3); j++) { p4=(GEN)p3[j]; if(typ(p4)==t_POLMOD) p3[j]=lsubst((GEN)p4[2],v,p5); } } if (killv) delete_var(); tetpil=avma; y=cgetg(3,t_MAT); y[1]=lcopy(p2);y[2]=lcopy((GEN)p1[2]); return gerepile(av,tetpil,y); } } case t_RFRACN: x=gred_rfrac(x); /* fall through */ case t_RFRAC: p1=factor((GEN)x[1]); p2=factor((GEN)x[2]); p3=gneg_i((GEN)p2[2]); tetpil=avma; y=cgetg(3,t_MAT); y[1]=lconcat((GEN)p1[1],(GEN)p2[1]); y[2]=lconcat((GEN)p1[2],p3); return gerepile(av,tetpil,y); } err(talker,"can't factor %Z",x); return NULL; /* not reached */} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/9749d3e46caef3f61b412b608c8ac51b8f010460/polarit2.c/clean/src/basemath/polarit2.c |
tty->rawOutBufState = rob_busy; | osend (const char *buf, int len, struct rtems_termios_tty *tty){ unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (!tty->device.outputUsesInterrupts) { (*tty->device.write)(tty->minor, buf, len); return; } newHead = tty->rawOutBufHead; while (len) { /* * Performance improvement could be made here. * Copy multiple bytes to raw buffer: * if (len > 1) && (space to buffer end, or tail > 1) * ncopy = MIN (len, space to buffer end or tail) * memcpy (raw buffer, buf, ncopy) * buf += ncopy * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE; rtems_interrupt_disable (level); while (newHead == tty->rawOutBufTail) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf[tty->rawOutBufHead] = *buf++; tty->rawOutBufHead = newHead; if (tty->rawOutBufState == rob_idle) { tty->rawOutBufState = rob_busy; (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1); } rtems_interrupt_enable (level); len--; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b3fd16416cc283f2c8340ac7cb06270cf51adb5f/termios.c/buggy/cpukit/libcsupport/src/termios.c |
|
tty->rawOutBufState = rob_busy; | osend (const char *buf, int len, struct rtems_termios_tty *tty){ unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (!tty->device.outputUsesInterrupts) { (*tty->device.write)(tty->minor, buf, len); return; } newHead = tty->rawOutBufHead; while (len) { /* * Performance improvement could be made here. * Copy multiple bytes to raw buffer: * if (len > 1) && (space to buffer end, or tail > 1) * ncopy = MIN (len, space to buffer end or tail) * memcpy (raw buffer, buf, ncopy) * buf += ncopy * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE; rtems_interrupt_disable (level); while (newHead == tty->rawOutBufTail) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf[tty->rawOutBufHead] = *buf++; tty->rawOutBufHead = newHead; if (tty->rawOutBufState == rob_idle) { tty->rawOutBufState = rob_busy; (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1); } rtems_interrupt_enable (level); len--; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b3fd16416cc283f2c8340ac7cb06270cf51adb5f/termios.c/buggy/cpukit/libcsupport/src/termios.c |
|
float minx, miny, maxx, maxy; IPoint *ip; | IPoint vx, vy, tv; float xx,xy,yx,yy, det; | void svg_render_solid(SDL_svg_context *c){int i,j;int colorstops;//void (*renderfunc)(SDL_svg_context *c, int x, int y, int w);float minx, miny, maxx, maxy;IPoint *ip;IPoint *path;svg_paint_t *paint;const svg_color_t *rgb;int alpha; c->renderfunc = 0; path = c->path; minx=miny = 0x7fffffff; maxx=maxy =-0x7fffffff; for(i=0, ip=path;i<c->numpoints;++i,++ip) { if(ip->x<minx) minx=ip->x; if(ip->x>maxx) maxx=ip->x; if(ip->y<miny) miny=ip->y; if(ip->y>maxy) maxy=ip->y; } paint = c->paint; switch(paint->type) { case SVG_PAINT_TYPE_COLOR: rgb = &paint->p.color; alpha = 255.0 * c->FillOpacity; c->solidcolor = maprgb(c->surface, svg_color_get_red(rgb), svg_color_get_green(rgb), svg_color_get_blue(rgb)) | (alpha << 24); c->renderfunc = solidstrip; break; case SVG_PAINT_TYPE_GRADIENT: colorstops = paint->p.gradient->num_stops; for(i=0;i<colorstops-1;++i) { int c1,c2; int r1,g1,b1,a1,r2,g2,b2,a2; unsigned long t; int v; c1=NUM_GRADIENT_COLORS*i/(colorstops-1); c2=NUM_GRADIENT_COLORS*(i+1)/(colorstops-1); t=paint->p.gradient->stops[i].color.rgb; a1=255.0 * paint->p.gradient->stops[i].opacity; r1 = (t>>16) & 255; g1 = (t>>8) & 255; b1 = t & 255; t=paint->p.gradient->stops[i+1].color.rgb; a2=255.0 * paint->p.gradient->stops[i+1].opacity; r2 = (t>>16) & 255; g2 = (t>>8) & 255; b2 = t & 255; r2-=r1; g2-=g1; b2-=b1; a2-=a1; v=c2-c1-1; for(j=0;j<=v;++j) { c->gradient_colors[c1+j]=maprgb(c->surface, r1 + r2*j/v, g1 + g2*j/v, b1 + b2*j/v) | ((a1 + a2*j/v)<<24); } } c->gradient_policy = paint->p.gradient->spread; if (paint->p.gradient->type == SVG_GRADIENT_LINEAR) { c->renderfunc = lineargradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.linear.x1.value, paint->p.gradient->u.linear.y1.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.linear.x2.value, paint->p.gradient->u.linear.y2.value}; } else if(paint->p.gradient->type == SVG_GRADIENT_RADIAL) { c->renderfunc = radialgradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.radial.cx.value, paint->p.gradient->u.radial.cy.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.radial.fx.value, paint->p.gradient->u.radial.fy.value}; c->gradient_r = paint->p.gradient->u.radial.r.value; } else c->renderfunc = 0; if(paint->p.gradient->units==SVG_GRADIENT_UNITS_USER) { c->gradient_p1 = FixCoords(c, c->gradient_p1); c->gradient_p2 = FixCoords(c, c->gradient_p2); c->gradient_r = FixSizes(c, (IPoint) {c->gradient_r, 0.0}).x; } else // BBOX { c->gradient_p1 = (IPoint) {minx + c->gradient_p1.x * (maxx - minx + 1), miny + c->gradient_p1.y * (maxy - miny + 1)}; c->gradient_p2 = (IPoint) {minx + c->gradient_p2.x * (maxx - minx + 1), miny + c->gradient_p2.y * (maxy - miny + 1)}; c->gradient_r = c->gradient_r * (maxx - minx + 1); } break; default: c->renderfunc = 0; break; } do_render(c);} | 1561 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1561/2ffd9ca885a57849f9fbafa985ba5ebc76eb8d74/render.c/clean/render.c |
minx=miny = 0x7fffffff; maxx=maxy =-0x7fffffff; | tv = FixCoords(c, (IPoint) {c->minx, c->miny}); vx = FixCoords(c, (IPoint) {c->maxx, c->miny}); vy = FixCoords(c, (IPoint) {c->minx, c->maxy}); | void svg_render_solid(SDL_svg_context *c){int i,j;int colorstops;//void (*renderfunc)(SDL_svg_context *c, int x, int y, int w);float minx, miny, maxx, maxy;IPoint *ip;IPoint *path;svg_paint_t *paint;const svg_color_t *rgb;int alpha; c->renderfunc = 0; path = c->path; minx=miny = 0x7fffffff; maxx=maxy =-0x7fffffff; for(i=0, ip=path;i<c->numpoints;++i,++ip) { if(ip->x<minx) minx=ip->x; if(ip->x>maxx) maxx=ip->x; if(ip->y<miny) miny=ip->y; if(ip->y>maxy) maxy=ip->y; } paint = c->paint; switch(paint->type) { case SVG_PAINT_TYPE_COLOR: rgb = &paint->p.color; alpha = 255.0 * c->FillOpacity; c->solidcolor = maprgb(c->surface, svg_color_get_red(rgb), svg_color_get_green(rgb), svg_color_get_blue(rgb)) | (alpha << 24); c->renderfunc = solidstrip; break; case SVG_PAINT_TYPE_GRADIENT: colorstops = paint->p.gradient->num_stops; for(i=0;i<colorstops-1;++i) { int c1,c2; int r1,g1,b1,a1,r2,g2,b2,a2; unsigned long t; int v; c1=NUM_GRADIENT_COLORS*i/(colorstops-1); c2=NUM_GRADIENT_COLORS*(i+1)/(colorstops-1); t=paint->p.gradient->stops[i].color.rgb; a1=255.0 * paint->p.gradient->stops[i].opacity; r1 = (t>>16) & 255; g1 = (t>>8) & 255; b1 = t & 255; t=paint->p.gradient->stops[i+1].color.rgb; a2=255.0 * paint->p.gradient->stops[i+1].opacity; r2 = (t>>16) & 255; g2 = (t>>8) & 255; b2 = t & 255; r2-=r1; g2-=g1; b2-=b1; a2-=a1; v=c2-c1-1; for(j=0;j<=v;++j) { c->gradient_colors[c1+j]=maprgb(c->surface, r1 + r2*j/v, g1 + g2*j/v, b1 + b2*j/v) | ((a1 + a2*j/v)<<24); } } c->gradient_policy = paint->p.gradient->spread; if (paint->p.gradient->type == SVG_GRADIENT_LINEAR) { c->renderfunc = lineargradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.linear.x1.value, paint->p.gradient->u.linear.y1.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.linear.x2.value, paint->p.gradient->u.linear.y2.value}; } else if(paint->p.gradient->type == SVG_GRADIENT_RADIAL) { c->renderfunc = radialgradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.radial.cx.value, paint->p.gradient->u.radial.cy.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.radial.fx.value, paint->p.gradient->u.radial.fy.value}; c->gradient_r = paint->p.gradient->u.radial.r.value; } else c->renderfunc = 0; if(paint->p.gradient->units==SVG_GRADIENT_UNITS_USER) { c->gradient_p1 = FixCoords(c, c->gradient_p1); c->gradient_p2 = FixCoords(c, c->gradient_p2); c->gradient_r = FixSizes(c, (IPoint) {c->gradient_r, 0.0}).x; } else // BBOX { c->gradient_p1 = (IPoint) {minx + c->gradient_p1.x * (maxx - minx + 1), miny + c->gradient_p1.y * (maxy - miny + 1)}; c->gradient_p2 = (IPoint) {minx + c->gradient_p2.x * (maxx - minx + 1), miny + c->gradient_p2.y * (maxy - miny + 1)}; c->gradient_r = c->gradient_r * (maxx - minx + 1); } break; default: c->renderfunc = 0; break; } do_render(c);} | 1561 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1561/2ffd9ca885a57849f9fbafa985ba5ebc76eb8d74/render.c/clean/render.c |
for(i=0, ip=path;i<c->numpoints;++i,++ip) | c->e = -tv.x; c->f = -tv.y; xx = vx.x - tv.x; xy = vx.y - tv.y; yx = vy.x - tv.x; yy = vy.y - tv.y; det = xx*yy - xy*yx; if(det != 0.0) | void svg_render_solid(SDL_svg_context *c){int i,j;int colorstops;//void (*renderfunc)(SDL_svg_context *c, int x, int y, int w);float minx, miny, maxx, maxy;IPoint *ip;IPoint *path;svg_paint_t *paint;const svg_color_t *rgb;int alpha; c->renderfunc = 0; path = c->path; minx=miny = 0x7fffffff; maxx=maxy =-0x7fffffff; for(i=0, ip=path;i<c->numpoints;++i,++ip) { if(ip->x<minx) minx=ip->x; if(ip->x>maxx) maxx=ip->x; if(ip->y<miny) miny=ip->y; if(ip->y>maxy) maxy=ip->y; } paint = c->paint; switch(paint->type) { case SVG_PAINT_TYPE_COLOR: rgb = &paint->p.color; alpha = 255.0 * c->FillOpacity; c->solidcolor = maprgb(c->surface, svg_color_get_red(rgb), svg_color_get_green(rgb), svg_color_get_blue(rgb)) | (alpha << 24); c->renderfunc = solidstrip; break; case SVG_PAINT_TYPE_GRADIENT: colorstops = paint->p.gradient->num_stops; for(i=0;i<colorstops-1;++i) { int c1,c2; int r1,g1,b1,a1,r2,g2,b2,a2; unsigned long t; int v; c1=NUM_GRADIENT_COLORS*i/(colorstops-1); c2=NUM_GRADIENT_COLORS*(i+1)/(colorstops-1); t=paint->p.gradient->stops[i].color.rgb; a1=255.0 * paint->p.gradient->stops[i].opacity; r1 = (t>>16) & 255; g1 = (t>>8) & 255; b1 = t & 255; t=paint->p.gradient->stops[i+1].color.rgb; a2=255.0 * paint->p.gradient->stops[i+1].opacity; r2 = (t>>16) & 255; g2 = (t>>8) & 255; b2 = t & 255; r2-=r1; g2-=g1; b2-=b1; a2-=a1; v=c2-c1-1; for(j=0;j<=v;++j) { c->gradient_colors[c1+j]=maprgb(c->surface, r1 + r2*j/v, g1 + g2*j/v, b1 + b2*j/v) | ((a1 + a2*j/v)<<24); } } c->gradient_policy = paint->p.gradient->spread; if (paint->p.gradient->type == SVG_GRADIENT_LINEAR) { c->renderfunc = lineargradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.linear.x1.value, paint->p.gradient->u.linear.y1.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.linear.x2.value, paint->p.gradient->u.linear.y2.value}; } else if(paint->p.gradient->type == SVG_GRADIENT_RADIAL) { c->renderfunc = radialgradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.radial.cx.value, paint->p.gradient->u.radial.cy.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.radial.fx.value, paint->p.gradient->u.radial.fy.value}; c->gradient_r = paint->p.gradient->u.radial.r.value; } else c->renderfunc = 0; if(paint->p.gradient->units==SVG_GRADIENT_UNITS_USER) { c->gradient_p1 = FixCoords(c, c->gradient_p1); c->gradient_p2 = FixCoords(c, c->gradient_p2); c->gradient_r = FixSizes(c, (IPoint) {c->gradient_r, 0.0}).x; } else // BBOX { c->gradient_p1 = (IPoint) {minx + c->gradient_p1.x * (maxx - minx + 1), miny + c->gradient_p1.y * (maxy - miny + 1)}; c->gradient_p2 = (IPoint) {minx + c->gradient_p2.x * (maxx - minx + 1), miny + c->gradient_p2.y * (maxy - miny + 1)}; c->gradient_r = c->gradient_r * (maxx - minx + 1); } break; default: c->renderfunc = 0; break; } do_render(c);} | 1561 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1561/2ffd9ca885a57849f9fbafa985ba5ebc76eb8d74/render.c/clean/render.c |
if(ip->x<minx) minx=ip->x; if(ip->x>maxx) maxx=ip->x; if(ip->y<miny) miny=ip->y; if(ip->y>maxy) maxy=ip->y; } | c->a = yy / det; c->b = -yx / det; c->c = -xy / det; c->d = xx / det; } else c->a = c->b = c->c = c->d = 0.0; | void svg_render_solid(SDL_svg_context *c){int i,j;int colorstops;//void (*renderfunc)(SDL_svg_context *c, int x, int y, int w);float minx, miny, maxx, maxy;IPoint *ip;IPoint *path;svg_paint_t *paint;const svg_color_t *rgb;int alpha; c->renderfunc = 0; path = c->path; minx=miny = 0x7fffffff; maxx=maxy =-0x7fffffff; for(i=0, ip=path;i<c->numpoints;++i,++ip) { if(ip->x<minx) minx=ip->x; if(ip->x>maxx) maxx=ip->x; if(ip->y<miny) miny=ip->y; if(ip->y>maxy) maxy=ip->y; } paint = c->paint; switch(paint->type) { case SVG_PAINT_TYPE_COLOR: rgb = &paint->p.color; alpha = 255.0 * c->FillOpacity; c->solidcolor = maprgb(c->surface, svg_color_get_red(rgb), svg_color_get_green(rgb), svg_color_get_blue(rgb)) | (alpha << 24); c->renderfunc = solidstrip; break; case SVG_PAINT_TYPE_GRADIENT: colorstops = paint->p.gradient->num_stops; for(i=0;i<colorstops-1;++i) { int c1,c2; int r1,g1,b1,a1,r2,g2,b2,a2; unsigned long t; int v; c1=NUM_GRADIENT_COLORS*i/(colorstops-1); c2=NUM_GRADIENT_COLORS*(i+1)/(colorstops-1); t=paint->p.gradient->stops[i].color.rgb; a1=255.0 * paint->p.gradient->stops[i].opacity; r1 = (t>>16) & 255; g1 = (t>>8) & 255; b1 = t & 255; t=paint->p.gradient->stops[i+1].color.rgb; a2=255.0 * paint->p.gradient->stops[i+1].opacity; r2 = (t>>16) & 255; g2 = (t>>8) & 255; b2 = t & 255; r2-=r1; g2-=g1; b2-=b1; a2-=a1; v=c2-c1-1; for(j=0;j<=v;++j) { c->gradient_colors[c1+j]=maprgb(c->surface, r1 + r2*j/v, g1 + g2*j/v, b1 + b2*j/v) | ((a1 + a2*j/v)<<24); } } c->gradient_policy = paint->p.gradient->spread; if (paint->p.gradient->type == SVG_GRADIENT_LINEAR) { c->renderfunc = lineargradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.linear.x1.value, paint->p.gradient->u.linear.y1.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.linear.x2.value, paint->p.gradient->u.linear.y2.value}; } else if(paint->p.gradient->type == SVG_GRADIENT_RADIAL) { c->renderfunc = radialgradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.radial.cx.value, paint->p.gradient->u.radial.cy.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.radial.fx.value, paint->p.gradient->u.radial.fy.value}; c->gradient_r = paint->p.gradient->u.radial.r.value; } else c->renderfunc = 0; if(paint->p.gradient->units==SVG_GRADIENT_UNITS_USER) { c->gradient_p1 = FixCoords(c, c->gradient_p1); c->gradient_p2 = FixCoords(c, c->gradient_p2); c->gradient_r = FixSizes(c, (IPoint) {c->gradient_r, 0.0}).x; } else // BBOX { c->gradient_p1 = (IPoint) {minx + c->gradient_p1.x * (maxx - minx + 1), miny + c->gradient_p1.y * (maxy - miny + 1)}; c->gradient_p2 = (IPoint) {minx + c->gradient_p2.x * (maxx - minx + 1), miny + c->gradient_p2.y * (maxy - miny + 1)}; c->gradient_r = c->gradient_r * (maxx - minx + 1); } break; default: c->renderfunc = 0; break; } do_render(c);} | 1561 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1561/2ffd9ca885a57849f9fbafa985ba5ebc76eb8d74/render.c/clean/render.c |
c->gradient_p1 = (IPoint) {minx + c->gradient_p1.x * (maxx - minx + 1), miny + c->gradient_p1.y * (maxy - miny + 1)}; c->gradient_p2 = (IPoint) {minx + c->gradient_p2.x * (maxx - minx + 1), miny + c->gradient_p2.y * (maxy - miny + 1)}; c->gradient_r = c->gradient_r * (maxx - minx + 1); | void svg_render_solid(SDL_svg_context *c){int i,j;int colorstops;//void (*renderfunc)(SDL_svg_context *c, int x, int y, int w);float minx, miny, maxx, maxy;IPoint *ip;IPoint *path;svg_paint_t *paint;const svg_color_t *rgb;int alpha; c->renderfunc = 0; path = c->path; minx=miny = 0x7fffffff; maxx=maxy =-0x7fffffff; for(i=0, ip=path;i<c->numpoints;++i,++ip) { if(ip->x<minx) minx=ip->x; if(ip->x>maxx) maxx=ip->x; if(ip->y<miny) miny=ip->y; if(ip->y>maxy) maxy=ip->y; } paint = c->paint; switch(paint->type) { case SVG_PAINT_TYPE_COLOR: rgb = &paint->p.color; alpha = 255.0 * c->FillOpacity; c->solidcolor = maprgb(c->surface, svg_color_get_red(rgb), svg_color_get_green(rgb), svg_color_get_blue(rgb)) | (alpha << 24); c->renderfunc = solidstrip; break; case SVG_PAINT_TYPE_GRADIENT: colorstops = paint->p.gradient->num_stops; for(i=0;i<colorstops-1;++i) { int c1,c2; int r1,g1,b1,a1,r2,g2,b2,a2; unsigned long t; int v; c1=NUM_GRADIENT_COLORS*i/(colorstops-1); c2=NUM_GRADIENT_COLORS*(i+1)/(colorstops-1); t=paint->p.gradient->stops[i].color.rgb; a1=255.0 * paint->p.gradient->stops[i].opacity; r1 = (t>>16) & 255; g1 = (t>>8) & 255; b1 = t & 255; t=paint->p.gradient->stops[i+1].color.rgb; a2=255.0 * paint->p.gradient->stops[i+1].opacity; r2 = (t>>16) & 255; g2 = (t>>8) & 255; b2 = t & 255; r2-=r1; g2-=g1; b2-=b1; a2-=a1; v=c2-c1-1; for(j=0;j<=v;++j) { c->gradient_colors[c1+j]=maprgb(c->surface, r1 + r2*j/v, g1 + g2*j/v, b1 + b2*j/v) | ((a1 + a2*j/v)<<24); } } c->gradient_policy = paint->p.gradient->spread; if (paint->p.gradient->type == SVG_GRADIENT_LINEAR) { c->renderfunc = lineargradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.linear.x1.value, paint->p.gradient->u.linear.y1.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.linear.x2.value, paint->p.gradient->u.linear.y2.value}; } else if(paint->p.gradient->type == SVG_GRADIENT_RADIAL) { c->renderfunc = radialgradient; c->gradient_p1 = (IPoint) { paint->p.gradient->u.radial.cx.value, paint->p.gradient->u.radial.cy.value}; c->gradient_p2 = (IPoint) { paint->p.gradient->u.radial.fx.value, paint->p.gradient->u.radial.fy.value}; c->gradient_r = paint->p.gradient->u.radial.r.value; } else c->renderfunc = 0; if(paint->p.gradient->units==SVG_GRADIENT_UNITS_USER) { c->gradient_p1 = FixCoords(c, c->gradient_p1); c->gradient_p2 = FixCoords(c, c->gradient_p2); c->gradient_r = FixSizes(c, (IPoint) {c->gradient_r, 0.0}).x; } else // BBOX { c->gradient_p1 = (IPoint) {minx + c->gradient_p1.x * (maxx - minx + 1), miny + c->gradient_p1.y * (maxy - miny + 1)}; c->gradient_p2 = (IPoint) {minx + c->gradient_p2.x * (maxx - minx + 1), miny + c->gradient_p2.y * (maxy - miny + 1)}; c->gradient_r = c->gradient_r * (maxx - minx + 1); } break; default: c->renderfunc = 0; break; } do_render(c);} | 1561 /local/tlutelli/issta_data/temp/c/2005_temp/2005/1561/2ffd9ca885a57849f9fbafa985ba5ebc76eb8d74/render.c/clean/render.c |
|
printf( "What is maximum_messages? " ); | printf( "What is maximum_messages? XXXX " ); | void help_size(){int c = '\0';int break_loop;int total_size;int task_stacks;int interrupt_stack;int maximum_tasks, size_tasks;int maximum_sems, size_sems;int maximum_timers, size_timers;int maximum_msgqs, size_msgqs;int maximum_msgs, size_msgs_overhead;int maximum_regns, size_regns;int maximum_parts, size_parts;int maximum_ports, size_ports;int maximum_periods, size_periods;int maximum_extensions, size_extensions;int maximum_drvs, size_drvs;int maximum_fps, size_fps;int maximum_nodes, size_nodes;int maximum_gobjs, size_gobjs;int maximum_proxies, size_proxies;total_size = sys_req; /* Fixed Overhead */printf( "What is maximum_tasks? " );maximum_tasks = getint();size_tasks = PER_TASK * maximum_tasks;total_size += size_tasks;printf( "What is maximum_semaphores? " );maximum_sems = getint();size_sems = PER_SEMAPHORE * maximum_sems;total_size += size_sems;printf( "What is maximum_timers? " );maximum_timers = getint();size_timers = PER_TIMER * maximum_timers;total_size += size_timers;printf( "What is maximum_message_queues? " );maximum_msgqs = getint();size_msgqs = PER_MSGQ * maximum_msgqs;total_size += size_msgqs;printf( "What is maximum_messages? " );maximum_msgs = getint();size_msgs_overhead = PER_MSG_OVERHEAD * maximum_msgs;total_size += size_msgs_overhead;printf( "What is maximum_regions? " );maximum_regns = getint();size_regns = PER_REGN * maximum_regns;total_size += size_regns;printf( "What is maximum_partitions? " );maximum_parts = getint();size_parts = PER_PART * maximum_parts;total_size += size_parts;printf( "What is maximum_ports? " );maximum_ports = getint();size_ports = PER_PORT * maximum_ports;total_size += size_ports;printf( "What is maximum_periods? " );maximum_periods = getint();size_periods = PER_PORT * maximum_periods;total_size += size_periods;printf( "What is maximum_extensions? " );maximum_extensions = getint();size_extensions = PER_EXTENSION * maximum_extensions;total_size += size_extensions;printf( "What is number_of_device_drivers? " );maximum_drvs = getint();size_drvs = PER_DRV * maximum_drvs;total_size += size_drvs;printf( "What will be total stack requirement for all tasks? " );task_stacks = getint();total_size += task_stacks;printf( "What is the size of the interrupt stack? " );interrupt_stack = getint();total_size += interrupt_stack;printf( "How many tasks will be created with the FP flag? " );maximum_fps = getint();size_fps = PER_FPTASK * maximum_fps;total_size += size_fps;printf( "Is this a single processor system? " );for ( break_loop=0 ; !break_loop; c = getchar() ) { switch ( c ) { case 'Y': case 'y': case 'N': case 'n': break_loop = 1; break; }}printf( "%c\n", c );if ( c == 'n' || c == 'N' ) { printf( "What is maximum_nodes? " ); maximum_nodes = getint(); size_nodes = PER_NODE * maximum_nodes; total_size += size_nodes; printf( "What is maximum_global_objects? " ); maximum_gobjs = getint(); size_gobjs = PER_GOBJECT * maximum_gobjs; total_size += size_gobjs; printf( "What is maximum_proxies? " ); maximum_proxies = getint(); size_proxies = PER_PROXY * maximum_proxies; total_size += size_proxies;} else { maximum_nodes = 0; size_nodes = PER_NODE * 0; maximum_gobjs = 0; size_gobjs = PER_GOBJECT * 0; maximum_proxies = 0; size_proxies = PER_PROXY * 0;}printf( "\n\n" );printf( " ************** EXECUTIVE WORK SPACE REQUIRED **************\n" );printf( " Tasks - %03d * %03d = %d\n", maximum_tasks, PER_TASK, size_tasks );printf( " Semaphores - %03d * %03d = %d\n", maximum_sems, PER_SEMAPHORE, size_sems );printf( " Timers - %03d * %03d = %d\n", maximum_timers, PER_TIMER, size_timers );printf( " Msg Queues - %03d * %03d = %d\n", maximum_msgqs, PER_MSGQ, size_msgqs );printf( " Messages Overhead - %03d * %03d = %d\n", maximum_msgs, PER_MSG_OVERHEAD, size_msgs_overhead );printf( " Regions - %03d * %03d = %d\n", maximum_regns, PER_REGN, size_regns);printf( " Partitions - %03d * %03d = %d\n", maximum_parts, PER_PART, size_parts );printf( " Periods - %03d * %03d = %d\n", maximum_periods, PER_PERIOD, size_periods );printf( " Extensions - %03d * %03d = %d\n", maximum_extensions, PER_EXTENSION, size_extensions );printf( " Device Drivers - %03d * %03d = %d\n", maximum_drvs, PER_DRV, size_drvs );printf( " System Requirements - %04d = %d\n", sys_req, sys_req );printf( " Floating Point Tasks - %03d * %03d = %d\n", maximum_fps, PER_FPTASK, size_fps );printf( " Application Task Stacks - = %d\n", task_stacks );printf( " Interrupt Stacks - = %d\n", task_stacks );printf( " \n" );printf( " Global object tables - %03d * %03d = %d\n", maximum_nodes, PER_NODE, size_nodes );printf( " Global objects - %03d * %03d = %d\n", maximum_gobjs, PER_GOBJECT, size_gobjs );printf( " Proxies - %03d * %03d = %d\n", maximum_proxies, PER_PROXY, size_proxies );printf( "\n\n" );printf( " TOTAL = %d bytes\n", total_size );} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3652ad356bf13abe0963c992cbbda96476d31609/size.c/clean/testsuites/sptests/spsize/size.c |
size_msgs_overhead = PER_MSG_OVERHEAD * maximum_msgs; | size_msgs_overhead = 0; | void help_size(){int c = '\0';int break_loop;int total_size;int task_stacks;int interrupt_stack;int maximum_tasks, size_tasks;int maximum_sems, size_sems;int maximum_timers, size_timers;int maximum_msgqs, size_msgqs;int maximum_msgs, size_msgs_overhead;int maximum_regns, size_regns;int maximum_parts, size_parts;int maximum_ports, size_ports;int maximum_periods, size_periods;int maximum_extensions, size_extensions;int maximum_drvs, size_drvs;int maximum_fps, size_fps;int maximum_nodes, size_nodes;int maximum_gobjs, size_gobjs;int maximum_proxies, size_proxies;total_size = sys_req; /* Fixed Overhead */printf( "What is maximum_tasks? " );maximum_tasks = getint();size_tasks = PER_TASK * maximum_tasks;total_size += size_tasks;printf( "What is maximum_semaphores? " );maximum_sems = getint();size_sems = PER_SEMAPHORE * maximum_sems;total_size += size_sems;printf( "What is maximum_timers? " );maximum_timers = getint();size_timers = PER_TIMER * maximum_timers;total_size += size_timers;printf( "What is maximum_message_queues? " );maximum_msgqs = getint();size_msgqs = PER_MSGQ * maximum_msgqs;total_size += size_msgqs;printf( "What is maximum_messages? " );maximum_msgs = getint();size_msgs_overhead = PER_MSG_OVERHEAD * maximum_msgs;total_size += size_msgs_overhead;printf( "What is maximum_regions? " );maximum_regns = getint();size_regns = PER_REGN * maximum_regns;total_size += size_regns;printf( "What is maximum_partitions? " );maximum_parts = getint();size_parts = PER_PART * maximum_parts;total_size += size_parts;printf( "What is maximum_ports? " );maximum_ports = getint();size_ports = PER_PORT * maximum_ports;total_size += size_ports;printf( "What is maximum_periods? " );maximum_periods = getint();size_periods = PER_PORT * maximum_periods;total_size += size_periods;printf( "What is maximum_extensions? " );maximum_extensions = getint();size_extensions = PER_EXTENSION * maximum_extensions;total_size += size_extensions;printf( "What is number_of_device_drivers? " );maximum_drvs = getint();size_drvs = PER_DRV * maximum_drvs;total_size += size_drvs;printf( "What will be total stack requirement for all tasks? " );task_stacks = getint();total_size += task_stacks;printf( "What is the size of the interrupt stack? " );interrupt_stack = getint();total_size += interrupt_stack;printf( "How many tasks will be created with the FP flag? " );maximum_fps = getint();size_fps = PER_FPTASK * maximum_fps;total_size += size_fps;printf( "Is this a single processor system? " );for ( break_loop=0 ; !break_loop; c = getchar() ) { switch ( c ) { case 'Y': case 'y': case 'N': case 'n': break_loop = 1; break; }}printf( "%c\n", c );if ( c == 'n' || c == 'N' ) { printf( "What is maximum_nodes? " ); maximum_nodes = getint(); size_nodes = PER_NODE * maximum_nodes; total_size += size_nodes; printf( "What is maximum_global_objects? " ); maximum_gobjs = getint(); size_gobjs = PER_GOBJECT * maximum_gobjs; total_size += size_gobjs; printf( "What is maximum_proxies? " ); maximum_proxies = getint(); size_proxies = PER_PROXY * maximum_proxies; total_size += size_proxies;} else { maximum_nodes = 0; size_nodes = PER_NODE * 0; maximum_gobjs = 0; size_gobjs = PER_GOBJECT * 0; maximum_proxies = 0; size_proxies = PER_PROXY * 0;}printf( "\n\n" );printf( " ************** EXECUTIVE WORK SPACE REQUIRED **************\n" );printf( " Tasks - %03d * %03d = %d\n", maximum_tasks, PER_TASK, size_tasks );printf( " Semaphores - %03d * %03d = %d\n", maximum_sems, PER_SEMAPHORE, size_sems );printf( " Timers - %03d * %03d = %d\n", maximum_timers, PER_TIMER, size_timers );printf( " Msg Queues - %03d * %03d = %d\n", maximum_msgqs, PER_MSGQ, size_msgqs );printf( " Messages Overhead - %03d * %03d = %d\n", maximum_msgs, PER_MSG_OVERHEAD, size_msgs_overhead );printf( " Regions - %03d * %03d = %d\n", maximum_regns, PER_REGN, size_regns);printf( " Partitions - %03d * %03d = %d\n", maximum_parts, PER_PART, size_parts );printf( " Periods - %03d * %03d = %d\n", maximum_periods, PER_PERIOD, size_periods );printf( " Extensions - %03d * %03d = %d\n", maximum_extensions, PER_EXTENSION, size_extensions );printf( " Device Drivers - %03d * %03d = %d\n", maximum_drvs, PER_DRV, size_drvs );printf( " System Requirements - %04d = %d\n", sys_req, sys_req );printf( " Floating Point Tasks - %03d * %03d = %d\n", maximum_fps, PER_FPTASK, size_fps );printf( " Application Task Stacks - = %d\n", task_stacks );printf( " Interrupt Stacks - = %d\n", task_stacks );printf( " \n" );printf( " Global object tables - %03d * %03d = %d\n", maximum_nodes, PER_NODE, size_nodes );printf( " Global objects - %03d * %03d = %d\n", maximum_gobjs, PER_GOBJECT, size_gobjs );printf( " Proxies - %03d * %03d = %d\n", maximum_proxies, PER_PROXY, size_proxies );printf( "\n\n" );printf( " TOTAL = %d bytes\n", total_size );} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3652ad356bf13abe0963c992cbbda96476d31609/size.c/clean/testsuites/sptests/spsize/size.c |
maximum_msgs, PER_MSG_OVERHEAD, size_msgs_overhead ); | maximum_msgs, 0 /* PER_MSG_OVERHEAD */, size_msgs_overhead ); | void help_size(){int c = '\0';int break_loop;int total_size;int task_stacks;int interrupt_stack;int maximum_tasks, size_tasks;int maximum_sems, size_sems;int maximum_timers, size_timers;int maximum_msgqs, size_msgqs;int maximum_msgs, size_msgs_overhead;int maximum_regns, size_regns;int maximum_parts, size_parts;int maximum_ports, size_ports;int maximum_periods, size_periods;int maximum_extensions, size_extensions;int maximum_drvs, size_drvs;int maximum_fps, size_fps;int maximum_nodes, size_nodes;int maximum_gobjs, size_gobjs;int maximum_proxies, size_proxies;total_size = sys_req; /* Fixed Overhead */printf( "What is maximum_tasks? " );maximum_tasks = getint();size_tasks = PER_TASK * maximum_tasks;total_size += size_tasks;printf( "What is maximum_semaphores? " );maximum_sems = getint();size_sems = PER_SEMAPHORE * maximum_sems;total_size += size_sems;printf( "What is maximum_timers? " );maximum_timers = getint();size_timers = PER_TIMER * maximum_timers;total_size += size_timers;printf( "What is maximum_message_queues? " );maximum_msgqs = getint();size_msgqs = PER_MSGQ * maximum_msgqs;total_size += size_msgqs;printf( "What is maximum_messages? " );maximum_msgs = getint();size_msgs_overhead = PER_MSG_OVERHEAD * maximum_msgs;total_size += size_msgs_overhead;printf( "What is maximum_regions? " );maximum_regns = getint();size_regns = PER_REGN * maximum_regns;total_size += size_regns;printf( "What is maximum_partitions? " );maximum_parts = getint();size_parts = PER_PART * maximum_parts;total_size += size_parts;printf( "What is maximum_ports? " );maximum_ports = getint();size_ports = PER_PORT * maximum_ports;total_size += size_ports;printf( "What is maximum_periods? " );maximum_periods = getint();size_periods = PER_PORT * maximum_periods;total_size += size_periods;printf( "What is maximum_extensions? " );maximum_extensions = getint();size_extensions = PER_EXTENSION * maximum_extensions;total_size += size_extensions;printf( "What is number_of_device_drivers? " );maximum_drvs = getint();size_drvs = PER_DRV * maximum_drvs;total_size += size_drvs;printf( "What will be total stack requirement for all tasks? " );task_stacks = getint();total_size += task_stacks;printf( "What is the size of the interrupt stack? " );interrupt_stack = getint();total_size += interrupt_stack;printf( "How many tasks will be created with the FP flag? " );maximum_fps = getint();size_fps = PER_FPTASK * maximum_fps;total_size += size_fps;printf( "Is this a single processor system? " );for ( break_loop=0 ; !break_loop; c = getchar() ) { switch ( c ) { case 'Y': case 'y': case 'N': case 'n': break_loop = 1; break; }}printf( "%c\n", c );if ( c == 'n' || c == 'N' ) { printf( "What is maximum_nodes? " ); maximum_nodes = getint(); size_nodes = PER_NODE * maximum_nodes; total_size += size_nodes; printf( "What is maximum_global_objects? " ); maximum_gobjs = getint(); size_gobjs = PER_GOBJECT * maximum_gobjs; total_size += size_gobjs; printf( "What is maximum_proxies? " ); maximum_proxies = getint(); size_proxies = PER_PROXY * maximum_proxies; total_size += size_proxies;} else { maximum_nodes = 0; size_nodes = PER_NODE * 0; maximum_gobjs = 0; size_gobjs = PER_GOBJECT * 0; maximum_proxies = 0; size_proxies = PER_PROXY * 0;}printf( "\n\n" );printf( " ************** EXECUTIVE WORK SPACE REQUIRED **************\n" );printf( " Tasks - %03d * %03d = %d\n", maximum_tasks, PER_TASK, size_tasks );printf( " Semaphores - %03d * %03d = %d\n", maximum_sems, PER_SEMAPHORE, size_sems );printf( " Timers - %03d * %03d = %d\n", maximum_timers, PER_TIMER, size_timers );printf( " Msg Queues - %03d * %03d = %d\n", maximum_msgqs, PER_MSGQ, size_msgqs );printf( " Messages Overhead - %03d * %03d = %d\n", maximum_msgs, PER_MSG_OVERHEAD, size_msgs_overhead );printf( " Regions - %03d * %03d = %d\n", maximum_regns, PER_REGN, size_regns);printf( " Partitions - %03d * %03d = %d\n", maximum_parts, PER_PART, size_parts );printf( " Periods - %03d * %03d = %d\n", maximum_periods, PER_PERIOD, size_periods );printf( " Extensions - %03d * %03d = %d\n", maximum_extensions, PER_EXTENSION, size_extensions );printf( " Device Drivers - %03d * %03d = %d\n", maximum_drvs, PER_DRV, size_drvs );printf( " System Requirements - %04d = %d\n", sys_req, sys_req );printf( " Floating Point Tasks - %03d * %03d = %d\n", maximum_fps, PER_FPTASK, size_fps );printf( " Application Task Stacks - = %d\n", task_stacks );printf( " Interrupt Stacks - = %d\n", task_stacks );printf( " \n" );printf( " Global object tables - %03d * %03d = %d\n", maximum_nodes, PER_NODE, size_nodes );printf( " Global objects - %03d * %03d = %d\n", maximum_gobjs, PER_GOBJECT, size_gobjs );printf( " Proxies - %03d * %03d = %d\n", maximum_proxies, PER_PROXY, size_proxies );printf( "\n\n" );printf( " TOTAL = %d bytes\n", total_size );} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3652ad356bf13abe0963c992cbbda96476d31609/size.c/clean/testsuites/sptests/spsize/size.c |
y[1]=lpuigs((GEN)x[1],m); y[2]=lpuigs((GEN)x[2],m); | y[1]=lpowgs((GEN)x[1],m); y[2]=lpowgs((GEN)x[2],m); | gpowgs(GEN x, long n){ long m, tx; pari_sp lim, av; static long gn[3] = {evaltyp(t_INT)|_evallg(3), 0, 0}; GEN y; if (n == 0) return puiss0(x); if (n == 1) return gcopy(x); if (n ==-1) return ginv(x); if (n>0) { gn[1] = evalsigne( 1) | evallgefint(3); gn[2]= n; } else { gn[1] = evalsigne(-1) | evallgefint(3); gn[2]=-n; } /* If gpowgs were only ever called from gpow, the switch wouldn't be needed. * In fact, under current word and bit field sizes, an integer power with * multiword exponent will always overflow. But it seems easier to call * puissii|powmodulo() with a mock-up GEN as 2nd argument than to write * separate versions for a long exponent. Note that n = HIGHBIT is an * invalid argument. --GN */ switch((tx=typ(x))) { case t_INT: { long sx=signe(x), sr = (sx<0 && (n&1))? -1: 1; if (n>0) return puissii(x,(GEN)gn,sr); if (!sx) err(talker, "division by zero in gpowgs"); if (is_pm1(x)) return (sr < 0)? icopy(x): gun; /* n<0, |x|>1 */ y=cgetg(3,t_FRAC); setsigne(gn,1); y[1]=(sr>0)? un: lnegi(gun); y[2]=(long)puissii(x,(GEN)gn,1); /* force denominator > 0 */ return y; } case t_INTMOD: y=cgetg(3,tx); copyifstack(x[1],y[1]); y[2]=(long)powmodulo((GEN)(x[2]),(GEN)gn,(GEN)(x[1])); return y; case t_FRAC: case t_FRACN: { GEN a = (GEN)x[1], b = (GEN)x[2]; long sr = (n&1 && (signe(a)!=signe(b))) ? -1 : 1; if (n > 0) { if (!signe(a)) return gzero; } else { /* n < 0 */ if (!signe(a)) err(talker, "division by zero fraction in gpowgs"); /* +-1/x[2] inverts to an integer */ if (is_pm1(a)) return puissii(b,(GEN)gn,sr); y = b; b = a; a = y; } /* HACK: puissii disregards the sign of gn */ y = cgetg(3,tx); y[1] = (long)puissii(a,(GEN)gn,sr); y[2] = (long)puissii(b,(GEN)gn,1); return y; } case t_PADIC: case t_POL: case t_POLMOD: return powgi(x,gn); case t_RFRAC: case t_RFRACN: { av=avma; y=cgetg(3,tx); m = labs(n); y[1]=lpuigs((GEN)x[1],m); y[2]=lpuigs((GEN)x[2],m); if (n<0) y=ginv(y); /* let ginv worry about normalizations */ return gerepileupto(av,y); } default: m = labs(n); av=avma; y=NULL; lim=stack_lim(av,1); for (; m>1; m>>=1) { if (m&1) y = y? gmul(y,x): x; x=gsqr(x); if (low_stack(lim, stack_lim(av,1))) { GEN *gptr[2]; gptr[0]=&x; gptr[1]=&y; if(DEBUGMEM>1) err(warnmem,"[3]: gpowgs"); gerepilemany(av,gptr,y? 2: 1); } } y = y? gmul(y,x): x; if (n<=0) y=ginv(y); return gerepileupto(av,y); }} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/aa6abd22729a2b27c501c4334a0a659cd29f1d7e/trans1.c/clean/src/basemath/trans1.c |
GEN v = cgetg(q-1,t_VECSMALL); ulong h,qm3s2,qm1s2,qm1,a,i; ulong av = avma; | GEN v = cgetg(q-1,t_VECSMALL), w = v-1; /* w[i] = dl(i) */ ulong g,qm3s2,qm1s2,a,i; | computetabdl(ulong q){ GEN v = cgetg(q-1,t_VECSMALL); ulong h,qm3s2,qm1s2,qm1,a,i; ulong av = avma; h = itos(lift(gener(stoi(q)))); avma = av; qm3s2 = (q-3)>>1; qm1s2 = qm3s2+1; qm1 = q-1; v[q-2]=qm1s2; a=1; for (i=1; i<=qm3s2; i++) { a = mulssmod(h,a,q); v[a-1] = i; v[qm1-a] = i+qm1s2; } return v;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
h = itos(lift(gener(stoi(q)))); avma = av; | g = u_gener(q); | computetabdl(ulong q){ GEN v = cgetg(q-1,t_VECSMALL); ulong h,qm3s2,qm1s2,qm1,a,i; ulong av = avma; h = itos(lift(gener(stoi(q)))); avma = av; qm3s2 = (q-3)>>1; qm1s2 = qm3s2+1; qm1 = q-1; v[q-2]=qm1s2; a=1; for (i=1; i<=qm3s2; i++) { a = mulssmod(h,a,q); v[a-1] = i; v[qm1-a] = i+qm1s2; } return v;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
qm1 = q-1; v[q-2]=qm1s2; a=1; | w[q-1] = qm1s2; a = 1; | computetabdl(ulong q){ GEN v = cgetg(q-1,t_VECSMALL); ulong h,qm3s2,qm1s2,qm1,a,i; ulong av = avma; h = itos(lift(gener(stoi(q)))); avma = av; qm3s2 = (q-3)>>1; qm1s2 = qm3s2+1; qm1 = q-1; v[q-2]=qm1s2; a=1; for (i=1; i<=qm3s2; i++) { a = mulssmod(h,a,q); v[a-1] = i; v[qm1-a] = i+qm1s2; } return v;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
a = mulssmod(h,a,q); v[a-1] = i; v[qm1-a] = i+qm1s2; | a = mulssmod(g,a,q); w[a] = i; w[q-a] = i+qm1s2; | computetabdl(ulong q){ GEN v = cgetg(q-1,t_VECSMALL); ulong h,qm3s2,qm1s2,qm1,a,i; ulong av = avma; h = itos(lift(gener(stoi(q)))); avma = av; qm3s2 = (q-3)>>1; qm1s2 = qm3s2+1; qm1 = q-1; v[q-2]=qm1s2; a=1; for (i=1; i<=qm3s2; i++) { a = mulssmod(h,a,q); v[a-1] = i; v[qm1-a] = i+qm1s2; } return v;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8ac2292b2e02fd23dcdd96371571717ef1011e3f/aprcl.c/clean/src/modules/aprcl.c |
long d = itos(D), t, b2, a, b, c, h, dover3 = labs(d)/3; GEN z, L = cgetg((long)sqrt(dover3), t_VEC); | long d = itos(D), dabs = labs(d), dover3 = dabs/3, t, b2, a, b, c, h; GEN z, L = cgetg((long)sqrt(dabs) * log2(dabs), t_VEC); | getallforms(GEN D, long *pth, GEN *ptz){ long d = itos(D), t, b2, a, b, c, h, dover3 = labs(d)/3; GEN z, L = cgetg((long)sqrt(dover3), t_VEC); b2 = b = (d&1); h = 0; z=gun; while (b2 <= dover3) { t = (b2-d)/4; for (a=b?b:1; a*a<=t; a++) if (t%a == 0) { c = t/a; z = mulsi(a,z); L[++h] = (long)qfi(stoi(a),stoi(b),stoi(c)); if (b && a != b && a*a != t) L[++h] = (long)qfi(stoi(a),stoi(-b),stoi(c)); } b+=2; b2=b*b; } *pth = h; *ptz = z; setlg(L,h+1); return L;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d662c209e9e84c40e8e75b7a08e434d671788268/buch1.c/clean/src/basemath/buch1.c |
size_t last = M->last-M->base, chk = M->chk-M->base, end = M->end - M->base; M->base = (REL_t*)gprealloc((void*)M->base, (len+1) * sizeof(REL_t)); M->last = M->base + last; M->chk = M->base + chk; M->end = M->base + end; M->len = len; | REL_t *old = M->base; M->len = len; M->base = (REL_t*)gprealloc((void*)old, (len+1) * sizeof(REL_t)); if (old) { size_t last = M->last - old, chk = M->chk - old, end = M->end - old; M->last = M->base + last; M->chk = M->base + chk; M->end = M->base + end; } | reallocate(RELCACHE_t *M, long len){ size_t last = M->last-M->base, chk = M->chk-M->base, end = M->end - M->base; M->base = (REL_t*)gprealloc((void*)M->base, (len+1) * sizeof(REL_t)); M->last = M->base + last; M->chk = M->base + chk; M->end = M->base + end; M->len = len;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/d69ed6d8e7bab8aead997a49557e9f1f7b600854/buch2.c/clean/src/basemath/buch2.c |
long tx = typ(x), av = avma, tetpil; | ulong tx = typ(x), av = avma, tetpil; | compreal0(GEN x, GEN y, int raw){ long tx = typ(x), av = avma, tetpil; GEN z; if (typ(y) != tx || tx!=t_QFR) err(typeer,"composition"); z=cgetg(5,t_QFR); comp_gen(z,x,y); z[4]=laddrr((GEN)x[4],(GEN)y[4]); tetpil=avma; return gerepile(av,tetpil, raw? gcopy(z): redreal(z));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/9749d3e46caef3f61b412b608c8ac51b8f010460/arith2.c/clean/src/basemath/arith2.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/c/src/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/c/src/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/c/src/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/c/src/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/c/src/libnetworking/rtems/rtems_glue.c |
||
char new_name[ NAME_MAX + 1 ]; | char new_name[ IMFS_NAME_MAX + 1 ]; | int IMFS_mknod( const char *token, /* IN */ mode_t mode, /* IN */ dev_t dev, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */){ IMFS_token_types type = 0; IMFS_jnode_t *new_node; int result; char new_name[ NAME_MAX + 1 ]; IMFS_types_union info; IMFS_get_token( token, new_name, &result ); /* * Figure out what type of IMFS node this is. */ if ( S_ISDIR(mode) ) type = IMFS_DIRECTORY; else if ( S_ISREG(mode) ) type = IMFS_MEMORY_FILE; else if ( S_ISBLK(mode) || S_ISCHR(mode) ) { type = IMFS_DEVICE; rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor ); } else { assert( 0 ); set_errno_and_return_minus_one( EINVAL ); } /* * Allocate and fill in an IMFS jnode */ new_node = IMFS_create_node( pathloc, type, new_name, mode, &info ); if ( !new_node ) set_errno_and_return_minus_one( ENOMEM ); return 0;} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/3cf8394af5f646642df593c8de833441e186af64/imfs_mknod.c/clean/c/src/libfs/src/imfs/imfs_mknod.c |
if (!form1) form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); | if (!form1) { form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); } | real_relations(long LIM, long lim, long LIMC, long **mat){ long lgsub = lg(subFB), i, s, fpc, current, nbtest = 0, endcycle, rhoacc, rho; int first = 1; pari_sp av, av1, limstack; GEN C, d, col, form, form0, form1, ex = cgetg(lgsub, t_VECSMALL); C = cgetg(LIM+1, t_VEC); for (i=1; i<=LIM; i++) C[i] = lgetr(PRECREG); current = 0; av = avma; limstack = stack_lim(av,1); s = trivial_relations(mat, C); lim += s; if (lim > LIM) lim = LIM;NEW: for(;;) { if (s >= lim) { if (lim == LIM) break; lim = LIM; first = 0; if (DEBUGLEVEL) dbg_all(0, s, nbtest); } avma = av; form = real_random_form(ex); if (!first) { current = 1+s-RELSUP; form = comprealform3(form, realpf(Disc, FB[current])); } av1 = avma; form0 = form; form1 = NULL; endcycle = rhoacc = 0; rho = -1;CYCLE: if (endcycle) goto NEW; if (low_stack(limstack, stack_lim(av,1))) { if(DEBUGMEM>1) err(warnmem,"real_relations"); gerepileall(av1, form1? 2: 1, &form, &form1); } if (rho < 0) rho = 0; /* first time in */ else { form = rhorealform(form); rho++; rhoacc++; if (first) endcycle = (absi_equal((GEN)form[1],(GEN)form0[1]) && egalii((GEN)form[2],(GEN)form0[2]) && (!narrow || signe(form0[1])==signe(form[1]))); else { if (narrow) { form = rhorealform(form); rho++; } else if (absi_equal((GEN)form[1], (GEN)form[3])) /* a = -c */ { if (absi_equal((GEN)form[1],(GEN)form0[1]) && egalii((GEN)form[2],(GEN)form0[2])) goto NEW; form = rhorealform(form); rho++; } else { setsigne(form[1],1); setsigne(form[3],-1); } if (egalii((GEN)form[1],(GEN)form0[1]) && egalii((GEN)form[2],(GEN)form0[2])) goto NEW; } } nbtest++; fpc = factorquad(form,KC,LIMC); if (!fpc) { if (DEBUGLEVEL>1) fprintferr("."); goto CYCLE; } if (fpc > 1) { /* look for Large Prime relation */ long *fpd = largeprime(fpc,ex,current,rhoacc); long b1, b2, p; GEN form2; if (!fpd) { if (DEBUGLEVEL>1) fprintferr("."); goto CYCLE; } if (!form1) form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); form1 = rhoreal_pow(form1, rho); rho = 0; form2 = initrealform5(fpd); if (fpd[-2]) form2 = comprealform(form2, realpf5(Disc, FB[fpd[-2]])); form2 = rhoreal_pow(form2, fpd[-3]); if (!narrow && !absi_equal((GEN)form2[1],(GEN)form2[3])) { setsigne(form2[1],1); setsigne(form2[3],-1); } p = fpc << 1; b1 = smodis((GEN)form2[2], p); b2 = smodis((GEN)form1[2], p); if (b1 != b2 && b1+b2 != p) goto CYCLE; col = mat[++s]; add_fact(col, form1); (void)factorquad(form2,KC,LIMC); if (b1==b2) { for (i=1; i<lgsub; i++) col[subFB[i]] += fpd[i]-ex[i]; sub_fact(col, form2); if (fpd[-2]) col[fpd[-2]]++; /* implies !first */ d = get_dist(subii((GEN)form1[4],(GEN)form2[4]), divrr((GEN)form1[5],(GEN)form2[5]), PRECREG); } else { for (i=1; i<lgsub; i++) col[subFB[i]] += -fpd[i]-ex[i]; add_fact(col, form2); if (fpd[-2]) col[fpd[-2]]--; d = get_dist(addii((GEN)form1[4],(GEN)form2[4]), mulrr((GEN)form1[5],(GEN)form2[5]), PRECREG); } } else { /* standard relation */ if (!form1) form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); form1 = rhoreal_pow(form1,rho); rho = 0; col = mat[++s]; for (i=1; i<lgsub; i++) col[subFB[i]] = -ex[i]; add_fact(col, form1); d = get_dist((GEN)form1[4], (GEN)form1[5], PRECREG); } if (DEBUGLEVEL) fprintferr(" %ld",s); affrr(d, (GEN)C[s]); if (first) { if (s >= lim) goto NEW; goto CYCLE; } else { col[current]--; if (fpc == 1 && col[current] == 0) { s--; for (i=1; i<=KC; i++) col[i]=0; } } } if (DEBUGLEVEL) dbg_all(1, s, nbtest); return C;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/5e22382e8cc4c7a3ec5b1075e6db3ccca9110f77/buch1.c/clean/src/basemath/buch1.c |
if (!form1) form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); | if (!form1) { form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); } | real_relations(long LIM, long lim, long LIMC, long **mat){ long lgsub = lg(subFB), i, s, fpc, current, nbtest = 0, endcycle, rhoacc, rho; int first = 1; pari_sp av, av1, limstack; GEN C, d, col, form, form0, form1, ex = cgetg(lgsub, t_VECSMALL); C = cgetg(LIM+1, t_VEC); for (i=1; i<=LIM; i++) C[i] = lgetr(PRECREG); current = 0; av = avma; limstack = stack_lim(av,1); s = trivial_relations(mat, C); lim += s; if (lim > LIM) lim = LIM;NEW: for(;;) { if (s >= lim) { if (lim == LIM) break; lim = LIM; first = 0; if (DEBUGLEVEL) dbg_all(0, s, nbtest); } avma = av; form = real_random_form(ex); if (!first) { current = 1+s-RELSUP; form = comprealform3(form, realpf(Disc, FB[current])); } av1 = avma; form0 = form; form1 = NULL; endcycle = rhoacc = 0; rho = -1;CYCLE: if (endcycle) goto NEW; if (low_stack(limstack, stack_lim(av,1))) { if(DEBUGMEM>1) err(warnmem,"real_relations"); gerepileall(av1, form1? 2: 1, &form, &form1); } if (rho < 0) rho = 0; /* first time in */ else { form = rhorealform(form); rho++; rhoacc++; if (first) endcycle = (absi_equal((GEN)form[1],(GEN)form0[1]) && egalii((GEN)form[2],(GEN)form0[2]) && (!narrow || signe(form0[1])==signe(form[1]))); else { if (narrow) { form = rhorealform(form); rho++; } else if (absi_equal((GEN)form[1], (GEN)form[3])) /* a = -c */ { if (absi_equal((GEN)form[1],(GEN)form0[1]) && egalii((GEN)form[2],(GEN)form0[2])) goto NEW; form = rhorealform(form); rho++; } else { setsigne(form[1],1); setsigne(form[3],-1); } if (egalii((GEN)form[1],(GEN)form0[1]) && egalii((GEN)form[2],(GEN)form0[2])) goto NEW; } } nbtest++; fpc = factorquad(form,KC,LIMC); if (!fpc) { if (DEBUGLEVEL>1) fprintferr("."); goto CYCLE; } if (fpc > 1) { /* look for Large Prime relation */ long *fpd = largeprime(fpc,ex,current,rhoacc); long b1, b2, p; GEN form2; if (!fpd) { if (DEBUGLEVEL>1) fprintferr("."); goto CYCLE; } if (!form1) form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); form1 = rhoreal_pow(form1, rho); rho = 0; form2 = initrealform5(fpd); if (fpd[-2]) form2 = comprealform(form2, realpf5(Disc, FB[fpd[-2]])); form2 = rhoreal_pow(form2, fpd[-3]); if (!narrow && !absi_equal((GEN)form2[1],(GEN)form2[3])) { setsigne(form2[1],1); setsigne(form2[3],-1); } p = fpc << 1; b1 = smodis((GEN)form2[2], p); b2 = smodis((GEN)form1[2], p); if (b1 != b2 && b1+b2 != p) goto CYCLE; col = mat[++s]; add_fact(col, form1); (void)factorquad(form2,KC,LIMC); if (b1==b2) { for (i=1; i<lgsub; i++) col[subFB[i]] += fpd[i]-ex[i]; sub_fact(col, form2); if (fpd[-2]) col[fpd[-2]]++; /* implies !first */ d = get_dist(subii((GEN)form1[4],(GEN)form2[4]), divrr((GEN)form1[5],(GEN)form2[5]), PRECREG); } else { for (i=1; i<lgsub; i++) col[subFB[i]] += -fpd[i]-ex[i]; add_fact(col, form2); if (fpd[-2]) col[fpd[-2]]--; d = get_dist(addii((GEN)form1[4],(GEN)form2[4]), mulrr((GEN)form1[5],(GEN)form2[5]), PRECREG); } } else { /* standard relation */ if (!form1) form1 = initrealform5(ex); if (!first) form1 = comprealform(form1, realpf5(Disc, FB[current])); form1 = rhoreal_pow(form1,rho); rho = 0; col = mat[++s]; for (i=1; i<lgsub; i++) col[subFB[i]] = -ex[i]; add_fact(col, form1); d = get_dist((GEN)form1[4], (GEN)form1[5], PRECREG); } if (DEBUGLEVEL) fprintferr(" %ld",s); affrr(d, (GEN)C[s]); if (first) { if (s >= lim) goto NEW; goto CYCLE; } else { col[current]--; if (fpc == 1 && col[current] == 0) { s--; for (i=1; i<=KC; i++) col[i]=0; } } } if (DEBUGLEVEL) dbg_all(1, s, nbtest); return C;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/5e22382e8cc4c7a3ec5b1075e6db3ccca9110f77/buch1.c/clean/src/basemath/buch1.c |
if (gcmp1(gel(Q,1)) && !signe(gel(Q,2))) { /* principal form. Use faster cornacchia */ c = gel(Q,3); if (kronecker(negi(c), p) < 0) { avma = av; return gen_0; } avma = av; if (!cornacchia(c, p, &M,&N)) return gen_0; goto END; | if (!signe(gel(Q,2))) { a = gel(Q,1); c = gel(Q,3); /* if principal form, use faster cornacchia */ if (gcmp1(a)) return qfbsolve_cornacchia(c, p, 0); if (gcmp1(c)) return qfbsolve_cornacchia(a, p, 1); | qfbimagsolvep(GEN Q, GEN p){ GEN M, N, x,y, a,b,c, d; pari_sp av = avma; if (gcmp1(gel(Q,1)) && !signe(gel(Q,2))) { /* principal form. Use faster cornacchia */ c = gel(Q,3); if (kronecker(negi(c), p) < 0) { avma = av; return gen_0; } avma = av; if (!cornacchia(c, p, &M,&N)) return gen_0; goto END; } d = qf_disc(Q); if (kronecker(d,p) < 0) return gen_0; a = redimagsl2(Q, &N); b = redimagsl2(primeform(d, p, 0), &M); if (!gequal(a, b)) return gen_0; a = gcoeff(M,1,1); x = gcoeff(N,1,1); b = gcoeff(M,1,2); y = gcoeff(N,1,2); c = gcoeff(M,2,1); d = gcoeff(M,2,2); /* inverse: [d,-b; -c,a]. Return (N/M)[1] */ M = subii(mulii(d,x), mulii(b,y)); N = subii(mulii(a,y), mulii(c,x));END: return gerepilecopy(av, mkvec2(M,N));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/b4394ffa19447e99851d901350609203f5e3d2f3/Qfb.c/clean/src/basemath/Qfb.c |
a = gcoeff(M,1,1); x = gcoeff(N,1,1); b = gcoeff(M,1,2); y = gcoeff(N,1,2); c = gcoeff(M,2,1); d = gcoeff(M,2,2); /* inverse: [d,-b; -c,a]. Return (N/M)[1] */ M = subii(mulii(d,x), mulii(b,y)); N = subii(mulii(a,y), mulii(c,x)); END: return gerepilecopy(av, mkvec2(M,N)); | a = gcoeff(N,1,1); x = gcoeff(M,2,2); b = gcoeff(N,1,2); y = gcoeff(M,2,1); /* M^(-1)[,1] = [x, -y]~ */ c = gcoeff(N,2,1); d = gcoeff(N,2,2); /* return (N * M^(-1))[,1] */ M = subii(mulii(a,x), mulii(b,y)); N = subii(mulii(c,x), mulii(d,x)); return gerepilecopy(av, mkvec2(M,N)); | qfbimagsolvep(GEN Q, GEN p){ GEN M, N, x,y, a,b,c, d; pari_sp av = avma; if (gcmp1(gel(Q,1)) && !signe(gel(Q,2))) { /* principal form. Use faster cornacchia */ c = gel(Q,3); if (kronecker(negi(c), p) < 0) { avma = av; return gen_0; } avma = av; if (!cornacchia(c, p, &M,&N)) return gen_0; goto END; } d = qf_disc(Q); if (kronecker(d,p) < 0) return gen_0; a = redimagsl2(Q, &N); b = redimagsl2(primeform(d, p, 0), &M); if (!gequal(a, b)) return gen_0; a = gcoeff(M,1,1); x = gcoeff(N,1,1); b = gcoeff(M,1,2); y = gcoeff(N,1,2); c = gcoeff(M,2,1); d = gcoeff(M,2,2); /* inverse: [d,-b; -c,a]. Return (N/M)[1] */ M = subii(mulii(d,x), mulii(b,y)); N = subii(mulii(a,y), mulii(c,x));END: return gerepilecopy(av, mkvec2(M,N));} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/b4394ffa19447e99851d901350609203f5e3d2f3/Qfb.c/clean/src/basemath/Qfb.c |
static void m_reclaim __P((void)); | SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)struct mbuf *mbutl;char *mclrefcnt;struct mbstat mbstat;struct mbuf *mmbfree;union mcluster *mclfree;int max_linkhdr;int max_protohdr;int max_hdr;int max_datalen;static void m_reclaim __P((void));/* "number of clusters of pages" */#define NCL_INIT 1#define NMB_INIT 16/* ARGSUSED*/static voidmbinit(dummy) void *dummy;{ int s; mmbfree = NULL; mclfree = NULL; s = splimp(); if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0) goto bad; if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0) goto bad; splx(s); return;bad: panic("mbinit");} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/uipc_mbuf.c/buggy/c/src/exec/libnetworking/kern/uipc_mbuf.c |
|
/* ARGSUSED*/ static void mbinit(dummy) void *dummy; | /* * When MGET failes, ask protocols to free space when short of memory, * then re-attempt to allocate an mbuf. */ struct mbuf * m_retry(i, t) int i, t; | SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)struct mbuf *mbutl;char *mclrefcnt;struct mbstat mbstat;struct mbuf *mmbfree;union mcluster *mclfree;int max_linkhdr;int max_protohdr;int max_hdr;int max_datalen;static void m_reclaim __P((void));/* "number of clusters of pages" */#define NCL_INIT 1#define NMB_INIT 16/* ARGSUSED*/static voidmbinit(dummy) void *dummy;{ int s; mmbfree = NULL; mclfree = NULL; s = splimp(); if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0) goto bad; if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0) goto bad; splx(s); return;bad: panic("mbinit");} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/uipc_mbuf.c/buggy/c/src/exec/libnetworking/kern/uipc_mbuf.c |
int s; | register struct mbuf *m; | SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)struct mbuf *mbutl;char *mclrefcnt;struct mbstat mbstat;struct mbuf *mmbfree;union mcluster *mclfree;int max_linkhdr;int max_protohdr;int max_hdr;int max_datalen;static void m_reclaim __P((void));/* "number of clusters of pages" */#define NCL_INIT 1#define NMB_INIT 16/* ARGSUSED*/static voidmbinit(dummy) void *dummy;{ int s; mmbfree = NULL; mclfree = NULL; s = splimp(); if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0) goto bad; if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0) goto bad; splx(s); return;bad: panic("mbinit");} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/uipc_mbuf.c/buggy/c/src/exec/libnetworking/kern/uipc_mbuf.c |
mmbfree = NULL; mclfree = NULL; s = splimp(); if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0) goto bad; if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0) goto bad; splx(s); return; bad: panic("mbinit"); | m_reclaim(); #define m_retry(i, t) (struct mbuf *)0 MGET(m, i, t); #undef m_retry if (m != NULL) mbstat.m_wait++; else mbstat.m_drops++; return (m); | SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)struct mbuf *mbutl;char *mclrefcnt;struct mbstat mbstat;struct mbuf *mmbfree;union mcluster *mclfree;int max_linkhdr;int max_protohdr;int max_hdr;int max_datalen;static void m_reclaim __P((void));/* "number of clusters of pages" */#define NCL_INIT 1#define NMB_INIT 16/* ARGSUSED*/static voidmbinit(dummy) void *dummy;{ int s; mmbfree = NULL; mclfree = NULL; s = splimp(); if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0) goto bad; if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0) goto bad; splx(s); return;bad: panic("mbinit");} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/11cdbebd585380dfd5b030612158b083cee50ad4/uipc_mbuf.c/buggy/c/src/exec/libnetworking/kern/uipc_mbuf.c |
tty->rawOutBufState = rob_busy; | osend (const char *buf, int len, struct rtems_termios_tty *tty){ unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (!tty->device.outputUsesInterrupts) { (*tty->device.write)(tty->minor, buf, len); return; } newHead = tty->rawOutBufHead; while (len) { /* * Performance improvement could be made here. * Copy multiple bytes to raw buffer: * if (len > 1) && (space to buffer end, or tail > 1) * ncopy = MIN (len, space to buffer end or tail) * memcpy (raw buffer, buf, ncopy) * buf += ncopy * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE; rtems_interrupt_disable (level); while (newHead == tty->rawOutBufTail) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf[tty->rawOutBufHead] = *buf++; tty->rawOutBufHead = newHead; if (tty->rawOutBufState == rob_idle) { tty->rawOutBufState = rob_busy; (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1); } rtems_interrupt_enable (level); len--; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b3fd16416cc283f2c8340ac7cb06270cf51adb5f/termios.c/buggy/c/src/lib/libc/termios.c |
|
tty->rawOutBufState = rob_busy; | osend (const char *buf, int len, struct rtems_termios_tty *tty){ unsigned int newHead; rtems_interrupt_level level; rtems_status_code sc; if (!tty->device.outputUsesInterrupts) { (*tty->device.write)(tty->minor, buf, len); return; } newHead = tty->rawOutBufHead; while (len) { /* * Performance improvement could be made here. * Copy multiple bytes to raw buffer: * if (len > 1) && (space to buffer end, or tail > 1) * ncopy = MIN (len, space to buffer end or tail) * memcpy (raw buffer, buf, ncopy) * buf += ncopy * len -= ncopy * * To minimize latency, the memcpy should be done * with interrupts enabled. */ newHead = (newHead + 1) % RAW_OUTPUT_BUFFER_SIZE; rtems_interrupt_disable (level); while (newHead == tty->rawOutBufTail) { tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain (tty->rawOutBufSemaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } tty->rawOutBuf[tty->rawOutBufHead] = *buf++; tty->rawOutBufHead = newHead; if (tty->rawOutBufState == rob_idle) { tty->rawOutBufState = rob_busy; (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[tty->rawOutBufTail], 1); } rtems_interrupt_enable (level); len--; }} | 10355 /local/tlutelli/issta_data/temp/c/2005_temp/2005/10355/b3fd16416cc283f2c8340ac7cb06270cf51adb5f/termios.c/buggy/c/src/lib/libc/termios.c |
|
u = u_FpX_div(u,a,pp,0); | u = u_FpX_div(u,a,pp); | FpX_extgcd_long(GEN x, GEN y, GEN p, GEN *ptu, GEN *ptv){ ulong pp = (ulong)p[2]; GEN a,b,q,r,u,v,v1,d,d1; long av = avma, vx; a = u_Fp_FpX(x,0, pp); b = u_Fp_FpX(y,0, pp); d = a; d1 = b; v = u_zeropol(0); v1= u_Fp_FpX(polun[0],0, pp); while (signe(d1)) { q = u_FpX_divrem(d,d1,pp, 0,&r); v = u_FpX_sub(v, u_FpX_mul(q,v1, pp), pp); /* v -= q v1 */ u=v; v=v1; v1=u; u=r; d=d1; d1=u; } u = u_FpX_sub(d, u_FpX_mul(b,v,pp), pp); u = u_FpX_div(u,a,pp,0); *ptu = u; *ptv = v; { GEN *gptr[3]; gptr[0] = &d; gptr[1] = ptu; gptr[2] = ptv; u_gerepilemany(av, gptr, 3); } vx = varn(x); setvarn(*ptu,vx); setvarn(*ptv,vx); setvarn(d,vx); return d;} | 2195 /local/tlutelli/issta_data/temp/c/2005_temp/2005/2195/8fb106e433493a99b7b083a32bc824515ed57d1c/polarit3.c/buggy/src/basemath/polarit3.c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.