Changeset befd80d in git


Ignore:
Timestamp:
Apr 1, 2019, 12:02:40 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
f2749caea51700fb0ba2c2635aeaf6111f86387a
Parents:
1d8d0e5c474f63a8db51f932e87069659c60189d
Message:
opt: iiS2I
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/idrec.h

    r1d8d0e rbefd80d  
    4545  short      lev;
    4646  short      ref;
    47   int        id_i;
     47  unsigned long id_i;
    4848
    4949  idrec() { memset(this,0,sizeof(*this)); }
  • Singular/ipid.cc

    r1d8d0e rbefd80d  
    6363/*0 implementation*/
    6464
    65 int iiS2I(const char *s)
    66 {
    67   int i;
    68   i=s[0];
    69   if (s[1]!='\0')
    70   {
    71     i=(i<<8)+s[1];
    72     if (s[2]!='\0')
    73     {
    74       i=(i<<8)+s[2];
    75       if (s[3]!='\0')
    76       {
    77         i=(i<<8)+s[3];
    78       }
    79     }
    80   }
    81   return i;
     65static inline long iiS2I(const char *s)
     66{
     67  long l;
     68  strncpy((char*)&l,s,SIZEOF_LONG);
     69  return l;
    8270}
    8371
     
    9078  int l;
    9179  const char *id_;
    92   int i=iiS2I(s);
    93   int less4=(i < (1<<24));
     80  unsigned long i=iiS2I(s);
     81  int less4=(i < (1L<<((SIZEOF_LONG-1)*8)));
    9482  while (h!=NULL)
    9583  {
     
    10189      {
    10290        id_=IDID(h);
    103         if (less4 || (0 == strcmp(s+4,id_+4)))
     91        if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
    10492        {
    105           if (l==level) return h;
     93          if(l==level) return h;
    10694          found=h;
    10795        }
  • Singular/subexpr.cc

    r1d8d0e rbefd80d  
    16471647      }
    16481648      else
    1649       h=ggetid(id);
     1649      {
     1650        h=ggetid(id);
     1651      }
    16501652      /* 3) existing identifier, local */
    16511653      if ((h!=NULL) && (IDLEV(h)==myynest))
Note: See TracChangeset for help on using the changeset viewer.