Changeset 7f581e in git


Ignore:
Timestamp:
Apr 20, 2011, 4:40:43 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '79dfb9a6d258bfeb991428bdb25b8f55e9e809b2')
Children:
c47547d6e52a72fa99fb925244f037994d2ee996
Parents:
a088a124beb3fcae063eb326f03ad572927bd5b8
Message:
add access to rings of newstruct members: r_ prefix

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

Legend:

Unmodified
Added
Removed
  • Singular/newstruct.cc

    ra088a12 r7f581e  
    3333  else
    3434  {
    35     newstruct_desc ad=(newstruct_desc)b->data;
     35    newstruct_desc ad=(newstruct_desc)(b->data);
    3636    lists l=(lists)d;
    3737    newstruct_member a=ad->member;
     
    172172      if (a2->name!=NULL)
    173173      {
     174        BOOLEAN search_ring=FALSE;
    174175        newstruct_member nm=nt->member;
    175176        while ((nm!=NULL)&&(strcmp(nm->name,a2->name)!=0)) nm=nm->next;
     177        if ((nm==NULL) && (strncmp(a2->name,"r_",2)==0))
     178        {
     179          nm=nt->member;
     180          while ((nm!=NULL)&&(strcmp(nm->name,a2->name+2)!=0)) nm=nm->next;
     181          if ((nm!=NULL)&&(RingDependend(nm->typ)))
     182            search_ring=TRUE;
     183          else
     184            nm=NULL;
     185        }
    176186        if (nm==NULL)
    177187        {
     
    179189          return TRUE;
    180190        }
    181         if (RingDependend(nm->typ))
     191        if (search_ring)
     192        {
     193          ring r;
     194          res->rtyp=RING_CMD;
     195          res->data=al->m[nm->pos-1].data;
     196          r=(ring)res->data;
     197          if (r==NULL) { res->data=(void *)currRing; r=currRing; }
     198          if (r!=NULL) r->ref++;
     199          else Werror("ring of this member is not set and no basering found");
     200          return r==NULL;
     201        }
     202        else if (RingDependend(nm->typ))
    182203        {
    183204          if (al->m[nm->pos].data==NULL)
Note: See TracChangeset for help on using the changeset viewer.