Changeset ed47aab in git for Singular/newstruct.cc


Ignore:
Timestamp:
Aug 1, 2012, 11:02:34 PM (11 years ago)
Author:
Alexander Dreyer <alexander.dreyer@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
Children:
eff32475b39858b9ea00d1f210285e77a6d485d1
Parents:
3d69257fe19a1e388e6e33fc7381ea50cf3041cb
Message:
new: newstruct_desc can be utilized by non-newstruc custom types
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/newstruct.cc

    r3d69257 red47aab  
    158158          l->rtyp=r->Typ();
    159159        }
     160      }
     161      else                      // unrelated types - look for custom conversion
     162      {
     163        sleftv tmp;
     164        BOOLEAN newstruct_Op1(int, leftv, leftv);  // forward declaration
     165        if (! newstruct_Op1(l->Typ(), &tmp, r))  return newstruct_Assign(l, &tmp);
    160166      }
    161167    }
     
    607613   return NULL;
    608614}
    609 newstruct_desc newstructFromString(const char *s)
     615
     616newstruct_desc newstructDesc()
    610617{
    611618  newstruct_desc res=(newstruct_desc)omAlloc0(sizeof(*res));
    612619  res->size=0;
    613 
    614   return scanNewstructFromString(s,res);
    615 }
     620  return res;
     621}
     622
     623newstruct_desc newstructFromString(const char *s)
     624{
     625  return scanNewstructFromString(s, newstructDesc());
     626}
     627
    616628newstruct_desc newstructChildFromString(const char *parent, const char *s)
    617629{
Note: See TracChangeset for help on using the changeset viewer.