Skip to content

Commit

Permalink
chg: disclosuring fewer of newstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Dreyer committed Aug 1, 2012
1 parent ed47aab commit eff3247
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
17 changes: 9 additions & 8 deletions Singular/newstruct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -612,19 +612,13 @@ static newstruct_desc scanNewstructFromString(const char *s, newstruct_desc res)
currRingHdl=save_ring;
return NULL;
}

newstruct_desc newstructDesc()
newstruct_desc newstructFromString(const char *s)
{
newstruct_desc res=(newstruct_desc)omAlloc0(sizeof(*res));
res->size=0;
return res;
}

newstruct_desc newstructFromString(const char *s)
{
return scanNewstructFromString(s, newstructDesc());
return scanNewstructFromString(s,res);
}

newstruct_desc newstructChildFromString(const char *parent, const char *s)
{
// find parent:
Expand Down Expand Up @@ -669,6 +663,13 @@ BOOLEAN newstruct_set_proc(const char *bbname,const char *func, int args,procinf
blackboxIsCmd(bbname,id);
blackbox *bb=getBlackboxStuff(id);
newstruct_desc desc=(newstruct_desc)bb->data;
if (desc == NULL)
{
desc=(newstruct_desc)omAlloc0(sizeof(*desc));
desc->size=0;
bb->data = (void*)desc;
}

newstruct_proc p=(newstruct_proc)omAlloc(sizeof(*p));
p->next=desc->procs; desc->procs=p;
if(!IsCmd(func,p->t))
Expand Down
2 changes: 1 addition & 1 deletion Singular/newstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
typedef struct newstruct_desc_s *newstruct_desc;

void newstruct_setup(const char * name, newstruct_desc d);
newstruct_desc newstructDesc();
newstruct_desc newstructFromString(const char *s);
newstruct_desc newstructChildFromString(const char *p, const char *s);
BOOLEAN newstruct_set_proc(const char *name,const char *func,int args, procinfov p);
void newstructShow(newstruct_desc d);

#endif
1 change: 0 additions & 1 deletion Singular/pyobject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ void pyobject_init()
b->blackbox_Op2 = pyobject_Op2;
b->blackbox_Op3 = pyobject_Op3;
b->blackbox_OpM = pyobject_OpM;
b->data = newstructDesc();

PythonInterpreter::init(setBlackboxStuff(b,"pyobject"));

Expand Down

0 comments on commit eff3247

Please sign in to comment.