Changeset 7d27c2 in git


Ignore:
Timestamp:
Mar 15, 2016, 11:44:33 AM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7eb464ef99fa9bcf027942ff701df2156a895acf
Parents:
23812d3dd3a69ed0874b01c271d1908acd7f0f055656667e687146a40c18764c718fd74005adf0be
Message:
Merge pull request #752 from adipopescu/Dimension_Integers

fix: dim int crash
Files:
7 added
48 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r5656667 r7d27c2  
    55endif
    66
    7 SUBDIRS = resources omalloc xalloc $(USE_FACTORY) \
     7SUBDIRS = resources omalloc $(USE_FACTORY) \
    88libpolys gfanlib IntegerProgramming \
    99kernel Singular \
  • Singular/LIB/help.cnf

    r5656667 r7d27c2  
    3333galeon!xDhE:galeon:!galeon -n %h &
    3434netscape!xDhE:netscape:!(netscape -remote "openURL(%h)")||(netscape %h) &
    35 cygwin!xhE:cygstart:!cygstart "%h" &
     35cygwin!xhE:cygstart:!cygstart "%f" &
    3636cygwin-www!E:cygstart:!cygstart "%H" &
    3737safari!xhE:/Applications/Safari.app:!open -a /Applications/Safari.app %h
  • Singular/emacs.cc

    r5656667 r7d27c2  
    202202  if (emacs == NULL)
    203203  {
    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
    205209           feResourceDefault('X'));
    206210    mainUsage();
  • Singular/extra.cc

    r5656667 r7d27c2  
    976976  /* =================== LLL via Flint ==============================*/
    977977  #ifdef HAVE_FLINT
    978   #ifdef FLINT_VER_2_4_5
     978  #if __FLINT_RELEASE >= 20500
    979979    if (strcmp(sys_cmd, "LLL_Flint") == 0)
    980980    {
  • Singular/iparith.cc

    r23812d3 r7d27c2  
    40574057    }
    40584058    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    }
    40614075    //Anne's Idea for std(4,2x) = 0 bug
    40624076    long dcurr = d;
    40634077    for(i=0;i<idSize(vv);i++)
    40644078    {
    4065       if(!n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf))
     4079      if(vv->m[i] != NULL && !n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf))
    40664080      {
    40674081        ideal vc = idCopy(vv);
     
    40864100          dcurr++;
    40874101        }
    4088         if(dcurr > d)
     4102        idDelete(&vc);
     4103      }
     4104      if(dcurr > d)
    40894105          d = dcurr;
    4090         idDelete(&vc);
    4091       }
    4092       else
    4093       {
    4094         if(idPosConstant(vv)!= -1)
    4095         {
    4096           dcurr = -1;
    4097         }
    4098       }
    40994106    }
    41004107    res->data = (char *)d;
  • Singular/maps_ip.cc

    r5656667 r7d27c2  
    2525// #include <kernel/longalg.h>
    2626
     27#include <misc/options.h>
    2728#include <kernel/GBEngine/kstd1.h>
    2829#include <kernel/maps/gen_maps.h>
     
    4950                     int *perm, int *par_perm, int P, nMapFunc nMap)
    5051{
     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
    5182  int i;
    5283  int N = preimage_r->N;
     
    103134      else
    104135        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);
    106137      else /*if (what==MAP_CMD)*/
    107138      {
     
    144175        {
    145176          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);
    147178          pTest(m->m[i]);
    148179        }
  • Singular/misc_ip.cc

    r5656667 r7d27c2  
    2828#include <coeffs/OPAEp.h>
    2929#include <coeffs/flintcf_Q.h>
     30#include <coeffs/flintcf_Zn.h>
    3031
    3132#include <polys/ext_fields/algext.h>
     
    11921193  }
    11931194}
     1195#ifdef HAVE_FLINT
     1196static n_coeffType n_FlintZn=n_unknown;
     1197static 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
    11941217#endif
    11951218/*2
     
    13161339      IDDATA(h)=(char*)nInitChar(t,NULL);
    13171340    }
     1341    n_FlintZn=nRegister(n_unknown,flintZn_InitChar);
     1342    if (n_FlintZn!=n_unknown)
     1343    {
     1344      iiAddCproc("kernel","flintZ",FALSE,ii_FlintZn_init);
     1345    }
    13181346    #endif
    13191347  }
  • Singular/subexpr.cc

    r5656667 r7d27c2  
    787787        case CNUMBER_CMD:
    788788          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          }
    789796        #endif
    790797
  • Tst/New/dim_integers.res.gz.uu

    r23812d3 r7d27c2  
    11begin 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``
     2M'XL("(S<YU8``V1I;5]I;G1E9V5R<RYR97,`G9;/3]LP%(#O_!5O:(>61B7^
     3MF5@5/4S;`0WM`MIA%Q2HZ2Q*@N*T:_K7S^E([&"7-CO5<OS\OO?\)>[MW=?K
     4M'P"`YG!S_07.*UU-5^KA?`9F=*]R58W&L[/F%^9S6*@7,U?)I2SU-)=_IKK*
     5MJK/;MSWP'+HQF<+E)=S]EEI"5DK0Q8N$2NI*PU-1PF/Q\KJN5+Z$[^5ZM6HV
     6MEKE61:ZA>`*UD-G*C#:RA#9=MS-M=X8G5>H*BER"TE"9B:)42Y5G*WA8+TV:
     7M=;Z`AQI^JN?*I+R1FRQ?%!O]7-=@1O!MD\$O6>ZZG=G4\O,IE`U>"5<M0K2-
     8M%J^S;D4R_\<)RBRA$=[:1^E\/ZFKQ4B-[;38-W`_A=I)%,^;<@SPIT^F*V4I
     9M'RLHI5ZO*K.#78:F\*Q,H\IN.^2T&Y$`[F@;U6,7&5$7F6\C6MMG+,B,N&7&
     10MW:0I_3U,ZL"(4V!PW(=!\61;&R(\P98*HR`5QH%.8N)186JI,#M`%>WZ7-SE
     11M2K<1PG6$TIU=D(294LM$NDGA,9'8,A%T&A/!?28\J1LL,D%X%YG>[^A$;+%=
     12M3H*$A`;.DC"?D#N$B4,X:A$Q'?=?!I(>?!F(",+0.'"$%'DPU+&<DD,PGEWT
     13M`]5I6'4:4IWZJE-'=2I.)F*G^,["OK.0[\SWG3F^,_81VCO!V#'I65AZ%I*>
     14M^=)S1WJ.!H#Q8>;SL/D\9#[WS>>.^3QD?L/8YVL;T#":9R:!^9I?7,!]<R?E
     15MA2$Q5TU6FHLHTTK;T^/"#<0#(I.X'QG%`V*1&QM'@_)B-Y8/B23]K$-"J7=(
     16M";.'E'37])4U*0J]?DGRGP>5I#Z!L`1I?("@]WU,W_J^][(E,`AQMP![65+B
     17M9*%^%A0'RDQ9.%%73LK]1(F3*/VH'+M,'*E'Q%X:@6P:@4^L1Y`C]0A?$.$(
     18M(@X)TCL>T9?C!$%MH0,_`#;P2`M1[+40Q;:%*#8M;/ZB-__`UWJ$QK//9W\!
     19(B3=:A,T+````
    1520`
    1621end
  • Tst/New/dim_integers.stat

    r23812d3 r7d27c2  
    1 1 >> tst_memory_0 :: 1457529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:122040
    2 1 >> tst_memory_1 :: 1457529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:2228224
    3 1 >> tst_memory_2 :: 1457529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:2228224
    4 1 >> tst_timer_1 :: 1457529955:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:4
     11 >> tst_memory_0 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:122432
     21 >> tst_memory_1 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:2228224
     31 >> tst_memory_2 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:2228224
     41 >> tst_timer_1 :: 1458035852:4030, 64 bit:4.0.3:x86_64-Linux:maunzerle:4
  • Tst/New/dim_integers.tst

    r23812d3 r7d27c2  
    6565kill r;
    6666
     67ring r = (integer),(x),dp;
     68dim(ideal(x));
     69dim(ideal(2x));
     70dim(ideal(2x,0));
     71dim(ideal(0,2x));
     72dim(ideal(6x));
     73dim(ideal(0,x));
     74kill r;
     75
     76ring r=(integer,2,4),(x,y),dp;
     77dim(ideal(x));
     78kill r;
     79
     80ring r=(integer,2,4),x,dp;
     81dim(std(ideal(x)));
     82kill r;
     83
     84ring r=(integer,10),(x,y),dp;
     85dim(std(ideal(x)));
     86kill r;
     87
     88ring r=(integer,2,4),x,dp;
     89dim(std(ideal(x)));
     90kill r;
     91
     92ring r=(integer,10),(x,y),dp;
     93dim(std(ideal(x)));
     94kill r;
     95
     96ring r=(integer,2,4),x,dp;
     97dim(ideal(x,x));
     98dim(ideal(x));
     99dim(std(ideal(x)));
     100kill r;
     101
    67102tst_status(1);$
  • Tst/Short/ok_s.lst

    r5656667 r7d27c2  
    5757bug_tr739
    5858bug_tr745
     59bug_tr753
    5960bug_genus_etc
    6061conv_bi
  • configure.ac

    r5656667 r7d27c2  
    227227
    228228AC_CONFIG_FILES([Makefile])
    229 AC_CONFIG_FILES([xalloc/Makefile])
    230229AC_CONFIG_FILES([kernel/Makefile])
    231230AC_CONFIG_FILES([kernel/numeric/Makefile])
  • factory/cf_inline.cc

    r5656667 r7d27c2  
    125125CF_INLINE
    126126CanonicalForm::CanonicalForm ()
    127     : value( CFFactory::basic( (long)0 ) )
     127    : value( CFFactory::basic( 0L ) )
    128128{
    129129}
  • kernel/GBEngine/kstd1.cc

    r5656667 r7d27c2  
    33703370  else
    33713371  {
     3372    #ifdef HAVE_RINGS
    33723373    assume(strat->red == redEcart || strat->red == redRiloc);
     3374    #else
     3375    assume(strat->red == redEcart);
     3376    #endif
    33733377    if (strat->honey && (strat->syzComp==0))
    33743378      return TRUE;
  • kernel/GBEngine/syz.h

    r5656667 r7d27c2  
    1616// Logarithm of "distance" between a new component and prev component
    1717#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)
    1919struct sSObject{
    2020                 poly  p;
  • kernel/GBEngine/tgb_internal.h

    r5656667 r7d27c2  
    11021102         if (row->idx_array)
    11031103         {
    1104            if (!((coef==(number)(long) 1)||(coef==minus_one)))
     1104           if (!((coef==(number)1L)||(coef==minus_one)))
    11051105           {
    11061106             add_coef_times_sparse(temp_array,temp_size,row,coef);
     
    11081108           else
    11091109           {
    1110              if (coef==(number)(long) 1)
     1110             if (coef==(number)1L)
    11111111             {
    11121112               add_sparse(temp_array,temp_size,row);
     
    11201120         else
    11211121         //TODO: treat, 1,-1
    1122          if (!((coef==(number)(long) 1)||(coef==minus_one)))
     1122         if (!((coef==(number)1L)||(coef==minus_one)))
    11231123         {
    11241124          add_coef_times_dense(temp_array,temp_size,row->coef_array,row->len,coef);
     
    11261126         else
    11271127         {
    1128            if (coef==(number)(long)1)
     1128           if (coef==(number)1L)
    11291129             add_dense(temp_array,temp_size,row->coef_array,row->len);
    11301130           else
  • kernel/combinatorics/hutil.h

    r5656667 r7d27c2  
    99
    1010class intvec;
    11 
    12 struct omBin_s   ; typedef struct omBin_s omBin_t ; typedef omBin_t * omBin;
    1311
    1412struct ip_sring  ; typedef struct ip_sring                          * ring;
  • kernel/ideals.cc

    r5656667 r7d27c2  
    769769  SI_SAVE_OPT2(save2);
    770770
    771   k=si_max((long)1,id_RankFreeModule(h1,currRing));
     771  k=si_max(1L,id_RankFreeModule(h1,currRing));
    772772
    773773  if ((k==1) && (!lift3)) si_opt_2 |=Sy_bit(V_IDLIFT);
  • libpolys/coeffs/Makefile.am

    r5656667 r7d27c2  
    1818  modulop.cc mpr_complex.cc \
    1919  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
    2121
    2222libcoeffs_la_SOURCES   = $(SOURCES)
     
    2727  shortfl.h mpr_complex.h mpr_global.h numstats.h \
    2828  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
    3030
    3131libcoeffs_la_LIBADD = ${top_builddir}/reporter/libreporter.la ${top_builddir}/misc/libmisc.la \
  • libpolys/coeffs/flintcf_Q.cc

    r5656667 r7d27c2  
    7171static void CoeffWrite(const coeffs r, BOOLEAN details)
    7272{
    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}
     75static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void * parameter)
    7676{
    7777  return (r->type==n);
  • libpolys/coeffs/gnumpc.cc

    r5656667 r7d27c2  
    8888
    8989  if( i == 1 )
    90     return (number)(new gmp_complex( (long)0, (long)1 ));
     90    return (number)(new gmp_complex( 0L, 1L ));
    9191
    9292  return NULL; // new gmp_complex( )  // 0?
     
    100100  assume( getCoeffType(r) == ID );
    101101
    102   gmp_complex* n= new gmp_complex( (long)i, (long)0 );
     102  gmp_complex* n= new gmp_complex( (long)i, 0L );
    103103
    104104  return (number)n;
     
    388388  {
    389389    s += N;
    390     gmp_complex *aa=new gmp_complex((long)0,(long)1);
     390    gmp_complex *aa=new gmp_complex(0L,1L);
    391391    *a=(number)aa;
    392392  }
    393393  else
    394394  {
    395     *a=(number) new gmp_complex((long)1);
     395    *a=(number) new gmp_complex(1L);
    396396  }
    397397  return s;
  • libpolys/coeffs/longrat.cc

    r5656667 r7d27c2  
    113113{
    114114  assume(x->s==3);
    115   if (mpz_cmp_si(x->z,(long)0)==0)
     115  if (mpz_cmp_ui(x->z,0L)==0)
    116116  {
    117117    mpz_clear(x->z);
     
    156156
    157157#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)
    159159#define mpz_isNeg(A) ((A)->_mp_size<0)
    160160#define mpz_limb_size(A) ((A)->_mp_size)
     
    306306    if (a->z[0]._mp_alloc==0)
    307307      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))
    309309    {
    310310      Print("!!longrat:integer as rational in %s:%d\n",f,l);
     
    477477    for (i=0;i<size;i++) dd[i] = qp[i];
    478478    bl = 1-e;
    479     nn = (mp_ptr)omAlloc(sizeof(mp_limb_t)*bl);
     479    nn = (mp_ptr)omAlloc0(sizeof(mp_limb_t)*bl);
    480480    nn[bl-1] = 1;
    481     for (i=bl-2;i>=0;i--) nn[i] = 0;
    482481    ndest = res->n;
    483482    ndest->_mp_d = nn;
     
    497496  dest->_mp_d = dd;
    498497  dest->_mp_alloc = al;
    499   if (negative) dest->_mp_size = -dest->_mp_size;
     498  if (negative) mpz_neg(dest,dest);
    500499
    501500  if (res->s==0)
     
    674673#endif
    675674    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);
    679678      mpz_init_set_si(n->n,(long)SR_TO_INT(a));
    680679    }
    681680    else
    682681    {
    683       mpz_init_set_si(n->z,(long)-1);
     682      mpz_init_set_si(n->z,-1L);
    684683      mpz_init_set_si(n->n,(long)-SR_TO_INT(a));
    685684    }
     
    692691#endif
    693692  {
    694     n->s=a->s;
    695693    mpz_init_set(n->n,a->z);
    696694    switch (a->s)
     
    698696      case 0:
    699697      case 1:
     698              n->s=a->s;
    700699              mpz_init_set(n->z,a->n);
    701700              if (mpz_isNeg(n->n)) /* && n->s<2*/
     
    704703                mpz_neg(n->n,n->n);
    705704              }
    706               if (mpz_cmp_si(n->n,(long)1)==0)
     705              if (mpz_cmp_ui(n->n,1L)==0)
    707706              {
    708707                mpz_clear(n->n);
     
    712711              break;
    713712      case 3:
     713              // i.e. |a| > 2^...
    714714              n->s=1;
    715715              if (mpz_isNeg(n->n)) /* && n->s<2*/
    716716              {
    717717                mpz_neg(n->n,n->n);
    718                 mpz_init_set_si(n->z,(long)-1);
     718                mpz_init_set_si(n->z,-1L);
    719719              }
    720720              else
    721721              {
    722                 mpz_init_set_si(n->z,(long)1);
     722                mpz_init_set_si(n->z,1L);
    723723              }
    724724              break;
     
    961961  int p=IsPrime(ch);
    962962  coeffs rr=NULL;
    963   if ((long)p==ch)
     963  if (((long)p)==ch)
    964964  {
    965965    rr = nInitChar(n_Zp,(void*)ch);
     
    10581058      {
    10591059        mpz_init_set(u->n,a->n);
    1060         if ((long)b>0L)
     1060        if (((long)b)>0L)
    10611061          mpz_mul_ui(u->n,u->n,SR_TO_INT(b));
    10621062        else
     
    10871087    mpz_neg(u->n,u->n);
    10881088  }
    1089   if (mpz_cmp_si(u->n,(long)1)==0)
     1089  if (mpz_cmp_si(u->n,1L)==0)
    10901090  {
    10911091    mpz_clear(u->n);
     
    11241124    if (x->s<2)
    11251125    {
    1126       if (mpz_cmp_si(x->n,(long)1)==0)
     1126      if (mpz_cmp_si(x->n,1L)==0)
    11271127      {
    11281128        x->s=3;
     
    13141314{
    13151315  assume(x->s<2);
    1316   if (mpz_cmp_ui(x->z,(long)0)==0)
     1316  if (mpz_cmp_ui(x->z,0L)==0)
    13171317  {
    13181318    _nlDelete_NoImm(&x);
     
    13441344  else if (x->s==0)
    13451345  {
    1346     if (mpz_cmp_si(x->n,(long)1)==0)
     1346    if (mpz_cmp_si(x->n,1L)==0)
    13471347    {
    13481348      mpz_clear(x->n);
     
    13561356      mpz_gcd(gcd,x->z,x->n);
    13571357      x->s=1;
    1358       if (mpz_cmp_si(gcd,(long)1)!=0)
     1358      if (mpz_cmp_si(gcd,1L)!=0)
    13591359      {
    13601360        mpz_divexact(x->z,x->z,gcd);
    13611361        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)
    13631363        {
    13641364          mpz_clear(x->n);
     
    13991399  else
    14001400    mpz_gcd(gcd,a->z,b->n);
    1401   if (mpz_cmp_si(gcd,(long)1)!=0)
     1401  if (mpz_cmp_si(gcd,1L)!=0)
    14021402  {
    14031403    mpz_t bt;
     
    15611561    if (b->s!=0)
    15621562      return FALSE;
    1563     if (((long)a > 0L) && (mpz_isNeg(b->z)))
     1563    if ((((long)a) > 0L) && (mpz_isNeg(b->z)))
    15641564      return FALSE;
    1565     if (((long)a < 0L) && (!mpz_isNeg(b->z)))
     1565    if ((((long)a) < 0L) && (!mpz_isNeg(b->z)))
    15661566      return FALSE;
    15671567    mpz_t  bb;
     
    16531653  mpz_gcd(gcd,x->z,x->n);
    16541654  x->s=1;
    1655   if (mpz_cmp_si(gcd,(long)1)!=0)
     1655  if (mpz_cmp_si(gcd,1L)!=0)
    16561656  {
    16571657    mpz_divexact(x->z,x->z,gcd);
    16581658    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)
    16601660    {
    16611661      mpz_clear(x->n);
     
    16921692        mpz_add(u->z,b->z,x);
    16931693        mpz_clear(x);
    1694         if (mpz_cmp_ui(u->z,(long)0)==0)
     1694        if (mpz_cmp_ui(u->z,0L)==0)
    16951695        {
    16961696          mpz_clear(u->z);
     
    17111711      case 3:
    17121712      {
    1713         if ((long)a>0L)
     1713        if (((long)a)>0L)
    17141714          mpz_add_ui(u->z,b->z,SR_TO_INT(a));
    17151715        else
    17161716          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         }
    17231717        u->s = 3;
    17241718        u=nlShort3(u);
     
    17471741            mpz_clear(x);
    17481742
    1749             if (mpz_cmp_ui(u->z,(long)0)==0)
     1743            if (mpz_cmp_ui(u->z,0L)==0)
    17501744            {
    17511745              mpz_clear(u->z);
     
    17701764            mpz_mul(u->z,b->z,a->n);
    17711765            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)
    17731767            {
    17741768              mpz_clear(u->z);
     
    17991793            mpz_mul(u->z,a->z,b->n);
    18001794            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)
    18021796            {
    18031797              mpz_clear(u->z);
     
    18191813          {
    18201814            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             }
    18271815            u->s = 3;
    18281816            u=nlShort3(u);
     
    18561844      case 3:
    18571845      {
    1858         if ((long)b>0L)
     1846        if (((long)b)>0L)
    18591847          mpz_add_ui(a->z,a->z,SR_TO_INT(b));
    18601848        else
     
    18931881      case 3:
    18941882      {
    1895         if ((long)a>0L)
     1883        if (((long)a)>0L)
    18961884          mpz_add_ui(u->z,b->z,SR_TO_INT(a));
    18971885        else
     
    19951983        mpz_sub(u->z,x,b->z);
    19961984        mpz_clear(x);
    1997         if (mpz_cmp_ui(u->z,(long)0)==0)
     1985        if (mpz_cmp_ui(u->z,0L)==0)
    19981986        {
    19991987          mpz_clear(u->z);
     
    20142002      case 3:
    20152003      {
    2016         if ((long)a>0L)
     2004        if (((long)a)>0L)
    20172005        {
    20182006          mpz_sub_ui(u->z,b->z,SR_TO_INT(a));
     
    20242012          mpz_neg(u->z,u->z);
    20252013        }
    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         }
    20322014        u->s = 3;
    20332015        u=nlShort3(u);
     
    20482030        mpz_sub(u->z,a->z,x);
    20492031        mpz_clear(x);
    2050         if (mpz_cmp_ui(u->z,(long)0)==0)
     2032        if (mpz_cmp_ui(u->z,0L)==0)
    20512033        {
    20522034          mpz_clear(u->z);
     
    20672049      case 3:
    20682050      {
    2069         if ((long)b>0L)
     2051        if (((long)b)>0L)
    20702052        {
    20712053          mpz_sub_ui(u->z,a->z,SR_TO_INT(b));
     
    20742056        {
    20752057          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);
    20822058        }
    20832059        u->s = 3;
     
    21082084            mpz_clear(x);
    21092085            mpz_clear(y);
    2110             if (mpz_cmp_ui(u->z,(long)0)==0)
     2086            if (mpz_cmp_ui(u->z,0L)==0)
    21112087            {
    21122088              mpz_clear(u->z);
     
    21342110            mpz_sub(u->z,a->z,x);
    21352111            mpz_clear(x);
    2136             if (mpz_cmp_ui(u->z,(long)0)==0)
     2112            if (mpz_cmp_ui(u->z,0L)==0)
    21372113            {
    21382114              mpz_clear(u->z);
     
    21662142            mpz_sub(u->z,x,b->z);
    21672143            mpz_clear(x);
    2168             if (mpz_cmp_ui(u->z,(long)0)==0)
     2144            if (mpz_cmp_ui(u->z,0L)==0)
    21692145            {
    21702146              mpz_clear(u->z);
     
    21862162          {
    21872163            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             }
    21942164            u->s = 3;
    21952165            u=nlShort3(u);
     
    22362206    u->s=b->s;
    22372207    if (u->s==1) u->s=0;
    2238     if ((long)a>0L)
     2208    if (((long)a)>0L)
    22392209    {
    22402210      mpz_mul_ui(u->z,b->z,(unsigned long)SR_TO_INT(a));
     
    24562426  #else
    24572427  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);
    24592429  else                                             n=nlRInit(i);
    24602430  #endif
     
    24802450  if (a==INT_TO_SR(0)) return TRUE;
    24812451  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)
    24832453  {
    24842454    printf("gmp-0 in nlIsZero\n");
     
    28302800  assume(!mpz_isNeg(P));
    28312801  if (mpz_isNeg(N))  mpz_add(N,N,P);
    2832   mpz_init_set_si(A,(long)0);
     2802  mpz_init_set_si(A,0L);
    28332803  mpz_init_set_ui(B,(unsigned long)1);
    2834   mpz_init_set_si(C,(long)0);
     2804  mpz_init_set_si(C,0L);
    28352805  mpz_init(D);
    28362806  mpz_init_set(E,P);
    28372807  number z=INT_TO_SR(0);
    2838   while(mpz_cmp_si(N,(long)0)!=0)
     2808  while(mpz_cmp_si(N,0L)!=0)
    28392809  {
    28402810    mpz_mul(tmp,N,N);
  • libpolys/coeffs/longrat0.cc

    r5656667 r7d27c2  
    7878      s++;
    7979      s = nlEatLong((char *)s, n);
    80       if (mpz_cmp_si(n,(long)0)==0)
     80      if (mpz_cmp_si(n,0L)==0)
    8181      {
    8282        WerrorS(nDivBy0);
     
    8484        (*a)->s = 3;
    8585      }
    86       else if (mpz_cmp_si(n,(long)1)==0)
     86      else if (mpz_cmp_si(n,1L)==0)
    8787      {
    8888        mpz_clear(n);
     
    9090      }
    9191    }
    92     if (mpz_cmp_si(z,(long)0)==0)
     92    if (mpz_cmp_si(z,0L)==0)
    9393    {
    9494      mpz_clear(z);
     
    9696      *a=INT_TO_SR(0);
    9797    }
    98     else
    99     if ((*a)->s==3)
     98    else if ((*a)->s==3)
    10099    {
    101100      number nlShort3_noinline(number x);
  • libpolys/coeffs/modulop.cc

    r5656667 r7d27c2  
    191191  n_Test(a, r);
    192192
    193   return ((r->npPminus1M == (long)a)&&((long)1!=(long)a));
     193  return ((r->npPminus1M == (long)a)&&(1L!=(long)a));
    194194}
    195195
     
    270270//    return nvDiv(a,b);
    271271//#endif
    272   if ((long)a==0)
    273     return (number)0;
     272  if ((long)a==0L)
     273    return (number)0L;
    274274  number d;
    275275
    276276#ifndef HAVE_DIV_MOD
    277   if ((long)b==0)
     277  if ((long)b==0L)
    278278  {
    279279    WerrorS(nDivBy0);
    280     return (number)0;
     280    return (number)0L;
    281281  }
    282282
     
    298298  n_Test(c, r);
    299299
    300   if ((long)c==0)
     300  if ((long)c==0L)
    301301  {
    302302    WerrorS("1/0");
    303     return (number)0;
     303    return (number)0L;
    304304  }
    305305  number d = npInversM(c,r);
     
    314314  n_Test(c, r);
    315315
    316   if ((long)c==0) return c;
     316  if ((long)c==0L) return c;
    317317
    318318#if 0
     
    333333
    334334  //return (long)a != (long)b;
    335   return (long)a > (long)b;
     335  return ((long)a) > ((long)b);
    336336}
    337337
     
    632632BOOLEAN npDBTest (number a, const char *f, const int l, const coeffs r)
    633633{
    634   if (((long)a<0) || ((long)a>r->ch))
     634  if (((long)a<0L) || ((long)a>(long)r->ch))
    635635  {
    636636    Print("wrong mod p number %ld at %s,%d\n",(long)a,f,l);
     
    879879number nvDiv (number a,number b, const coeffs r)
    880880{
    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)
    884884  {
    885885    WerrorS(nDivBy0);
    886     return (number)0;
     886    return (number)0L;
    887887  }
    888888  else
     
    894894number  nvInvers (number c, const coeffs r)
    895895{
    896   if ((long)c==0)
     896  if ((long)c==0L)
    897897  {
    898898    WerrorS(nDivBy0);
    899     return (number)0;
     899    return (number)0L;
    900900  }
    901901  return nvInversM(c,r);
  • libpolys/coeffs/rintegers.cc

    r5656667 r7d27c2  
    567567  nrzWrite(x, NULL);
    568568#endif
    569   if (mpz_cmp_ui((mpz_ptr) x,(long)0)==0)
     569  if (mpz_cmp_ui((mpz_ptr) x,0L)==0)
    570570  {
    571571    mpz_clear((mpz_ptr)x);
     
    15521552{
    15531553  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)
    15551555  {
    15561556    Print("gmp-0 %s:%d\n",f,l);
  • libpolys/coeffs/rmodulon.cc

    r5656667 r7d27c2  
    8181void    nrnCoeffWrite  (const coeffs r, BOOLEAN /*details*/)
    8282{
    83   long l = (long)mpz_sizeinbase(r->modBase, 10) + 2;
     83  size_t l = (size_t)mpz_sizeinbase(r->modBase, 10) + 2;
    8484  char* s = (char*) omAlloc(l);
    8585  s= mpz_get_str (s, 10, r->modBase);
     
    9797static char* nrnCoeffString(const coeffs r)
    9898{
    99   long l = (long)mpz_sizeinbase(r->modBase, 10) +2;
     99  size_t l = (size_t)mpz_sizeinbase(r->modBase, 10) +2;
    100100  char* b = (char*) omAlloc(l);
    101101  b= mpz_get_str (b, 10, r->modBase);
     
    668668  mpz_init_set_si(rr, 0);
    669669  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 <> 1
     670  if (mpz_cmp_si(g, 1L) != 0) mpz_mod(rr, (mpz_ptr)a, g); // the case g <> 1
    671671  mpz_clear(g);
    672672  omFreeBin(g, gmp_nrz_bin);
  • libpolys/polys/flintconv.cc

    r5656667 r7d27c2  
    1212#include "flintconv.h"
    1313
    14 #ifdef FLINT_VER_2_4_5
     14#ifdef HAVE_FLINT
     15#if __FLINT_RELEASE >= 20500
    1516#include <coeffs/coeffs.h>
    1617#include <polys/monomials/p_polys.h>
     
    2526
    2627
    27 #ifdef HAVE_FLINT
    2828int convFlintISingI (fmpz_t f)
    2929{
  • libpolys/polys/flintconv.h

    r5656667 r7d27c2  
    1212 * This file is work in progress and currently not part of the official Singular
    1313 *
    14  * @note the code is garded by the undefined macro FLINT_VER_2_4_5
     14 * @note the code is garded by the version test __FLINT_RELEASE >= 20500 (>=2.5)
    1515 * In its current form it will never become an official part.
    1616 * (conversion routines may be moved to other files/directories, etc.)
     
    2626 **/
    2727
    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
    3132#include <polys/matpol.h>
    3233#include <coeffs/bigintmat.h>
    33 // #include <polys/monomials/ring.h>
    34 
    35 
    36 #ifdef HAVE_FLINT
    37 #include <flint/flint.h>
    3834#include <flint/fmpz.h>
    3935#include <flint/fmpq.h>
     
    4945intvec* singflint_LLL(intvec* A, intvec* T);
    5046#endif
    51 
    5247#endif
    5348#endif
  • libpolys/polys/mod_raw.cc

    r5656667 r7d27c2  
    5050static BOOLEAN warn_proc = FALSE;
    5151#ifndef DL_TAIL
    52 #ifdef SING_NDEBUG
    53 #define DL_TAIL ".so"
    54 #else
    5552#define DL_TAIL ".so"
    5653//#define DL_TAIL "_g.so"
    57 #endif
    5854#endif
    5955
  • libpolys/polys/monomials/p_polys.cc

    r5656667 r7d27c2  
    39253925*/
    39263926poly 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)
    39283928{
    39293929#if 0
     
    39383938  assume(dst != NULL);
    39393939  assume(dst->cf != NULL);
     3940  #ifdef HAVE_PLURAL
     3941  poly tmp_mm=p_One(dst);
     3942  #endif
    39403943  while (p != NULL)
    39413944  {
     
    39833986            p_SetExp(qq, i, e, dst);
    39843987          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
    39854000            p_AddExp(qq,perm[i], e/*p_GetExp( p,i,oldRing)*/, dst);
     4001          }
    39864002          else if (perm[i]<0)
    39874003          {
     
    41244140  PrintS("result: "); p_Write(result,dst,dst);
    41254141#endif
     4142  #ifdef HAVE_PLURAL
     4143  p_LmDelete(&tmp_mm,dst);
     4144  #endif
    41264145  return result;
    41274146}
  • libpolys/polys/monomials/p_polys.h

    r5656667 r7d27c2  
    19151915
    19161916poly 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);
    19181919
    19191920/*----------------------------------------------------*/
  • libpolys/polys/monomials/ring.h

    r5656667 r7d27c2  
    359359
    360360/// we must always have this test!
    361 static inline bool rIsPluralRing(const ring r)
     361static inline BOOLEAN rIsPluralRing(const ring r)
    362362{
    363363  assume(r != NULL); assume(r->cf != NULL);
     
    366366  return (r != NULL) && ((n=r->GetNC()) != NULL) /*&& (n->type != nc_error)*/;
    367367#else
    368   return false;
    369 #endif
    370 }
    371 
    372 static inline bool rIsRatGRing(const ring r)
     368  return FALSE;
     369#endif
     370}
     371
     372static inline BOOLEAN rIsRatGRing(const ring r)
    373373{
    374374  assume(r != NULL);
     
    378378          && (r->real_var_start>1);
    379379#else
    380   return false;
    381 #endif
    382 }
    383 
    384 
    385 
     380  return FALSE;
     381#endif
     382}
    386383
    387384// The following are for LaScala3 only!
  • libpolys/polys/simpleideals.cc

    r5656667 r7d27c2  
    11741174      pIter(p);
    11751175      pNext(h)=NULL;
    1176       cp = si_max((long)1,p_GetComp(h, R));     // if used for ideals too
     1176      cp = si_max(1L,p_GetComp(h, R));     // if used for ideals too
    11771177      //cp = p_GetComp(h,R);
    11781178      p_SetComp(h,0,R);
     
    12811281  {
    12821282    p=F[i]=P[i];
    1283     cmax=si_max(cmax,(long)p_MaxComp(p,R));
     1283    cmax=si_max(cmax,p_MaxComp(p,R));
    12841284  }
    12851285  cmax++;
  • libpolys/polys/sparsmat.cc

    r5656667 r7d27c2  
    511511  {
    512512    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));
    514514  }
    515515  return res;
  • libpolys/polys/templates/p_Procs_Dynamic.cc

    r5656667 r7d27c2  
    9595      case p_ShallowCopyDelete_Proc:
    9696        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);
    10797      case p_Add_q_Proc:
    10898        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);
    11199      case p_Neg_Proc:
    112100        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);
    117101      case p_Merge_q_Proc:
    118102        return cast_A_to_vptr(p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral);
    119103      case p_kBucketSetLm_Proc:
    120104        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
    121140      case p_Unknown_Proc:
    122141        break;
     
    139158      case p_ShallowCopyDelete_Proc:
    140159        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";
    151160      case p_Add_q_Proc:
    152161        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";
    155162      case p_Neg_Proc:
    156163        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";
    161164      case p_Merge_q_Proc:
    162165        return "p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral";
     
    165168      case p_Unknown_Proc:
    166169        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
    167205  }
    168206  return "p_Unknown_Proc";
  • libpolys/polys/templates/p_Procs_Generate.cc

    r5656667 r7d27c2  
    3434  FieldZpProcs = 0,
    3535  FieldQProcs = 0,
    36 #ifdef HAVE_RINGS
    3736  RingGeneralProcs = 0,
    38 #endif
    3937  KernelProcs = 0,
    4038  UnknownProcs = 0;
     
    4543  // general procs go into kernel
    4644  if (field == FieldGeneral && length == LengthGeneral && ord == OrdGeneral)
     45    return 1;
     46
     47  if (field == RingGeneral && length == LengthGeneral && ord == OrdGeneral)
    4748    return 1;
    4849
     
    112113    else if (strcmp(module, "FieldQ") == 0)
    113114      FieldQProcs++;
    114 #ifdef HAVE_RINGS
    115     else if (strcmp(module, "RingGeneral") == 0)
    116       RingGeneralProcs++;
    117 #endif
    118115    else
    119116      UnknownProcs++;
     117    if (field==RingGeneral)
     118      RingGeneralProcs++;
    120119
    121120    printf("#ifdef p_Procs_%s\n", module);
    122121  }
    123122#endif
     123  if (strcmp(s_field, "RingGeneral") == 0)
     124  {
    124125#ifdef HAVE_RINGS
    125   if (strcmp(s_field, "RingGeneral") == 0)
     126    printf("#define HAVE_RINGS\n");
    126127    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  }
    128137  i = 0;
    129138  while (macros_field[i] != NULL)
     
    189198      printf("#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n");
    190199    }
    191 
    192 
    193200    printf("#undef p_MemAddAdjust__T\n");
    194201    printf("#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
     
    198205  printf("#include \"polys/templates/%s__T.cc\"\n", s_what);
    199206  printf("#undef %s\n", s_what);
     207  if (strcmp(s_field, "RingGeneral") == 0)
     208  {
    200209#ifdef HAVE_RINGS
    201   if (strcmp(s_field, "RingGeneral") == 0)
     210    printf("#undef HAVE_RINGS\n");
    202211    printf("#undef HAVE_ZERODIVISORS\n");
    203 #endif
     212#else
     213    printf("#endif\n");
     214#endif
     215  }
    204216#ifndef p_Procs_Static
    205217  printf("#endif // p_Procs_[Kernel|Field*]\n");
     
    318330  printf("* FieldZpProcs         = %d\n",FieldZpProcs);
    319331  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);
    321334  printf("* FieldUnknownProcs    = %d\n",UnknownProcs);
    322335#endif
  • libpolys/polys/templates/p_Procs_Impl.h

    r5656667 r7d27c2  
    1111#define P_PROCS_IMPL_H
    1212
     13#include <misc/auxiliary.h>
     14
    1315/***************************************************************
    1416 *
     
    8991// Predicate which returns true if alloc/copy/free of numbers is
    9092// like that of Zp (rings should use GMP in future)
    91 #ifdef HAVE_RINGS
    9293#define ZP_COPY_FIELD(field) \
    9394  (field == FieldZp || field == FieldGF || field == FieldR)
    94 #else
    95 #define ZP_COPY_FIELD(field) \
    96   (field == FieldZp || field == FieldGF || field == FieldR)
    97 #endif
    9895
    9996/***************************************************************
     
    120117  FieldQ_a,
    121118#endif
    122 #ifdef HAVE_RINGS
    123119  RingGeneral,
    124 #endif
    125120  FieldUnknown
    126121} p_Field;
     
    216211      case FieldQ_a: return "FieldQ_a";
    217212#endif
    218 #ifdef HAVE_RINGS
    219213      case RingGeneral: return "RingGeneral";
    220 #endif
    221214      case FieldUnknown: return "FieldUnknown";
    222215  }
     
    405398  // simply exclude some things
    406399  if ((proc == pp_Mult_mm_Noether_Proc || proc == p_kBucketSetLm_Proc) &&
    407 #ifdef HAVE_RINGS
    408400      (field != RingGeneral) &&
    409 #endif
    410401      (field != FieldZp))
    411402  {
     
    428419       proc != p_Merge_q_Proc))
    429420  {
    430 #ifdef HAVE_RINGS
    431     if (field != RingGeneral)
    432 #endif
    433     field = FieldGeneral;
     421    if (field != RingGeneral) field = FieldGeneral;
    434422    length = LengthGeneral;
    435423    ord = OrdGeneral;
     
    446434      (HAVE_FAST_FIELD == 1 && field != FieldZp) ||
    447435      (field != FieldZp && field != FieldQ))
    448 #ifdef HAVE_RINGS
    449     if (field != RingGeneral)
    450 #endif
    451     field = FieldGeneral;
     436    if (field != RingGeneral) field = FieldGeneral;
    452437}
    453438
     
    487472{
    488473  if (ZP_COPY_FIELD(field)) field = FieldZp;
     474  else if (field == RingGeneral) field = FieldGeneral;
    489475}
    490476
    491477// in p_Add_q, p_MemCmp works with CompLSize,
    492478// hence, we do not need to consider ZeroOrds
    493 static inline void p_Add_q__Filter(p_Length &length, p_Ord &ord)
     479static inline void p_Add_q__Filter(p_Field &field,p_Length &length, p_Ord &ord)
    494480{
    495481  if (IsZeroOrd(ord))
     
    501487    }
    502488  }
     489  if (field == RingGeneral) field = FieldGeneral;
     490}
     491
     492static 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;
    503497}
    504498
     
    516510  {
    517511    // 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;
    522513    ord = OrdGeneral;
    523514    length = LengthGeneral;
     
    532523      case p_Add_q_Proc:
    533524      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);
    535530        break;
    536531
     
    547542          if (length == LengthOne || length == LengthTwo)
    548543          {
    549 #ifdef HAVE_RINGS
    550             if (field != RingGeneral)
    551 #endif
    552             field = FieldGeneral;
     544            if (field != RingGeneral) field = FieldGeneral;
    553545            length = LengthGeneral;
    554546            ord = OrdGeneral;
     
    570562}
    571563
    572 // returns 1 if combination of field/length/ord is invalid
     564// returns 0 if combination of field/length/ord is invalid
    573565static inline int IsValidSpec(p_Field field, p_Length length, p_Ord ord)
    574566{
     
    589581
    590582  // we cover everything for length <= two
    591   if (ord == OrdGeneral && length >= LengthTwo)
     583  if (ord == OrdGeneral && length > LengthTwo)
    592584    return 0;
     585#ifndef HAVE_RINGS
     586  if (field == RingGeneral) return 0;
     587#endif
    593588  return 1;
    594589}
     
    701696#endif
    702697
     698#define SetProcs_ring(field, length, ord)                               \
     699do                                                                      \
     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}                                                                       \
     716while (0)
     717
    703718#endif // P_PROCS_IMPL_H
    704719
  • libpolys/polys/templates/p_Procs_Set.h

    r5656667 r7d27c2  
    1515
    1616#include <reporter/reporter.h>
     17#include <libpolys/libpolysconfig.h>
    1718
    1819// extract p_Procs properties from a ring
     
    3031  if (rField_is_Q_a(r)) return FieldQ_a;
    3132#endif
    32 #ifdef HAVE_RINGS
    3333  if (rField_is_Ring(r)) return RingGeneral;
    34 #endif
    3534  return FieldGeneral;
    3635}
     
    129128    WarnS("If you chose a coef ring, it may not work at all");\
    130129    p_Procs->which =                 (which##_Proc_Ptr)(    \
    131       which##__FieldGeneral_LengthGeneral_OrdGeneral);       \
     130      which##__FieldGeneral_LengthGeneral_OrdGeneral);      \
    132131  }                                                         \
    133132}                                                           \
     
    146145  memset(p_Procs, 0, sizeof(p_Procs_s));
    147146  _p_procs = p_Procs;
    148   assume(IsValidSpec(field, length, ord));
    149147
    150148  SetProcs(field, length, ord);
     
    157155    // set all non-mult/div. routines to FieldZp-variants
    158156    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);
    159165  }
    160166  #endif
  • omalloc/omallocClass.cc

    r5656667 r7d27c2  
    66*/
    77
    8 #include <omalloc/omalloc.h>
    9 
    108#ifdef __cplusplus
    119
     
    1311#include <stdlib.h>
    1412#include <omalloc/omallocClass.h>
    15 
    16 void*  omallocClass::operator new[] ( size_t size )
    17 #ifndef __GNUC__
    18 throw (std::bad_alloc)
    19 #endif
    20 {
    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 #endif
    31 {
    32   omfree( block );
    33 }
    3413
    3514// The C++ standard has ratified a change to the new operator.
  • omalloc/omallocClass.h

    r5656667 r7d27c2  
    4343throw (std::bad_alloc)
    4444#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}
    4651
    4752void operator delete[] ( void* block )
     
    4954throw ()
    5055#endif
    51 ;
     56{
     57  omfree( block );
     58}
     59
    5260
    5361// The C++ standard has ratified a change to the new operator.
  • resources/feResource.cc

    r5656667 r7d27c2  
    9191  {"Path",      'p',    feResPath,  NULL,                   "%b;%P;$PATH",             (char *)""},
    9292
     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
    9398  {"emacs",     'E',    feResBinary,"ESINGULAR_EMACS",      "%b/emacs",             (char *)""},
    9499  {"xemacs",    'A',    feResBinary,"ESINGULAR_EMACS",      "%b/xemacs",            (char *)""},
    95100  {"SingularEmacs",'M', feResBinary,"ESINGULAR_SINGULAR",   "%b/Singular",          (char *)""},
     101#endif
    96102  {"EmacsLoad", 'l',    feResFile,  "ESINGULAR_EMACS_LOAD", "%e/.emacs-singular",   (char *)""},
    97103  {"EmacsDir",  'e',    feResDir,   "ESINGULAR_EMACS_DIR",  "%D/singular/emacs",             (char *)""},
  • resources/omFindExec.c

    r5656667 r7d27c2  
    3939  char *search;
    4040  char *p;
    41 #ifdef WINNT
    42   char *extra = NULL;
    43 #endif
    4441  char tbuf[MAXPATHLEN];
    4542
     
    5047      {
    5148        strcpy(executable, name);
    52 #ifdef __CYGWIN__
    53         strcat(executable, ".exe");
    54 #endif
    5549        return executable;
    5650      }
     
    7569      {
    7670        strcpy(executable, tbuf);
    77 #ifdef __CYGWIN__
    78         strcat(executable, ".exe");
    79 #endif
    8071        return executable;
    8172      }
     
    8576    search = getenv("PATH");
    8677/* for winnt under msdos, cwd is implictly in the path */
    87 #ifdef WINNT
    88     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 #endif
    9978    p = search;
    10079
     
    129108        if (! access (tbuf, F_OK))
    130109        {
    131 #ifdef WINNT
    132           if (extra != NULL)
    133             free(extra);
    134 #endif
    135110          strcpy(executable, tbuf);
    136 #ifdef __CYGWIN__
    137           strcat(executable, ".exe");
    138 #endif
    139111          return executable;
    140112        }
     
    219191}
    220192
    221 #ifdef WINNT
     193#ifdef __CYGWIN__
     194/* for windows, serch first for .exe */
    222195char * _omFindExec (const char *name, char* exec);
    223 /* for windows, serch first for .exe */
    224196char* omFindExec(const char *name, char* exec)
    225197{
  • xalloc/Makefile.am

    r5656667 r7d27c2  
    11ACLOCAL_AMFLAGS = -I ../m4
    22
    3 noinst_LTLIBRARIES=libomalloc.la
     3lib_LTLIBRARIES=libomalloc.la
    44
    5 # lib_LTLIBRARIES=libomalloc.la
    6 # lib_LIBRARIES=libomalloc.a
     5libomalloc_includedir=$(includedir)/omalloc
    76
    8 # libomallocdir = $(libdir)/
     7libomalloc_include_HEADERS = omalloc.h omallocClass.h
    98
    10 # libomalloc_includedir=$(includedir)/omalloc
    11 # libomalloc_include_HEADERS = omalloc.h
     9SOURCES=dummy.c omallocClass.cc
    1210
    13 SOURCES = dummy.c omalloc.h
     11AM_CPPFLAGS =-I${top_srcdir}/.. -I${top_builddir}/..
    1412
    15 libomalloc_la_SOURCES  =$(SOURCES)
     13libomalloc_la_SOURCES=$(SOURCES) $(noinst_HEADERS)
    1614
    17 libomalloc_la_LDFLAGS  = -release ${PACKAGE_VERSION}
     15libomalloc_la_LDFLAGS    = -release ${PACKAGE_VERSION}
    1816
     17libomalloc_la_CPPFLAGS  = ${AM_CPPFLAGS}
    1918
     19omTables_CPPFLAGS = ${AM_CPPFLAGS}
     20
     21CLEANFILES = $(BUILT_SOURCES)
     22DISTCLEANFILES = omConfig.h
     23
  • xalloc/README

    r5656667 r7d27c2  
     1README 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)
     1dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     2dnl File: configure.ac
     3dnl Purpose: Process this file with autoconf to produce configure
     4dnl Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
     5dnl Created: 11/99
     6dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     7
     8AC_INIT([xmalloc],[4.0])
     9
    310AC_CONFIG_MACRO_DIR([../m4])
    411AC_CONFIG_AUX_DIR([../build-aux])
     12AC_CONFIG_SRCDIR(dummy.c)
     13AC_CONFIG_HEADER([_config.h])
     14
     15AC_PROG_CC
     16AC_PROG_CXX
     17
     18SING_RESET_FLAGS()
    519
    620AM_MAINTAINER_MODE([enable])
     
    923m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
    1024
     25AM_SANITY_CHECK
    1126
     27# Add pre'prefixed config
     28AX_PREFIX_CONFIG_H([omConfig.h],[],[_config.h])
     29
     30# SING_CHECK_SET_ARGS()
     31
     32AC_SUBST(VERSION)
     33
     34CPPFLAGS="-I.. -I. $CPPFLAGS"
    1235AC_PROG_MAKE_SET
    13 # AC_PROG_CC
    14 # AC_PROG_CPP
     36AC_PROG_CC
     37AC_PROG_CPP
    1538
    1639AC_PROG_LN_S
    1740AC_PROG_INSTALL
    1841AM_PROG_CC_C_O
    19 
     42# AM_PROG_AR
    2043AC_C_CONST
    2144AC_C_INLINE
     
    2346LT_INIT
    2447
    25 SING_RESET_FLAGS()
    26 SING_CHECK_SET_ARGS()
    2748
     49dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     50dnl check for programs
     51dnl
     52AC_CHECK_PROG(AR, ar, ar, :)
     53if test "$ac_cv_prog_AR" = no; then
     54  AC_MSG_ERROR(*** ar program not found)
     55fi
    2856
     57dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     58dnl header file checks
     59dnl
     60AC_HEADER_STDC
     61AC_CHECK_HEADERS(limits.h,,
     62  AC_MSG_ERROR(Can not compile without limits.h))
     63
     64AC_CHECK_HEADERS(unistd.h sys/mman.h fcntl.h /usr/include/malloc.h)
     65
     66AC_CHECK_FUNCS(popen mmap sbrk random)
     67
     68dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     69dnl Find out more about particularity of the system
     70dnl
     71
     72# sizes
     73AC_CHECK_SIZEOF(long,4)
     74AC_CHECK_SIZEOF(void*,4)
     75AC_CHECK_SIZEOF(double, 8)
     76AC_CHECK_SIZEOF(size_t, 4)
     77
     78if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then
     79  AC_MSG_ERROR(need equal sizes for long and void*)
     80fi
     81if 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)
     83fi
     84if 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)
     86fi
     87
     88dnl Set compiler, linker flags so that we can work with omalloc
     89BACKUP_CFLAGS=$CFLAGS
     90BACKUP_CXXFLAGS=$CXXFLAGS
     91BACKUP_LDFLAGS=$LDFLAGS
     92
     93CFLAGS="$CFLAGS -I$srcdir"
     94CXXFLAGS="$CXXFLAGS -I$srcdir"
     95
     96AC_SUBST(OM_MALLOC_HEADER)
     97AC_SUBST(OM_MALLOC_SOURCE)
     98
     99dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     100dnl wrap it up
     101dnl
    29102AC_CONFIG_FILES([Makefile])
    30103AC_OUTPUT
  • xalloc/omalloc.h

    r5656667 r7d27c2  
    99#include <stdlib.h>
    1010#include <string.h>
     11#include <omalloc/omConfig.h>
    1112
    1213#ifdef __cplusplus
     
    8283  }
    8384}
     85#define omReallocAligned(A,B) omRealloc(A,B)
    8486static inline void *omReallocSize(void *d, size_t os, size_t ns)
    8587{ if (d==NULL) return omAlloc(ns);
Note: See TracChangeset for help on using the changeset viewer.