Changeset a604c3 in git for kernel/longrat0.cc


Ignore:
Timestamp:
Apr 16, 2010, 12:15:43 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0f7301e691bd462913428c33f8962015a37bb532
Parents:
603aebf126f77cf0b8c041b0833934960300078a
Message:
gmp stuff

git-svn-id: file:///usr/local/Singular/svn/trunk@12728 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/longrat0.cc

    r603aebf ra604c3  
    2626* extracts a long integer from s, returns the rest
    2727*/
    28 static const char * nlEatLong(char *s, MP_INT *i)
     28static const char * nlEatLong(char *s, mpz_ptr i)
    2929{
    3030  const char * start=s;
     
    6161    (*a)->debug=123456;
    6262#endif
    63     MP_INT *z=&((*a)->z);
    64     MP_INT *n=&((*a)->n);
     63    mpz_ptr z=(*a)->z;
     64    mpz_ptr n=(*a)->n;
    6565    mpz_init(z);
    6666    s = nlEatLong((char *)s, z);
     
    9090    if ((*a)->s==3)
    9191    {
    92       int ui=(int)mpz_get_si(&(*a)->z);
     92      int ui=(int)mpz_get_si((*a)->z);
    9393      if ((((ui<<3)>>3)==ui)
    94       && (mpz_cmp_si(&(*a)->z,(long)ui)==0))
     94      && (mpz_cmp_si((*a)->z,(long)ui)==0))
    9595      {
    96         mpz_clear(&(*a)->z);
     96        mpz_clear((*a)->z);
    9797        omFreeBin((ADDRESS)(*a), rnumber_bin);
    9898        (*a)=INT_TO_SR(ui);
     
    127127      return;
    128128    }
    129     int l=mpz_sizeinbase(&a->z,10);
    130     if (a->s<2) l=si_max(l,mpz_sizeinbase(&a->n,10));
     129    int l=mpz_sizeinbase(a->z,10);
     130    if (a->s<2) l=si_max(l,mpz_sizeinbase(a->n,10));
    131131    l+=2;
    132132    s=(char*)omAlloc(l);
    133     z=mpz_get_str(s,10,&a->z);
     133    z=mpz_get_str(s,10,a->z);
    134134    StringAppendS(z);
    135135    if (a->s!=3)
    136136    {
    137137      StringAppendS("/");
    138       z=mpz_get_str(s,10,&a->n);
     138      z=mpz_get_str(s,10,a->n);
    139139      StringAppendS(z);
    140140    }
Note: See TracChangeset for help on using the changeset viewer.