Changeset 7d27c2 in git
- Timestamp:
- Mar 15, 2016, 11:44:33 AM (8 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 7eb464ef99fa9bcf027942ff701df2156a895acf
- Parents:
- 23812d3dd3a69ed0874b01c271d1908acd7f0f055656667e687146a40c18764c718fd74005adf0be
- Files:
-
- 7 added
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r5656667 r7d27c2 5 5 endif 6 6 7 SUBDIRS = resources omalloc xalloc$(USE_FACTORY) \7 SUBDIRS = resources omalloc $(USE_FACTORY) \ 8 8 libpolys gfanlib IntegerProgramming \ 9 9 kernel Singular \ -
Singular/LIB/help.cnf
r5656667 r7d27c2 33 33 galeon!xDhE:galeon:!galeon -n %h & 34 34 netscape!xDhE:netscape:!(netscape -remote "openURL(%h)")||(netscape %h) & 35 cygwin!xhE:cygstart:!cygstart "% h" &35 cygwin!xhE:cygstart:!cygstart "%f" & 36 36 cygwin-www!E:cygstart:!cygstart "%H" & 37 37 safari!xhE:/Applications/Safari.app:!open -a /Applications/Safari.app %h -
Singular/emacs.cc
r5656667 r7d27c2 202 202 if (emacs == NULL) 203 203 { 204 error( "Error: Can't find emacs xterm program. \n Expected it at %s or %s\n Specify alternative with --xterm=PROGRAM option,\n or set ESINGULAR_EMACS environment variable to the name of the program to use as xterm.\n", 204 #ifdef __CYGWIN__ 205 error( "Error: Can't find rxvt program. \n Expected it at %s or %s\n Specify alternative with --rxvt=PROGRAM option,\n or set RXVT environment variable to the name of the program to use as xterm.\n", 206 #else 207 error( "Error: Can't find xterm program. \n Expected it at %s or %s\n Specify alternative with --xterm=PROGRAM option,\n or set XTERM environment variable to the name of the program to use as xterm.\n", 208 #endif 205 209 feResourceDefault('X')); 206 210 mainUsage(); -
Singular/extra.cc
r5656667 r7d27c2 976 976 /* =================== LLL via Flint ==============================*/ 977 977 #ifdef HAVE_FLINT 978 #if def FLINT_VER_2_4_5978 #if __FLINT_RELEASE >= 20500 979 979 if (strcmp(sys_cmd, "LLL_Flint") == 0) 980 980 { -
Singular/iparith.cc
r23812d3 r7d27c2 4057 4057 } 4058 4058 ideal vv = id_Head(vid,currRing); 4059 int j; 4060 long d = 0; 4059 idSkipZeroes(vv); 4060 int j = idPosConstant(vv); 4061 long d; 4062 if(j == -1) 4063 { 4064 d = (long)scDimInt(vv, currRing->qideal); 4065 if(rField_is_Ring_Z(currRing)) 4066 d++; 4067 } 4068 else 4069 { 4070 if(n_IsUnit(pGetCoeff(vv->m[j]),currRing->cf)) 4071 d = -1; 4072 else 4073 d = (long)scDimInt(vv, currRing->qideal); 4074 } 4061 4075 //Anne's Idea for std(4,2x) = 0 bug 4062 4076 long dcurr = d; 4063 4077 for(i=0;i<idSize(vv);i++) 4064 4078 { 4065 if( !n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf))4079 if(vv->m[i] != NULL && !n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf)) 4066 4080 { 4067 4081 ideal vc = idCopy(vv); … … 4086 4100 dcurr++; 4087 4101 } 4088 if(dcurr > d) 4102 idDelete(&vc); 4103 } 4104 if(dcurr > d) 4089 4105 d = dcurr; 4090 idDelete(&vc);4091 }4092 else4093 {4094 if(idPosConstant(vv)!= -1)4095 {4096 dcurr = -1;4097 }4098 }4099 4106 } 4100 4107 res->data = (char *)d; -
Singular/maps_ip.cc
r5656667 r7d27c2 25 25 // #include <kernel/longalg.h> 26 26 27 #include <misc/options.h> 27 28 #include <kernel/GBEngine/kstd1.h> 28 29 #include <kernel/maps/gen_maps.h> … … 49 50 int *perm, int *par_perm, int P, nMapFunc nMap) 50 51 { 52 BOOLEAN use_mult=FALSE; 53 #ifdef HAVE_PLURAL 54 if ((what==IMAP_CMD) 55 && rIsPluralRing(currRing) 56 && rIsPluralRing(preimage_r)) 57 { 58 assume(perm!=NULL); 59 int i=1; 60 while((i<currRing->N)&&(perm[i]==0)) i++; 61 if (i<currRing->N) 62 { 63 int prev_nonnull=i; 64 i++; 65 for(;i<=currRing->N;i++) 66 { 67 if (perm[prev_nonnull] > perm[i]) 68 { 69 if (TEST_V_ALLWARN) 70 { 71 Warn("imap not usable for permuting variables, use map (%s <-> %s)",currRing->names[prev_nonnull-1],currRing->names[i-1]); 72 } 73 use_mult=TRUE; 74 break; 75 } 76 else 77 prev_nonnull=i; 78 } 79 } 80 } 81 #endif 51 82 int i; 52 83 int N = preimage_r->N; … … 103 134 else 104 135 if ( (what==IMAP_CMD) || /*(*/ (what==FETCH_CMD) /*)*/) /* && (nMap!=nCopy)*/ 105 res->data=(void *)p_PermPoly((poly)data,perm,preimage_r,currRing, nMap,par_perm,P );136 res->data=(void *)p_PermPoly((poly)data,perm,preimage_r,currRing, nMap,par_perm,P,use_mult); 106 137 else /*if (what==MAP_CMD)*/ 107 138 { … … 144 175 { 145 176 m->m[i]=p_PermPoly(((ideal)data)->m[i],perm,preimage_r,currRing, 146 nMap,par_perm,P );177 nMap,par_perm,P,use_mult); 147 178 pTest(m->m[i]); 148 179 } -
Singular/misc_ip.cc
r5656667 r7d27c2 28 28 #include <coeffs/OPAEp.h> 29 29 #include <coeffs/flintcf_Q.h> 30 #include <coeffs/flintcf_Zn.h> 30 31 31 32 #include <polys/ext_fields/algext.h> … … 1192 1193 } 1193 1194 } 1195 #ifdef HAVE_FLINT 1196 static n_coeffType n_FlintZn=n_unknown; 1197 static BOOLEAN ii_FlintZn_init(leftv res,leftv a) 1198 { 1199 if ((a->Typ()!=INT_CMD) 1200 ||(a->next==NULL) 1201 ||(a->next->Typ()!=STRING_CMD)) 1202 { 1203 WerrorS("`int`i,`string` expected"); 1204 return TRUE; 1205 } 1206 else 1207 { 1208 flintZn_struct p; 1209 p.ch=(int)(long)a->Data(); 1210 p.name=(char*)a->next->Data(); 1211 res->rtyp=CRING_CMD; 1212 res->data=(void*)nInitChar(n_FlintZn,(void*)&p); 1213 return FALSE; 1214 } 1215 } 1216 #endif 1194 1217 #endif 1195 1218 /*2 … … 1316 1339 IDDATA(h)=(char*)nInitChar(t,NULL); 1317 1340 } 1341 n_FlintZn=nRegister(n_unknown,flintZn_InitChar); 1342 if (n_FlintZn!=n_unknown) 1343 { 1344 iiAddCproc("kernel","flintZ",FALSE,ii_FlintZn_init); 1345 } 1318 1346 #endif 1319 1347 } -
Singular/subexpr.cc
r5656667 r7d27c2 787 787 case CNUMBER_CMD: 788 788 return n2String((number2)d,typed); 789 case CRING_CMD: 790 return nCoeffString((coeffs)d); 791 case CMATRIX_CMD: 792 { 793 bigintmat *b=(bigintmat*)d; 794 return b->String(); 795 } 789 796 #endif 790 797 -
Tst/New/dim_integers.res.gz.uu
r23812d3 r7d27c2 1 1 begin 664 dim_integers.res.gz 2 M'XL("&,DX%8``V1I;5]I;G1E9V5R<RYR97,`E97/;YLP%(#O^2M>JQT2!='X 3 M9T#1.$S;H5JU2ZL==JE(<3(K!"K;9)"_?J8;X!2G34\\/3\]?W[^+.X?OM[^ 4 M``"4P-WM%[@VVH2Y7%^OP$:/LI!F.EM-VB\D"61R;W-&;(7282'^A-JD9G+_ 5 MOP=.H(])"#<W\/!;:`&I$J#+O0`CM-&P*14\E?OGRLAB"]]5E>=M8U%H618: 6 MR@W(3*2YC0Y"0;==WYEVG6$CE390%@*D!F,3I9);6:0YK*NMW:8J,E@W\%/N 7 MC-WR3AS2(BL/>M<T8"/X=DCAEU#'OC,+!WX>@FKQ%'SN$((ZR)Y7?<4R^<<) 8 MTI;0`-?#4I2\)+7)IG(VI..7`;8IF*`NBQ9)>QY+?'5EQZ*4>#*@A*YR8UL, 9 M92B$G;234GT_Y,P;$0_OM`Z:F<N,J,O,ZX`VPQKS0B/N0.,^:P__FB9R:.)+ 10 M:/#BE`8MYG5CD?`<#U@8>;$P]LT2DQ$6I@,69F>P@N,I&'?!HCI`N`E0=!P* 11 MEGZHR($B?38>09'%`$7095`$GT+A>=-RD3G"Q\!._TCG<8V'<N)%)-1WG82- 12 M$;F#N'00IQTCIK/3%T&BLR^"Q%X:NO#=(D4C&NJH3LDYFI%A]`W?J=]WZO6= 13 MCGVGCN\TOAB)72(]\TO/O-*SL?3,D9ZQM]A>2<;>,Y_YS6=>\]G8?.Z8S]$' 14 GR/C'].=^_;E7?S[6GSOZ<ZM_^S-L_W65GJ+9ZM/D+^%-K`PW!P`` 2 M'XL("(S<YU8``V1I;5]I;G1E9V5R<RYR97,`G9;/3]LP%(#O_!5O:(>61B7^ 3 MF5@5/4S;`0WM`MIA%Q2HZ2Q*@N*T:_K7S^E([&"7-CO5<OS\OO?\)>[MW=?K 4 M'P"`YG!S_07.*UU-5^KA?`9F=*]R58W&L[/F%^9S6*@7,U?)I2SU-)=_IKK* 5 MJK/;MSWP'+HQF<+E)=S]EEI"5DK0Q8N$2NI*PU-1PF/Q\KJN5+Z$[^5ZM6HV 6 MEKE61:ZA>`*UD-G*C#:RA#9=MS-M=X8G5>H*BER"TE"9B:)42Y5G*WA8+TV: 7 M=;Z`AQI^JN?*I+R1FRQ?%!O]7-=@1O!MD\$O6>ZZG=G4\O,IE`U>"5<M0K2- 8 M%J^S;D4R_\<)RBRA$=[:1^E\/ZFKQ4B-[;38-W`_A=I)%,^;<@SPIT^F*V4I 9 M'RLHI5ZO*K.#78:F\*Q,H\IN.^2T&Y$`[F@;U6,7&5$7F6\C6MMG+,B,N&7& 10 MW:0I_3U,ZL"(4V!PW(=!\61;&R(\P98*HR`5QH%.8N)186JI,#M`%>WZ7-SE 11 M2K<1PG6$TIU=D(294LM$NDGA,9'8,A%T&A/!?28\J1LL,D%X%YG>[^A$;+%= 12 M3H*$A`;.DC"?D#N$B4,X:A$Q'?=?!I(>?!F(",+0.'"$%'DPU+&<DD,PGEWT 13 M`]5I6'4:4IWZJE-'=2I.)F*G^,["OK.0[\SWG3F^,_81VCO!V#'I65AZ%I*> 14 M^=)S1WJ.!H#Q8>;SL/D\9#[WS>>.^3QD?L/8YVL;T#":9R:!^9I?7,!]<R?E 15 MA2$Q5TU6FHLHTTK;T^/"#<0#(I.X'QG%`V*1&QM'@_)B-Y8/B23]K$-"J7=( 16 M";.'E'37])4U*0J]?DGRGP>5I#Z!L`1I?("@]WU,W_J^][(E,`AQMP![65+B 17 M9*%^%A0'RDQ9.%%73LK]1(F3*/VH'+M,'*E'Q%X:@6P:@4^L1Y`C]0A?$.$( 18 M(@X)TCL>T9?C!$%MH0,_`#;P2`M1[+40Q;:%*#8M;/ZB-__`UWJ$QK//9W\! 19 (B3=:A,T+```` 15 20 ` 16 21 end -
Tst/New/dim_integers.stat
r23812d3 r7d27c2 1 1 >> tst_memory_0 :: 145 7529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:1220402 1 >> tst_memory_1 :: 145 7529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:22282243 1 >> tst_memory_2 :: 145 7529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:22282244 1 >> tst_timer_1 :: 145 7529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:41 1 >> tst_memory_0 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:122432 2 1 >> tst_memory_1 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:2228224 3 1 >> tst_memory_2 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:2228224 4 1 >> tst_timer_1 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:4 -
Tst/New/dim_integers.tst
r23812d3 r7d27c2 65 65 kill r; 66 66 67 ring r = (integer),(x),dp; 68 dim(ideal(x)); 69 dim(ideal(2x)); 70 dim(ideal(2x,0)); 71 dim(ideal(0,2x)); 72 dim(ideal(6x)); 73 dim(ideal(0,x)); 74 kill r; 75 76 ring r=(integer,2,4),(x,y),dp; 77 dim(ideal(x)); 78 kill r; 79 80 ring r=(integer,2,4),x,dp; 81 dim(std(ideal(x))); 82 kill r; 83 84 ring r=(integer,10),(x,y),dp; 85 dim(std(ideal(x))); 86 kill r; 87 88 ring r=(integer,2,4),x,dp; 89 dim(std(ideal(x))); 90 kill r; 91 92 ring r=(integer,10),(x,y),dp; 93 dim(std(ideal(x))); 94 kill r; 95 96 ring r=(integer,2,4),x,dp; 97 dim(ideal(x,x)); 98 dim(ideal(x)); 99 dim(std(ideal(x))); 100 kill r; 101 67 102 tst_status(1);$ -
Tst/Short/ok_s.lst
r5656667 r7d27c2 57 57 bug_tr739 58 58 bug_tr745 59 bug_tr753 59 60 bug_genus_etc 60 61 conv_bi -
configure.ac
r5656667 r7d27c2 227 227 228 228 AC_CONFIG_FILES([Makefile]) 229 AC_CONFIG_FILES([xalloc/Makefile])230 229 AC_CONFIG_FILES([kernel/Makefile]) 231 230 AC_CONFIG_FILES([kernel/numeric/Makefile]) -
factory/cf_inline.cc
r5656667 r7d27c2 125 125 CF_INLINE 126 126 CanonicalForm::CanonicalForm () 127 : value( CFFactory::basic( (long)0) )127 : value( CFFactory::basic( 0L ) ) 128 128 { 129 129 } -
kernel/GBEngine/kstd1.cc
r5656667 r7d27c2 3370 3370 else 3371 3371 { 3372 #ifdef HAVE_RINGS 3372 3373 assume(strat->red == redEcart || strat->red == redRiloc); 3374 #else 3375 assume(strat->red == redEcart); 3376 #endif 3373 3377 if (strat->honey && (strat->syzComp==0)) 3374 3378 return TRUE; -
kernel/GBEngine/syz.h
r5656667 r7d27c2 16 16 // Logarithm of "distance" between a new component and prev component 17 17 #define SYZ_SHIFT_BASE_LOG (BIT_SIZEOF_LONG - 1 - SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE) 18 #define SYZ_SHIFT_BASE ( ((long)1)<< SYZ_SHIFT_BASE_LOG)18 #define SYZ_SHIFT_BASE (1L << SYZ_SHIFT_BASE_LOG) 19 19 struct sSObject{ 20 20 poly p; -
kernel/GBEngine/tgb_internal.h
r5656667 r7d27c2 1102 1102 if (row->idx_array) 1103 1103 { 1104 if (!((coef==(number) (long) 1)||(coef==minus_one)))1104 if (!((coef==(number)1L)||(coef==minus_one))) 1105 1105 { 1106 1106 add_coef_times_sparse(temp_array,temp_size,row,coef); … … 1108 1108 else 1109 1109 { 1110 if (coef==(number) (long) 1)1110 if (coef==(number)1L) 1111 1111 { 1112 1112 add_sparse(temp_array,temp_size,row); … … 1120 1120 else 1121 1121 //TODO: treat, 1,-1 1122 if (!((coef==(number) (long) 1)||(coef==minus_one)))1122 if (!((coef==(number)1L)||(coef==minus_one))) 1123 1123 { 1124 1124 add_coef_times_dense(temp_array,temp_size,row->coef_array,row->len,coef); … … 1126 1126 else 1127 1127 { 1128 if (coef==(number) (long)1)1128 if (coef==(number)1L) 1129 1129 add_dense(temp_array,temp_size,row->coef_array,row->len); 1130 1130 else -
kernel/combinatorics/hutil.h
r5656667 r7d27c2 9 9 10 10 class intvec; 11 12 struct omBin_s ; typedef struct omBin_s omBin_t ; typedef omBin_t * omBin;13 11 14 12 struct ip_sring ; typedef struct ip_sring * ring; -
kernel/ideals.cc
r5656667 r7d27c2 769 769 SI_SAVE_OPT2(save2); 770 770 771 k=si_max( (long)1,id_RankFreeModule(h1,currRing));771 k=si_max(1L,id_RankFreeModule(h1,currRing)); 772 772 773 773 if ((k==1) && (!lift3)) si_opt_2 |=Sy_bit(V_IDLIFT); -
libpolys/coeffs/Makefile.am
r5656667 r7d27c2 18 18 modulop.cc mpr_complex.cc \ 19 19 bigintmat.cc AE.cc OPAE.cc AEp.cc OPAEp.cc AEQ.cc OPAEQ.cc \ 20 flintcf_Q.cc 20 flintcf_Q.cc flintcf_Zn.cc 21 21 22 22 libcoeffs_la_SOURCES = $(SOURCES) … … 27 27 shortfl.h mpr_complex.h mpr_global.h numstats.h \ 28 28 bigintmat.h Enumerator.h AE.h OPAE.h AEp.h OPAEp.h AEQ.h OPAEQ.h \ 29 flintcf_Q.h 29 flintcf_Q.h flintcf_Zn.h 30 30 31 31 libcoeffs_la_LIBADD = ${top_builddir}/reporter/libreporter.la ${top_builddir}/misc/libmisc.la \ -
libpolys/coeffs/flintcf_Q.cc
r5656667 r7d27c2 71 71 static void CoeffWrite(const coeffs r, BOOLEAN details) 72 72 { 73 Print("// flint fmpq_poly\n");74 } 75 BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void * parameter)73 Print("// coefficients: flint fmpq_poly\n"); 74 } 75 static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void * parameter) 76 76 { 77 77 return (r->type==n); -
libpolys/coeffs/gnumpc.cc
r5656667 r7d27c2 88 88 89 89 if( i == 1 ) 90 return (number)(new gmp_complex( (long)0, (long)1));90 return (number)(new gmp_complex( 0L, 1L )); 91 91 92 92 return NULL; // new gmp_complex( ) // 0? … … 100 100 assume( getCoeffType(r) == ID ); 101 101 102 gmp_complex* n= new gmp_complex( (long)i, (long)0);102 gmp_complex* n= new gmp_complex( (long)i, 0L ); 103 103 104 104 return (number)n; … … 388 388 { 389 389 s += N; 390 gmp_complex *aa=new gmp_complex( (long)0,(long)1);390 gmp_complex *aa=new gmp_complex(0L,1L); 391 391 *a=(number)aa; 392 392 } 393 393 else 394 394 { 395 *a=(number) new gmp_complex( (long)1);395 *a=(number) new gmp_complex(1L); 396 396 } 397 397 return s; -
libpolys/coeffs/longrat.cc
r5656667 r7d27c2 113 113 { 114 114 assume(x->s==3); 115 if (mpz_cmp_ si(x->z,(long)0)==0)115 if (mpz_cmp_ui(x->z,0L)==0) 116 116 { 117 117 mpz_clear(x->z); … … 156 156 157 157 #define MP_SMALL 1 158 //#define mpz_isNeg(A) (mpz_cmp_si(A, (long)0)<0)158 //#define mpz_isNeg(A) (mpz_cmp_si(A,0L)<0) 159 159 #define mpz_isNeg(A) ((A)->_mp_size<0) 160 160 #define mpz_limb_size(A) ((A)->_mp_size) … … 306 306 if (a->z[0]._mp_alloc==0) 307 307 Print("!!longrat:n->alloc=0 in %s:%d\n",f,l); 308 if ((mpz_size1(a->n) ==1) && (mpz_cmp_si(a->n, (long)1)==0))308 if ((mpz_size1(a->n) ==1) && (mpz_cmp_si(a->n,1L)==0)) 309 309 { 310 310 Print("!!longrat:integer as rational in %s:%d\n",f,l); … … 477 477 for (i=0;i<size;i++) dd[i] = qp[i]; 478 478 bl = 1-e; 479 nn = (mp_ptr)omAlloc (sizeof(mp_limb_t)*bl);479 nn = (mp_ptr)omAlloc0(sizeof(mp_limb_t)*bl); 480 480 nn[bl-1] = 1; 481 for (i=bl-2;i>=0;i--) nn[i] = 0;482 481 ndest = res->n; 483 482 ndest->_mp_d = nn; … … 497 496 dest->_mp_d = dd; 498 497 dest->_mp_alloc = al; 499 if (negative) dest->_mp_size = -dest->_mp_size;498 if (negative) mpz_neg(dest,dest); 500 499 501 500 if (res->s==0) … … 674 673 #endif 675 674 n->s=1; 676 if (( long)a>0L)677 { 678 mpz_init_set_si(n->z, (long)1);675 if (((long)a)>0L) 676 { 677 mpz_init_set_si(n->z,1L); 679 678 mpz_init_set_si(n->n,(long)SR_TO_INT(a)); 680 679 } 681 680 else 682 681 { 683 mpz_init_set_si(n->z, (long)-1);682 mpz_init_set_si(n->z,-1L); 684 683 mpz_init_set_si(n->n,(long)-SR_TO_INT(a)); 685 684 } … … 692 691 #endif 693 692 { 694 n->s=a->s;695 693 mpz_init_set(n->n,a->z); 696 694 switch (a->s) … … 698 696 case 0: 699 697 case 1: 698 n->s=a->s; 700 699 mpz_init_set(n->z,a->n); 701 700 if (mpz_isNeg(n->n)) /* && n->s<2*/ … … 704 703 mpz_neg(n->n,n->n); 705 704 } 706 if (mpz_cmp_ si(n->n,(long)1)==0)705 if (mpz_cmp_ui(n->n,1L)==0) 707 706 { 708 707 mpz_clear(n->n); … … 712 711 break; 713 712 case 3: 713 // i.e. |a| > 2^... 714 714 n->s=1; 715 715 if (mpz_isNeg(n->n)) /* && n->s<2*/ 716 716 { 717 717 mpz_neg(n->n,n->n); 718 mpz_init_set_si(n->z, (long)-1);718 mpz_init_set_si(n->z,-1L); 719 719 } 720 720 else 721 721 { 722 mpz_init_set_si(n->z, (long)1);722 mpz_init_set_si(n->z,1L); 723 723 } 724 724 break; … … 961 961 int p=IsPrime(ch); 962 962 coeffs rr=NULL; 963 if (( long)p==ch)963 if (((long)p)==ch) 964 964 { 965 965 rr = nInitChar(n_Zp,(void*)ch); … … 1058 1058 { 1059 1059 mpz_init_set(u->n,a->n); 1060 if (( long)b>0L)1060 if (((long)b)>0L) 1061 1061 mpz_mul_ui(u->n,u->n,SR_TO_INT(b)); 1062 1062 else … … 1087 1087 mpz_neg(u->n,u->n); 1088 1088 } 1089 if (mpz_cmp_si(u->n, (long)1)==0)1089 if (mpz_cmp_si(u->n,1L)==0) 1090 1090 { 1091 1091 mpz_clear(u->n); … … 1124 1124 if (x->s<2) 1125 1125 { 1126 if (mpz_cmp_si(x->n, (long)1)==0)1126 if (mpz_cmp_si(x->n,1L)==0) 1127 1127 { 1128 1128 x->s=3; … … 1314 1314 { 1315 1315 assume(x->s<2); 1316 if (mpz_cmp_ui(x->z, (long)0)==0)1316 if (mpz_cmp_ui(x->z,0L)==0) 1317 1317 { 1318 1318 _nlDelete_NoImm(&x); … … 1344 1344 else if (x->s==0) 1345 1345 { 1346 if (mpz_cmp_si(x->n, (long)1)==0)1346 if (mpz_cmp_si(x->n,1L)==0) 1347 1347 { 1348 1348 mpz_clear(x->n); … … 1356 1356 mpz_gcd(gcd,x->z,x->n); 1357 1357 x->s=1; 1358 if (mpz_cmp_si(gcd, (long)1)!=0)1358 if (mpz_cmp_si(gcd,1L)!=0) 1359 1359 { 1360 1360 mpz_divexact(x->z,x->z,gcd); 1361 1361 mpz_divexact(x->n,x->n,gcd); 1362 if (mpz_cmp_si(x->n, (long)1)==0)1362 if (mpz_cmp_si(x->n,1L)==0) 1363 1363 { 1364 1364 mpz_clear(x->n); … … 1399 1399 else 1400 1400 mpz_gcd(gcd,a->z,b->n); 1401 if (mpz_cmp_si(gcd, (long)1)!=0)1401 if (mpz_cmp_si(gcd,1L)!=0) 1402 1402 { 1403 1403 mpz_t bt; … … 1561 1561 if (b->s!=0) 1562 1562 return FALSE; 1563 if ((( long)a> 0L) && (mpz_isNeg(b->z)))1563 if ((((long)a) > 0L) && (mpz_isNeg(b->z))) 1564 1564 return FALSE; 1565 if ((( long)a< 0L) && (!mpz_isNeg(b->z)))1565 if ((((long)a) < 0L) && (!mpz_isNeg(b->z))) 1566 1566 return FALSE; 1567 1567 mpz_t bb; … … 1653 1653 mpz_gcd(gcd,x->z,x->n); 1654 1654 x->s=1; 1655 if (mpz_cmp_si(gcd, (long)1)!=0)1655 if (mpz_cmp_si(gcd,1L)!=0) 1656 1656 { 1657 1657 mpz_divexact(x->z,x->z,gcd); 1658 1658 mpz_divexact(x->n,x->n,gcd); 1659 if (mpz_cmp_si(x->n, (long)1)==0)1659 if (mpz_cmp_si(x->n,1L)==0) 1660 1660 { 1661 1661 mpz_clear(x->n); … … 1692 1692 mpz_add(u->z,b->z,x); 1693 1693 mpz_clear(x); 1694 if (mpz_cmp_ui(u->z, (long)0)==0)1694 if (mpz_cmp_ui(u->z,0L)==0) 1695 1695 { 1696 1696 mpz_clear(u->z); … … 1711 1711 case 3: 1712 1712 { 1713 if (( long)a>0L)1713 if (((long)a)>0L) 1714 1714 mpz_add_ui(u->z,b->z,SR_TO_INT(a)); 1715 1715 else 1716 1716 mpz_sub_ui(u->z,b->z,-SR_TO_INT(a)); 1717 if (mpz_cmp_ui(u->z,(long)0)==0)1718 {1719 mpz_clear(u->z);1720 FREE_RNUMBER(u);1721 return INT_TO_SR(0);1722 }1723 1717 u->s = 3; 1724 1718 u=nlShort3(u); … … 1747 1741 mpz_clear(x); 1748 1742 1749 if (mpz_cmp_ui(u->z, (long)0)==0)1743 if (mpz_cmp_ui(u->z,0L)==0) 1750 1744 { 1751 1745 mpz_clear(u->z); … … 1770 1764 mpz_mul(u->z,b->z,a->n); 1771 1765 mpz_add(u->z,u->z,a->z); 1772 if (mpz_cmp_ui(u->z, (long)0)==0)1766 if (mpz_cmp_ui(u->z,0L)==0) 1773 1767 { 1774 1768 mpz_clear(u->z); … … 1799 1793 mpz_mul(u->z,a->z,b->n); 1800 1794 mpz_add(u->z,u->z,b->z); 1801 if (mpz_cmp_ui(u->z, (long)0)==0)1795 if (mpz_cmp_ui(u->z,0L)==0) 1802 1796 { 1803 1797 mpz_clear(u->z); … … 1819 1813 { 1820 1814 mpz_add(u->z,a->z,b->z); 1821 if (mpz_cmp_ui(u->z,(long)0)==0)1822 {1823 mpz_clear(u->z);1824 FREE_RNUMBER(u);1825 return INT_TO_SR(0);1826 }1827 1815 u->s = 3; 1828 1816 u=nlShort3(u); … … 1856 1844 case 3: 1857 1845 { 1858 if (( long)b>0L)1846 if (((long)b)>0L) 1859 1847 mpz_add_ui(a->z,a->z,SR_TO_INT(b)); 1860 1848 else … … 1893 1881 case 3: 1894 1882 { 1895 if (( long)a>0L)1883 if (((long)a)>0L) 1896 1884 mpz_add_ui(u->z,b->z,SR_TO_INT(a)); 1897 1885 else … … 1995 1983 mpz_sub(u->z,x,b->z); 1996 1984 mpz_clear(x); 1997 if (mpz_cmp_ui(u->z, (long)0)==0)1985 if (mpz_cmp_ui(u->z,0L)==0) 1998 1986 { 1999 1987 mpz_clear(u->z); … … 2014 2002 case 3: 2015 2003 { 2016 if (( long)a>0L)2004 if (((long)a)>0L) 2017 2005 { 2018 2006 mpz_sub_ui(u->z,b->z,SR_TO_INT(a)); … … 2024 2012 mpz_neg(u->z,u->z); 2025 2013 } 2026 if (mpz_cmp_ui(u->z,(long)0)==0)2027 {2028 mpz_clear(u->z);2029 FREE_RNUMBER(u);2030 return INT_TO_SR(0);2031 }2032 2014 u->s = 3; 2033 2015 u=nlShort3(u); … … 2048 2030 mpz_sub(u->z,a->z,x); 2049 2031 mpz_clear(x); 2050 if (mpz_cmp_ui(u->z, (long)0)==0)2032 if (mpz_cmp_ui(u->z,0L)==0) 2051 2033 { 2052 2034 mpz_clear(u->z); … … 2067 2049 case 3: 2068 2050 { 2069 if (( long)b>0L)2051 if (((long)b)>0L) 2070 2052 { 2071 2053 mpz_sub_ui(u->z,a->z,SR_TO_INT(b)); … … 2074 2056 { 2075 2057 mpz_add_ui(u->z,a->z,-SR_TO_INT(b)); 2076 }2077 if (mpz_cmp_ui(u->z,(long)0)==0)2078 {2079 mpz_clear(u->z);2080 FREE_RNUMBER(u);2081 return INT_TO_SR(0);2082 2058 } 2083 2059 u->s = 3; … … 2108 2084 mpz_clear(x); 2109 2085 mpz_clear(y); 2110 if (mpz_cmp_ui(u->z, (long)0)==0)2086 if (mpz_cmp_ui(u->z,0L)==0) 2111 2087 { 2112 2088 mpz_clear(u->z); … … 2134 2110 mpz_sub(u->z,a->z,x); 2135 2111 mpz_clear(x); 2136 if (mpz_cmp_ui(u->z, (long)0)==0)2112 if (mpz_cmp_ui(u->z,0L)==0) 2137 2113 { 2138 2114 mpz_clear(u->z); … … 2166 2142 mpz_sub(u->z,x,b->z); 2167 2143 mpz_clear(x); 2168 if (mpz_cmp_ui(u->z, (long)0)==0)2144 if (mpz_cmp_ui(u->z,0L)==0) 2169 2145 { 2170 2146 mpz_clear(u->z); … … 2186 2162 { 2187 2163 mpz_sub(u->z,a->z,b->z); 2188 if (mpz_cmp_ui(u->z,(long)0)==0)2189 {2190 mpz_clear(u->z);2191 FREE_RNUMBER(u);2192 return INT_TO_SR(0);2193 }2194 2164 u->s = 3; 2195 2165 u=nlShort3(u); … … 2236 2206 u->s=b->s; 2237 2207 if (u->s==1) u->s=0; 2238 if (( long)a>0L)2208 if (((long)a)>0L) 2239 2209 { 2240 2210 mpz_mul_ui(u->z,b->z,(unsigned long)SR_TO_INT(a)); … … 2456 2426 #else 2457 2427 LONG ii=(LONG)i; 2458 if ( ((( long)ii==i) && ((ii << 3) >> 3) == ii )) n=INT_TO_SR(ii);2428 if ( ((((long)ii)==i) && ((ii << 3) >> 3) == ii )) n=INT_TO_SR(ii); 2459 2429 else n=nlRInit(i); 2460 2430 #endif … … 2480 2450 if (a==INT_TO_SR(0)) return TRUE; 2481 2451 if ((SR_HDL(a) & SR_INT)||(a==NULL)) return FALSE; 2482 if (mpz_cmp_si(a->z, (long)0)==0)2452 if (mpz_cmp_si(a->z,0L)==0) 2483 2453 { 2484 2454 printf("gmp-0 in nlIsZero\n"); … … 2830 2800 assume(!mpz_isNeg(P)); 2831 2801 if (mpz_isNeg(N)) mpz_add(N,N,P); 2832 mpz_init_set_si(A, (long)0);2802 mpz_init_set_si(A,0L); 2833 2803 mpz_init_set_ui(B,(unsigned long)1); 2834 mpz_init_set_si(C, (long)0);2804 mpz_init_set_si(C,0L); 2835 2805 mpz_init(D); 2836 2806 mpz_init_set(E,P); 2837 2807 number z=INT_TO_SR(0); 2838 while(mpz_cmp_si(N, (long)0)!=0)2808 while(mpz_cmp_si(N,0L)!=0) 2839 2809 { 2840 2810 mpz_mul(tmp,N,N); -
libpolys/coeffs/longrat0.cc
r5656667 r7d27c2 78 78 s++; 79 79 s = nlEatLong((char *)s, n); 80 if (mpz_cmp_si(n, (long)0)==0)80 if (mpz_cmp_si(n,0L)==0) 81 81 { 82 82 WerrorS(nDivBy0); … … 84 84 (*a)->s = 3; 85 85 } 86 else if (mpz_cmp_si(n, (long)1)==0)86 else if (mpz_cmp_si(n,1L)==0) 87 87 { 88 88 mpz_clear(n); … … 90 90 } 91 91 } 92 if (mpz_cmp_si(z, (long)0)==0)92 if (mpz_cmp_si(z,0L)==0) 93 93 { 94 94 mpz_clear(z); … … 96 96 *a=INT_TO_SR(0); 97 97 } 98 else 99 if ((*a)->s==3) 98 else if ((*a)->s==3) 100 99 { 101 100 number nlShort3_noinline(number x); -
libpolys/coeffs/modulop.cc
r5656667 r7d27c2 191 191 n_Test(a, r); 192 192 193 return ((r->npPminus1M == (long)a)&&( (long)1!=(long)a));193 return ((r->npPminus1M == (long)a)&&(1L!=(long)a)); 194 194 } 195 195 … … 270 270 // return nvDiv(a,b); 271 271 //#endif 272 if ((long)a==0 )273 return (number)0 ;272 if ((long)a==0L) 273 return (number)0L; 274 274 number d; 275 275 276 276 #ifndef HAVE_DIV_MOD 277 if ((long)b==0 )277 if ((long)b==0L) 278 278 { 279 279 WerrorS(nDivBy0); 280 return (number)0 ;280 return (number)0L; 281 281 } 282 282 … … 298 298 n_Test(c, r); 299 299 300 if ((long)c==0 )300 if ((long)c==0L) 301 301 { 302 302 WerrorS("1/0"); 303 return (number)0 ;303 return (number)0L; 304 304 } 305 305 number d = npInversM(c,r); … … 314 314 n_Test(c, r); 315 315 316 if ((long)c==0 ) return c;316 if ((long)c==0L) return c; 317 317 318 318 #if 0 … … 333 333 334 334 //return (long)a != (long)b; 335 return ( long)a > (long)b;335 return ((long)a) > ((long)b); 336 336 } 337 337 … … 632 632 BOOLEAN npDBTest (number a, const char *f, const int l, const coeffs r) 633 633 { 634 if (((long)a<0 ) || ((long)a>r->ch))634 if (((long)a<0L) || ((long)a>(long)r->ch)) 635 635 { 636 636 Print("wrong mod p number %ld at %s,%d\n",(long)a,f,l); … … 879 879 number nvDiv (number a,number b, const coeffs r) 880 880 { 881 if ((long)a==0 )882 return (number)0 ;883 else if ((long)b==0 )881 if ((long)a==0L) 882 return (number)0L; 883 else if ((long)b==0L) 884 884 { 885 885 WerrorS(nDivBy0); 886 return (number)0 ;886 return (number)0L; 887 887 } 888 888 else … … 894 894 number nvInvers (number c, const coeffs r) 895 895 { 896 if ((long)c==0 )896 if ((long)c==0L) 897 897 { 898 898 WerrorS(nDivBy0); 899 return (number)0 ;899 return (number)0L; 900 900 } 901 901 return nvInversM(c,r); -
libpolys/coeffs/rintegers.cc
r5656667 r7d27c2 567 567 nrzWrite(x, NULL); 568 568 #endif 569 if (mpz_cmp_ui((mpz_ptr) x, (long)0)==0)569 if (mpz_cmp_ui((mpz_ptr) x,0L)==0) 570 570 { 571 571 mpz_clear((mpz_ptr)x); … … 1552 1552 { 1553 1553 if (SR_HDL(x) & SR_INT) return TRUE; 1554 if (mpz_cmp_ui((mpz_ptr) x, (long)0)==0)1554 if (mpz_cmp_ui((mpz_ptr) x,0L)==0) 1555 1555 { 1556 1556 Print("gmp-0 %s:%d\n",f,l); -
libpolys/coeffs/rmodulon.cc
r5656667 r7d27c2 81 81 void nrnCoeffWrite (const coeffs r, BOOLEAN /*details*/) 82 82 { 83 long l = (long)mpz_sizeinbase(r->modBase, 10) + 2;83 size_t l = (size_t)mpz_sizeinbase(r->modBase, 10) + 2; 84 84 char* s = (char*) omAlloc(l); 85 85 s= mpz_get_str (s, 10, r->modBase); … … 97 97 static char* nrnCoeffString(const coeffs r) 98 98 { 99 long l = (long)mpz_sizeinbase(r->modBase, 10) +2;99 size_t l = (size_t)mpz_sizeinbase(r->modBase, 10) +2; 100 100 char* b = (char*) omAlloc(l); 101 101 b= mpz_get_str (b, 10, r->modBase); … … 668 668 mpz_init_set_si(rr, 0); 669 669 mpz_gcd(g, (mpz_ptr)r->modNumber, (mpz_ptr)b); // g is now as above 670 if (mpz_cmp_si(g, (long)1) != 0) mpz_mod(rr, (mpz_ptr)a, g); // the case g <> 1670 if (mpz_cmp_si(g, 1L) != 0) mpz_mod(rr, (mpz_ptr)a, g); // the case g <> 1 671 671 mpz_clear(g); 672 672 omFreeBin(g, gmp_nrz_bin); -
libpolys/polys/flintconv.cc
r5656667 r7d27c2 12 12 #include "flintconv.h" 13 13 14 #ifdef FLINT_VER_2_4_5 14 #ifdef HAVE_FLINT 15 #if __FLINT_RELEASE >= 20500 15 16 #include <coeffs/coeffs.h> 16 17 #include <polys/monomials/p_polys.h> … … 25 26 26 27 27 #ifdef HAVE_FLINT28 28 int convFlintISingI (fmpz_t f) 29 29 { -
libpolys/polys/flintconv.h
r5656667 r7d27c2 12 12 * This file is work in progress and currently not part of the official Singular 13 13 * 14 * @note the code is garded by the undefined macro FLINT_VER_2_4_514 * @note the code is garded by the version test __FLINT_RELEASE >= 20500 (>=2.5) 15 15 * In its current form it will never become an official part. 16 16 * (conversion routines may be moved to other files/directories, etc.) … … 26 26 **/ 27 27 28 // Have to define this when this code shall be used: 29 //#define FLINT_VER_2_4_5 30 #ifdef FLINT_VER_2_4_5 28 #ifdef HAVE_FLINT 29 #include <flint/flint.h> 30 31 #if __FLINT_RELEASE >= 20500 31 32 #include <polys/matpol.h> 32 33 #include <coeffs/bigintmat.h> 33 // #include <polys/monomials/ring.h>34 35 36 #ifdef HAVE_FLINT37 #include <flint/flint.h>38 34 #include <flint/fmpz.h> 39 35 #include <flint/fmpq.h> … … 49 45 intvec* singflint_LLL(intvec* A, intvec* T); 50 46 #endif 51 52 47 #endif 53 48 #endif -
libpolys/polys/mod_raw.cc
r5656667 r7d27c2 50 50 static BOOLEAN warn_proc = FALSE; 51 51 #ifndef DL_TAIL 52 #ifdef SING_NDEBUG53 #define DL_TAIL ".so"54 #else55 52 #define DL_TAIL ".so" 56 53 //#define DL_TAIL "_g.so" 57 #endif58 54 #endif 59 55 -
libpolys/polys/monomials/p_polys.cc
r5656667 r7d27c2 3925 3925 */ 3926 3926 poly p_PermPoly (poly p, const int * perm, const ring oldRing, const ring dst, 3927 nMapFunc nMap, const int *par_perm, int OldPar )3927 nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult) 3928 3928 { 3929 3929 #if 0 … … 3938 3938 assume(dst != NULL); 3939 3939 assume(dst->cf != NULL); 3940 #ifdef HAVE_PLURAL 3941 poly tmp_mm=p_One(dst); 3942 #endif 3940 3943 while (p != NULL) 3941 3944 { … … 3983 3986 p_SetExp(qq, i, e, dst); 3984 3987 else if (perm[i]>0) 3988 { 3989 #ifdef HAVE_PLURAL 3990 if(use_mult) 3991 { 3992 p_SetExp(tmp_mm,perm[i],e,dst); 3993 p_Setm(tmp_mm,dst); 3994 qq=p_Mult_mm(qq,tmp_mm,dst); 3995 p_SetExp(tmp_mm,perm[i],0,dst); 3996 3997 } 3998 else 3999 #endif 3985 4000 p_AddExp(qq,perm[i], e/*p_GetExp( p,i,oldRing)*/, dst); 4001 } 3986 4002 else if (perm[i]<0) 3987 4003 { … … 4124 4140 PrintS("result: "); p_Write(result,dst,dst); 4125 4141 #endif 4142 #ifdef HAVE_PLURAL 4143 p_LmDelete(&tmp_mm,dst); 4144 #endif 4126 4145 return result; 4127 4146 } -
libpolys/polys/monomials/p_polys.h
r5656667 r7d27c2 1915 1915 1916 1916 poly p_PermPoly (poly p, const int * perm,const ring OldRing, const ring dst, 1917 nMapFunc nMap, const int *par_perm=NULL, int OldPar=0); 1917 nMapFunc nMap, const int *par_perm=NULL, int OldPar=0, 1918 BOOLEAN use_mult=FALSE); 1918 1919 1919 1920 /*----------------------------------------------------*/ -
libpolys/polys/monomials/ring.h
r5656667 r7d27c2 359 359 360 360 /// we must always have this test! 361 static inline boolrIsPluralRing(const ring r)361 static inline BOOLEAN rIsPluralRing(const ring r) 362 362 { 363 363 assume(r != NULL); assume(r->cf != NULL); … … 366 366 return (r != NULL) && ((n=r->GetNC()) != NULL) /*&& (n->type != nc_error)*/; 367 367 #else 368 return false;369 #endif 370 } 371 372 static inline boolrIsRatGRing(const ring r)368 return FALSE; 369 #endif 370 } 371 372 static inline BOOLEAN rIsRatGRing(const ring r) 373 373 { 374 374 assume(r != NULL); … … 378 378 && (r->real_var_start>1); 379 379 #else 380 return false; 381 #endif 382 } 383 384 385 380 return FALSE; 381 #endif 382 } 386 383 387 384 // The following are for LaScala3 only! -
libpolys/polys/simpleideals.cc
r5656667 r7d27c2 1174 1174 pIter(p); 1175 1175 pNext(h)=NULL; 1176 cp = si_max( (long)1,p_GetComp(h, R)); // if used for ideals too1176 cp = si_max(1L,p_GetComp(h, R)); // if used for ideals too 1177 1177 //cp = p_GetComp(h,R); 1178 1178 p_SetComp(h,0,R); … … 1281 1281 { 1282 1282 p=F[i]=P[i]; 1283 cmax=si_max(cmax, (long)p_MaxComp(p,R));1283 cmax=si_max(cmax,p_MaxComp(p,R)); 1284 1284 } 1285 1285 cmax++; -
libpolys/polys/sparsmat.cc
r5656667 r7d27c2 511 511 { 512 512 res->m[i-1] = sm_Smpoly2Poly(m_res[i],_R); 513 res->rank=si_max(res->rank, (long)p_MaxComp(res->m[i-1],_R));513 res->rank=si_max(res->rank, p_MaxComp(res->m[i-1],_R)); 514 514 } 515 515 return res; -
libpolys/polys/templates/p_Procs_Dynamic.cc
r5656667 r7d27c2 95 95 case p_ShallowCopyDelete_Proc: 96 96 return cast_A_to_vptr(p_ShallowCopyDelete__FieldGeneral_LengthGeneral_OrdGeneral); 97 case p_Mult_nn_Proc:98 return cast_A_to_vptr(p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral);99 case pp_Mult_nn_Proc:100 return cast_A_to_vptr(pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral);101 case pp_Mult_mm_Proc:102 return cast_A_to_vptr(pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral);103 case pp_Mult_mm_Noether_Proc:104 return cast_A_to_vptr(pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral);105 case p_Mult_mm_Proc:106 return cast_A_to_vptr(p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral);107 97 case p_Add_q_Proc: 108 98 return cast_A_to_vptr(p_Add_q__FieldGeneral_LengthGeneral_OrdGeneral); 109 case p_Minus_mm_Mult_qq_Proc:110 return cast_A_to_vptr(p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral);111 99 case p_Neg_Proc: 112 100 return cast_A_to_vptr(p_Neg__FieldGeneral_LengthGeneral_OrdGeneral); 113 case pp_Mult_Coeff_mm_DivSelect_Proc:114 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral);115 case pp_Mult_Coeff_mm_DivSelectMult_Proc:116 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral);117 101 case p_Merge_q_Proc: 118 102 return cast_A_to_vptr(p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral); 119 103 case p_kBucketSetLm_Proc: 120 104 return cast_A_to_vptr(p_kBucketSetLm__FieldGeneral_LengthGeneral_OrdGeneral); 105 #ifdef HAVE_RINGS 106 case p_Mult_nn_Proc: 107 return cast_A_to_vptr(p_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral); 108 case pp_Mult_nn_Proc: 109 return cast_A_to_vptr(pp_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral); 110 case pp_Mult_mm_Proc: 111 return cast_A_to_vptr(pp_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral); 112 case pp_Mult_mm_Noether_Proc: 113 return cast_A_to_vptr(pp_Mult_mm_Noether__RingGeneral_LengthGeneral_OrdGeneral); 114 case p_Mult_mm_Proc: 115 return cast_A_to_vptr(p_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral); 116 case p_Minus_mm_Mult_qq_Proc: 117 return cast_A_to_vptr(p_Minus_mm_Mult_qq__RingGeneral_LengthGeneral_OrdGeneral); 118 case pp_Mult_Coeff_mm_DivSelect_Proc: 119 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelect__RingGeneral_LengthGeneral_OrdGeneral); 120 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 121 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelectMult__RingGeneral_LengthGeneral_OrdGeneral); 122 #else 123 case p_Mult_nn_Proc: 124 return cast_A_to_vptr(p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral); 125 case pp_Mult_nn_Proc: 126 return cast_A_to_vptr(pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral); 127 case pp_Mult_mm_Proc: 128 return cast_A_to_vptr(pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral); 129 case pp_Mult_mm_Noether_Proc: 130 return cast_A_to_vptr(pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral); 131 case p_Mult_mm_Proc: 132 return cast_A_to_vptr(p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral); 133 case p_Minus_mm_Mult_qq_Proc: 134 return cast_A_to_vptr(p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral); 135 case pp_Mult_Coeff_mm_DivSelect_Proc: 136 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral); 137 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 138 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral); 139 #endif 121 140 case p_Unknown_Proc: 122 141 break; … … 139 158 case p_ShallowCopyDelete_Proc: 140 159 return "p_ShallowCopyDelete__FieldGeneral_LengthGeneral_OrdGeneral"; 141 case p_Mult_nn_Proc:142 return "p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral";143 case pp_Mult_nn_Proc:144 return "pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral";145 case pp_Mult_mm_Proc:146 return "pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral";147 case pp_Mult_mm_Noether_Proc:148 return "pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral";149 case p_Mult_mm_Proc:150 return "p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral";151 160 case p_Add_q_Proc: 152 161 return "p_Add_q__FieldGeneral_LengthGeneral_OrdGeneral"; 153 case p_Minus_mm_Mult_qq_Proc:154 return "p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral";155 162 case p_Neg_Proc: 156 163 return "p_Neg__FieldGeneral_LengthGeneral_OrdGeneral"; 157 case pp_Mult_Coeff_mm_DivSelect_Proc:158 return "pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral";159 case pp_Mult_Coeff_mm_DivSelectMult_Proc:160 return "pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral";161 164 case p_Merge_q_Proc: 162 165 return "p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral"; … … 165 168 case p_Unknown_Proc: 166 169 break; 170 #ifdef HAVE_RINGS 171 case p_Mult_nn_Proc: 172 return "p_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral"; 173 case pp_Mult_nn_Proc: 174 return "pp_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral"; 175 case pp_Mult_mm_Proc: 176 return "pp_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral"; 177 case pp_Mult_mm_Noether_Proc: 178 return "pp_Mult_mm_Noether__RingGeneral_LengthGeneral_OrdGeneral"; 179 case p_Mult_mm_Proc: 180 return "p_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral"; 181 case p_Minus_mm_Mult_qq_Proc: 182 return "p_Minus_mm_Mult_qq__RingGeneral_LengthGeneral_OrdGeneral"; 183 case pp_Mult_Coeff_mm_DivSelect_Proc: 184 return "pp_Mult_Coeff_mm_DivSelect__RingGeneral_LengthGeneral_OrdGeneral"; 185 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 186 return "pp_Mult_Coeff_mm_DivSelectMult__RingGeneral_LengthGeneral_OrdGeneral"; 187 #else 188 case p_Mult_nn_Proc: 189 return "p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral"; 190 case pp_Mult_nn_Proc: 191 return "pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral"; 192 case pp_Mult_mm_Proc: 193 return "pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral"; 194 case pp_Mult_mm_Noether_Proc: 195 return "pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral"; 196 case p_Mult_mm_Proc: 197 return "p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral"; 198 case p_Minus_mm_Mult_qq_Proc: 199 return "p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral"; 200 case pp_Mult_Coeff_mm_DivSelect_Proc: 201 return "pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral"; 202 case pp_Mult_Coeff_mm_DivSelectMult_Proc: 203 return "pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral"; 204 #endif 167 205 } 168 206 return "p_Unknown_Proc"; -
libpolys/polys/templates/p_Procs_Generate.cc
r5656667 r7d27c2 34 34 FieldZpProcs = 0, 35 35 FieldQProcs = 0, 36 #ifdef HAVE_RINGS37 36 RingGeneralProcs = 0, 38 #endif39 37 KernelProcs = 0, 40 38 UnknownProcs = 0; … … 45 43 // general procs go into kernel 46 44 if (field == FieldGeneral && length == LengthGeneral && ord == OrdGeneral) 45 return 1; 46 47 if (field == RingGeneral && length == LengthGeneral && ord == OrdGeneral) 47 48 return 1; 48 49 … … 112 113 else if (strcmp(module, "FieldQ") == 0) 113 114 FieldQProcs++; 114 #ifdef HAVE_RINGS115 else if (strcmp(module, "RingGeneral") == 0)116 RingGeneralProcs++;117 #endif118 115 else 119 116 UnknownProcs++; 117 if (field==RingGeneral) 118 RingGeneralProcs++; 120 119 121 120 printf("#ifdef p_Procs_%s\n", module); 122 121 } 123 122 #endif 123 if (strcmp(s_field, "RingGeneral") == 0) 124 { 124 125 #ifdef HAVE_RINGS 125 if (strcmp(s_field, "RingGeneral") == 0)126 printf("#define HAVE_RINGS\n"); 126 127 printf("#define HAVE_ZERODIVISORS\n"); 127 #endif 128 #else 129 printf("#if 0\n"); 130 #endif 131 } 132 else 133 { 134 printf("#undef HAVE_RINGS\n"); 135 printf("#undef HAVE_ZERODIVISORS\n"); 136 } 128 137 i = 0; 129 138 while (macros_field[i] != NULL) … … 189 198 printf("#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n"); 190 199 } 191 192 193 200 printf("#undef p_MemAddAdjust__T\n"); 194 201 printf("#define p_MemAddAdjust__T(p, r) do {} while (0)\n"); … … 198 205 printf("#include \"polys/templates/%s__T.cc\"\n", s_what); 199 206 printf("#undef %s\n", s_what); 207 if (strcmp(s_field, "RingGeneral") == 0) 208 { 200 209 #ifdef HAVE_RINGS 201 if (strcmp(s_field, "RingGeneral") == 0)210 printf("#undef HAVE_RINGS\n"); 202 211 printf("#undef HAVE_ZERODIVISORS\n"); 203 #endif 212 #else 213 printf("#endif\n"); 214 #endif 215 } 204 216 #ifndef p_Procs_Static 205 217 printf("#endif // p_Procs_[Kernel|Field*]\n"); … … 318 330 printf("* FieldZpProcs = %d\n",FieldZpProcs); 319 331 printf("* FieldQProcs = %d\n",FieldQProcs); 320 printf("* FieldGeneralProcs = %d\n",FieldGeneralProcs); 332 printf("* FieldGeneralProcs = %d\n",FieldGeneralProcs-RingGeneralProcs); 333 printf("* RingGeneralProcs = %d (in FieldGeneral module)\n",RingGeneralProcs); 321 334 printf("* FieldUnknownProcs = %d\n",UnknownProcs); 322 335 #endif -
libpolys/polys/templates/p_Procs_Impl.h
r5656667 r7d27c2 11 11 #define P_PROCS_IMPL_H 12 12 13 #include <misc/auxiliary.h> 14 13 15 /*************************************************************** 14 16 * … … 89 91 // Predicate which returns true if alloc/copy/free of numbers is 90 92 // like that of Zp (rings should use GMP in future) 91 #ifdef HAVE_RINGS92 93 #define ZP_COPY_FIELD(field) \ 93 94 (field == FieldZp || field == FieldGF || field == FieldR) 94 #else95 #define ZP_COPY_FIELD(field) \96 (field == FieldZp || field == FieldGF || field == FieldR)97 #endif98 95 99 96 /*************************************************************** … … 120 117 FieldQ_a, 121 118 #endif 122 #ifdef HAVE_RINGS123 119 RingGeneral, 124 #endif125 120 FieldUnknown 126 121 } p_Field; … … 216 211 case FieldQ_a: return "FieldQ_a"; 217 212 #endif 218 #ifdef HAVE_RINGS219 213 case RingGeneral: return "RingGeneral"; 220 #endif221 214 case FieldUnknown: return "FieldUnknown"; 222 215 } … … 405 398 // simply exclude some things 406 399 if ((proc == pp_Mult_mm_Noether_Proc || proc == p_kBucketSetLm_Proc) && 407 #ifdef HAVE_RINGS408 400 (field != RingGeneral) && 409 #endif410 401 (field != FieldZp)) 411 402 { … … 428 419 proc != p_Merge_q_Proc)) 429 420 { 430 #ifdef HAVE_RINGS 431 if (field != RingGeneral) 432 #endif 433 field = FieldGeneral; 421 if (field != RingGeneral) field = FieldGeneral; 434 422 length = LengthGeneral; 435 423 ord = OrdGeneral; … … 446 434 (HAVE_FAST_FIELD == 1 && field != FieldZp) || 447 435 (field != FieldZp && field != FieldQ)) 448 #ifdef HAVE_RINGS 449 if (field != RingGeneral) 450 #endif 451 field = FieldGeneral; 436 if (field != RingGeneral) field = FieldGeneral; 452 437 } 453 438 … … 487 472 { 488 473 if (ZP_COPY_FIELD(field)) field = FieldZp; 474 else if (field == RingGeneral) field = FieldGeneral; 489 475 } 490 476 491 477 // in p_Add_q, p_MemCmp works with CompLSize, 492 478 // hence, we do not need to consider ZeroOrds 493 static inline void p_Add_q__Filter(p_ Length &length, p_Ord &ord)479 static inline void p_Add_q__Filter(p_Field &field,p_Length &length, p_Ord &ord) 494 480 { 495 481 if (IsZeroOrd(ord)) … … 501 487 } 502 488 } 489 if (field == RingGeneral) field = FieldGeneral; 490 } 491 492 static inline void p_Neg__Filter(p_Field &field,p_Length &length, p_Ord &ord) 493 { 494 if (field == RingGeneral) field = FieldGeneral; 495 length =LengthGeneral; 496 ord =OrdGeneral; 503 497 } 504 498 … … 516 510 { 517 511 // all the other orderings might occur (remember Mixed Orderings!) 518 #ifdef HAVE_RINGS 519 if (field != RingGeneral) 520 #endif 521 field = FieldGeneral; 512 if (field != RingGeneral) field = FieldGeneral; 522 513 ord = OrdGeneral; 523 514 length = LengthGeneral; … … 532 523 case p_Add_q_Proc: 533 524 case p_Merge_q_Proc: 534 p_Add_q__Filter(length, ord); 525 p_Add_q__Filter(field, length, ord); 526 break; 527 528 case p_Neg_Proc: 529 p_Neg__Filter(field, length, ord); 535 530 break; 536 531 … … 547 542 if (length == LengthOne || length == LengthTwo) 548 543 { 549 #ifdef HAVE_RINGS 550 if (field != RingGeneral) 551 #endif 552 field = FieldGeneral; 544 if (field != RingGeneral) field = FieldGeneral; 553 545 length = LengthGeneral; 554 546 ord = OrdGeneral; … … 570 562 } 571 563 572 // returns 1if combination of field/length/ord is invalid564 // returns 0 if combination of field/length/ord is invalid 573 565 static inline int IsValidSpec(p_Field field, p_Length length, p_Ord ord) 574 566 { … … 589 581 590 582 // we cover everything for length <= two 591 if (ord == OrdGeneral && length > =LengthTwo)583 if (ord == OrdGeneral && length > LengthTwo) 592 584 return 0; 585 #ifndef HAVE_RINGS 586 if (field == RingGeneral) return 0; 587 #endif 593 588 return 1; 594 589 } … … 701 696 #endif 702 697 698 #define SetProcs_ring(field, length, ord) \ 699 do \ 700 { \ 701 SetProc(p_Copy, FieldGeneral, length, OrdGeneral); \ 702 SetProc(p_Delete, FieldGeneral, LengthGeneral, OrdGeneral); \ 703 SetProc(p_ShallowCopyDelete, FieldGeneral, length, OrdGeneral); \ 704 SetProc(p_Add_q, FieldGeneral, length, ord); \ 705 SetProc(p_Neg, FieldGeneral, LengthGeneral, OrdGeneral); \ 706 SetProc(p_Merge_q, FieldGeneral, length, ord); \ 707 SetProc(p_Mult_nn, field, LengthGeneral, OrdGeneral); \ 708 SetProc(pp_Mult_nn, field, LengthGeneral, OrdGeneral); \ 709 SetProc(pp_Mult_mm, field, length, OrdGeneral); \ 710 SetProc(p_Mult_mm, field, length, OrdGeneral); \ 711 SetProc(p_Minus_mm_Mult_qq, field, length, ord); \ 712 SetProc(pp_Mult_mm_Noether, field, length, ord); \ 713 SetProc(pp_Mult_Coeff_mm_DivSelect, field, length, OrdGeneral); \ 714 SetProc(pp_Mult_Coeff_mm_DivSelectMult, field, length, OrdGeneral); \ 715 } \ 716 while (0) 717 703 718 #endif // P_PROCS_IMPL_H 704 719 -
libpolys/polys/templates/p_Procs_Set.h
r5656667 r7d27c2 15 15 16 16 #include <reporter/reporter.h> 17 #include <libpolys/libpolysconfig.h> 17 18 18 19 // extract p_Procs properties from a ring … … 30 31 if (rField_is_Q_a(r)) return FieldQ_a; 31 32 #endif 32 #ifdef HAVE_RINGS33 33 if (rField_is_Ring(r)) return RingGeneral; 34 #endif35 34 return FieldGeneral; 36 35 } … … 129 128 WarnS("If you chose a coef ring, it may not work at all");\ 130 129 p_Procs->which = (which##_Proc_Ptr)( \ 131 which##__FieldGeneral_LengthGeneral_OrdGeneral); 130 which##__FieldGeneral_LengthGeneral_OrdGeneral); \ 132 131 } \ 133 132 } \ … … 146 145 memset(p_Procs, 0, sizeof(p_Procs_s)); 147 146 _p_procs = p_Procs; 148 assume(IsValidSpec(field, length, ord));149 147 150 148 SetProcs(field, length, ord); … … 157 155 // set all non-mult/div. routines to FieldZp-variants 158 156 SetProcs_nv(FieldZp, length,ord); // p_Delete, p_ShallowCopyDelete... 157 } 158 if (field==RingGeneral) 159 { 160 if (nCoeff_is_Domain(r->cf)) 161 SetProcs_ring(FieldGeneral,length,ord); 162 // FieldGeneral vs. RingGeneral: HAVE_ZERODIVISORS 163 else 164 SetProcs_ring(RingGeneral,length,ord); 159 165 } 160 166 #endif -
omalloc/omallocClass.cc
r5656667 r7d27c2 6 6 */ 7 7 8 #include <omalloc/omalloc.h>9 10 8 #ifdef __cplusplus 11 9 … … 13 11 #include <stdlib.h> 14 12 #include <omalloc/omallocClass.h> 15 16 void* omallocClass::operator new[] ( size_t size )17 #ifndef __GNUC__18 throw (std::bad_alloc)19 #endif20 {21 void* addr;22 if (size==(size_t)0) size = (size_t)1;23 omTypeAlloc(void*, addr, size);24 return addr;25 }26 27 void omallocClass::operator delete[] ( void* block )28 #ifndef __GNUC__29 throw ()30 #endif31 {32 omfree( block );33 }34 13 35 14 // The C++ standard has ratified a change to the new operator. -
omalloc/omallocClass.h
r5656667 r7d27c2 43 43 throw (std::bad_alloc) 44 44 #endif 45 ; 45 { 46 void* addr; 47 if (size==(size_t)0) size = (size_t)1; 48 omTypeAlloc(void*, addr, size); 49 return addr; 50 } 46 51 47 52 void operator delete[] ( void* block ) … … 49 54 throw () 50 55 #endif 51 ; 56 { 57 omfree( block ); 58 } 59 52 60 53 61 // The C++ standard has ratified a change to the new operator. -
resources/feResource.cc
r5656667 r7d27c2 91 91 {"Path", 'p', feResPath, NULL, "%b;%P;$PATH", (char *)""}, 92 92 93 #ifdef __CYGWIN__ 94 {"emacs", 'E', feResBinary,"ESINGULAR_EMACS", "%b/emacs.exe", (char *)""}, 95 {"xemacs", 'A', feResBinary,"ESINGULAR_EMACS", "%b/xemacs.exe", (char *)""}, 96 {"SingularEmacs",'M', feResBinary,"ESINGULAR_SINGULAR", "%b/Singular.exe", (char *)""}, 97 #else 93 98 {"emacs", 'E', feResBinary,"ESINGULAR_EMACS", "%b/emacs", (char *)""}, 94 99 {"xemacs", 'A', feResBinary,"ESINGULAR_EMACS", "%b/xemacs", (char *)""}, 95 100 {"SingularEmacs",'M', feResBinary,"ESINGULAR_SINGULAR", "%b/Singular", (char *)""}, 101 #endif 96 102 {"EmacsLoad", 'l', feResFile, "ESINGULAR_EMACS_LOAD", "%e/.emacs-singular", (char *)""}, 97 103 {"EmacsDir", 'e', feResDir, "ESINGULAR_EMACS_DIR", "%D/singular/emacs", (char *)""}, -
resources/omFindExec.c
r5656667 r7d27c2 39 39 char *search; 40 40 char *p; 41 #ifdef WINNT42 char *extra = NULL;43 #endif44 41 char tbuf[MAXPATHLEN]; 45 42 … … 50 47 { 51 48 strcpy(executable, name); 52 #ifdef __CYGWIN__53 strcat(executable, ".exe");54 #endif55 49 return executable; 56 50 } … … 75 69 { 76 70 strcpy(executable, tbuf); 77 #ifdef __CYGWIN__78 strcat(executable, ".exe");79 #endif80 71 return executable; 81 72 } … … 85 76 search = getenv("PATH"); 86 77 /* for winnt under msdos, cwd is implictly in the path */ 87 #ifdef WINNT88 p = getenv("SHELL");89 if (p == NULL || strlen(p) < 2)90 {91 char *extra = NULL;92 /* we are under msdos display */93 extra = (char*) malloc((search != NULL ? strlen(search) : 0) + 3);94 strcpy(extra, ".:");95 if (search != NULL) strcat(extra, search);96 search = extra;97 }98 #endif99 78 p = search; 100 79 … … 129 108 if (! access (tbuf, F_OK)) 130 109 { 131 #ifdef WINNT132 if (extra != NULL)133 free(extra);134 #endif135 110 strcpy(executable, tbuf); 136 #ifdef __CYGWIN__137 strcat(executable, ".exe");138 #endif139 111 return executable; 140 112 } … … 219 191 } 220 192 221 #ifdef WINNT 193 #ifdef __CYGWIN__ 194 /* for windows, serch first for .exe */ 222 195 char * _omFindExec (const char *name, char* exec); 223 /* for windows, serch first for .exe */224 196 char* omFindExec(const char *name, char* exec) 225 197 { -
xalloc/Makefile.am
r5656667 r7d27c2 1 1 ACLOCAL_AMFLAGS = -I ../m4 2 2 3 noinst_LTLIBRARIES=libomalloc.la3 lib_LTLIBRARIES=libomalloc.la 4 4 5 # lib_LTLIBRARIES=libomalloc.la 6 # lib_LIBRARIES=libomalloc.a 5 libomalloc_includedir=$(includedir)/omalloc 7 6 8 # libomallocdir = $(libdir)/ 7 libomalloc_include_HEADERS = omalloc.h omallocClass.h 9 8 10 # libomalloc_includedir=$(includedir)/omalloc 11 # libomalloc_include_HEADERS = omalloc.h 9 SOURCES=dummy.c omallocClass.cc 12 10 13 SOURCES = dummy.c omalloc.h 11 AM_CPPFLAGS =-I${top_srcdir}/.. -I${top_builddir}/.. 14 12 15 libomalloc_la_SOURCES =$(SOURCES)13 libomalloc_la_SOURCES=$(SOURCES) $(noinst_HEADERS) 16 14 17 libomalloc_la_LDFLAGS = -release ${PACKAGE_VERSION}15 libomalloc_la_LDFLAGS = -release ${PACKAGE_VERSION} 18 16 17 libomalloc_la_CPPFLAGS = ${AM_CPPFLAGS} 19 18 19 omTables_CPPFLAGS = ${AM_CPPFLAGS} 20 21 CLEANFILES = $(BUILT_SOURCES) 22 DISTCLEANFILES = omConfig.h 23 -
xalloc/README
r5656667 r7d27c2 1 README for xalloc: a debug helper and alternative to omalloc 2 3 - substitute in <topdir>/configure.ac and <topdir>/Makefile.am 4 omalloc by xalloc 5 - in <topdir> run ./autogen.sh 6 - run <topdir>/configure ..... in <builddir> 7 - in <builddir> and <topdir>: save omalloc to omalloc.org, ln -s xalloc omalloc 8 - run make in <builddir> -
xalloc/configure.ac
r5656667 r7d27c2 1 AC_INIT([xalloc], [3.1.2.sw]) 2 AC_CONFIG_SRCDIR(dummy.c) 1 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 2 dnl File: configure.ac 3 dnl Purpose: Process this file with autoconf to produce configure 4 dnl Author: obachman@mathematik.uni-kl.de (Olaf Bachmann) 5 dnl Created: 11/99 6 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 7 8 AC_INIT([xmalloc],[4.0]) 9 3 10 AC_CONFIG_MACRO_DIR([../m4]) 4 11 AC_CONFIG_AUX_DIR([../build-aux]) 12 AC_CONFIG_SRCDIR(dummy.c) 13 AC_CONFIG_HEADER([_config.h]) 14 15 AC_PROG_CC 16 AC_PROG_CXX 17 18 SING_RESET_FLAGS() 5 19 6 20 AM_MAINTAINER_MODE([enable]) … … 9 23 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 10 24 25 AM_SANITY_CHECK 11 26 27 # Add pre'prefixed config 28 AX_PREFIX_CONFIG_H([omConfig.h],[],[_config.h]) 29 30 # SING_CHECK_SET_ARGS() 31 32 AC_SUBST(VERSION) 33 34 CPPFLAGS="-I.. -I. $CPPFLAGS" 12 35 AC_PROG_MAKE_SET 13 #AC_PROG_CC14 #AC_PROG_CPP36 AC_PROG_CC 37 AC_PROG_CPP 15 38 16 39 AC_PROG_LN_S 17 40 AC_PROG_INSTALL 18 41 AM_PROG_CC_C_O 19 42 # AM_PROG_AR 20 43 AC_C_CONST 21 44 AC_C_INLINE … … 23 46 LT_INIT 24 47 25 SING_RESET_FLAGS()26 SING_CHECK_SET_ARGS()27 48 49 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 50 dnl check for programs 51 dnl 52 AC_CHECK_PROG(AR, ar, ar, :) 53 if test "$ac_cv_prog_AR" = no; then 54 AC_MSG_ERROR(*** ar program not found) 55 fi 28 56 57 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 58 dnl header file checks 59 dnl 60 AC_HEADER_STDC 61 AC_CHECK_HEADERS(limits.h,, 62 AC_MSG_ERROR(Can not compile without limits.h)) 63 64 AC_CHECK_HEADERS(unistd.h sys/mman.h fcntl.h /usr/include/malloc.h) 65 66 AC_CHECK_FUNCS(popen mmap sbrk random) 67 68 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 69 dnl Find out more about particularity of the system 70 dnl 71 72 # sizes 73 AC_CHECK_SIZEOF(long,4) 74 AC_CHECK_SIZEOF(void*,4) 75 AC_CHECK_SIZEOF(double, 8) 76 AC_CHECK_SIZEOF(size_t, 4) 77 78 if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then 79 AC_MSG_ERROR(need equal sizes for long and void*) 80 fi 81 if test "$ac_cv_sizeof_voidp" != 4 && test "$ac_cv_sizeof_voidp" != 8; then 82 AC_MSG_ERROR(need void* to be 4 or 8 bytes long) 83 fi 84 if test "$ac_cv_sizeof_double" != 4 && test "$ac_cv_sizeof_double" != 8; then 85 AC_MSG_ERROR(need double to be 4 or 8 bytes long) 86 fi 87 88 dnl Set compiler, linker flags so that we can work with omalloc 89 BACKUP_CFLAGS=$CFLAGS 90 BACKUP_CXXFLAGS=$CXXFLAGS 91 BACKUP_LDFLAGS=$LDFLAGS 92 93 CFLAGS="$CFLAGS -I$srcdir" 94 CXXFLAGS="$CXXFLAGS -I$srcdir" 95 96 AC_SUBST(OM_MALLOC_HEADER) 97 AC_SUBST(OM_MALLOC_SOURCE) 98 99 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 100 dnl wrap it up 101 dnl 29 102 AC_CONFIG_FILES([Makefile]) 30 103 AC_OUTPUT -
xalloc/omalloc.h
r5656667 r7d27c2 9 9 #include <stdlib.h> 10 10 #include <string.h> 11 #include <omalloc/omConfig.h> 11 12 12 13 #ifdef __cplusplus … … 82 83 } 83 84 } 85 #define omReallocAligned(A,B) omRealloc(A,B) 84 86 static inline void *omReallocSize(void *d, size_t os, size_t ns) 85 87 { if (d==NULL) return omAlloc(ns);
Note: See TracChangeset
for help on using the changeset viewer.