Changeset 0de0509 in git for Singular


Ignore:
Timestamp:
Nov 21, 2013, 11:15:23 AM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
78aaec0999577dbe04c598349d696da11bf79ebd
Parents:
a9c2986e020e2efafd15932b4d1b2b2fa77407e4
Message:
chg: better error check and debug stuff for newstruct/blackbox
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    ra9c298 r0de0509  
    102102#include "walk.h"
    103103#include <Singular/newstruct.h>
     104#include <Singular/blackbox.h>
    104105#include <Singular/pyobject_setup.h>
    105106
     
    38343835      return newstruct_set_proc((char*)h->Data(),(char*)h->next->Data(),
    38353836                                (int)(long)h->next->next->next->Data(),
    3836                                 (procinfov)h->next->next->Data());
     3837                                (procinfov)h->next->next->Data());
    38373838    }
    38383839    return TRUE;
     3840  }
     3841  else
     3842  if (strcmp(sys_cmd,"newstruct")==0)
     3843  {
     3844    if ((h!=NULL) && (h->Typ()==STRING_CMD))
     3845    {
     3846      int id=0;
     3847      blackboxIsCmd((char*)h->Data(),id);
     3848      if (id>0)
     3849      {
     3850        blackbox *bb=getBlackboxStuff(id);
     3851        if (BB_LIKE_LIST(bb))
     3852        {
     3853          newstruct_desc desc=(newstruct_desc)bb->data;
     3854          newstructShow(desc);
     3855          return FALSE;
     3856        }
     3857      }
     3858    }
     3859    return TRUE;
     3860  }
     3861  else
     3862  if (strcmp(sys_cmd,"blackbox")==0)
     3863  {
     3864    printBlackboxTypes();
     3865    return FALSE;
    38393866  }
    38403867  else
  • Singular/newstruct.cc

    ra9c298 r0de0509  
    260260      }
    261261    }
    262     if (l->Typ()==r->Typ())
     262    else /*if (l->Typ()==r->Typ())*/
    263263    {
    264264      if (l->Data()!=NULL)
     
    370370          }
    371371          else if (RingDependend(nm->typ)
    372           || (al->m[nm->pos].RingDependend()))
     372          || (al->m[nm->pos].RingDependend()))
    373373          {
    374374            if (al->m[nm->pos].data==NULL)
     
    402402            }
    403403          }
    404           else if ((nm->typ==DEF_CMD)||(nm->typ==LIST_CMD))
    405           {
    406             if (al->m[nm->pos-1].data==NULL)
    407             {
    408               al->m[nm->pos-1].data=(void*)currRing;
    409               if (currRing!=NULL) currRing->ref++;
    410             }
    411           }
     404          else if ((nm->typ==DEF_CMD)||(nm->typ==LIST_CMD))
     405          {
     406            if (al->m[nm->pos-1].data==NULL)
     407            {
     408              al->m[nm->pos-1].data=(void*)currRing;
     409              if (currRing!=NULL) currRing->ref++;
     410            }
     411          }
    412412          Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
    413413          r->start = nm->pos+1;
     
    618618    hh.data.pinf=p->p;
    619619    sl=iiMake_proc(&hh,NULL,&tmp);
    620     if (!sl) iiRETURNEXPR.CleanUp();
     620    if (!sl)
     621    {
     622      if (iiRETURNEXPR.Typ()!=NONE) Warn("ignoring return value (%s)",Tok2Cmdname(iiRETURNEXPR.Typ()));
     623      iiRETURNEXPR.CleanUp();
     624    }
    621625    iiRETURNEXPR.Init();
    622626  }
     
    772776    elem=elem->next;
    773777  }
     778  newstruct_proc p=d->procs;
     779  while (p!=NULL)
     780  {
     781    Print("op:%d(%s) with %d args -> %s\n",p->t,iiTwoOps(p->t),p->args,p->p->procname);
     782    p=p->next;
     783  }
    774784}
    775785
Note: See TracChangeset for help on using the changeset viewer.