Changeset 8357e21 in git
- Timestamp:
- Jun 28, 2012, 3:32:59 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
- Children:
- 19b0184aff4a5a9ba4c2d12f88c2c9ec66e5552c
- Parents:
- 6dffa9e5b66ac5a81df2b68ff1c38dafc918b1f9
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2012-06-28 15:32:59+02:00
- git-committer:
- Alexander Dreyer <alexander.dreyer@itwm.fraunhofer.de>2012-09-08 00:20:22+02:00
- Location:
- Singular
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/blackbox.cc
r6dffa9 r8357e21 61 61 { 62 62 assume( bb->Typ() > MAX_TOK ); // it IS a blackbox type, right?! 63 63 64 64 if( op > 127 ) 65 65 Werror("'%s' of type %s(%d) for op %s(%d) not implemented", … … 108 108 } 109 109 110 BOOLEAN blackbox_default_Check(blackbox * b, void *d)110 BOOLEAN blackbox_default_Check(blackbox *,leftv,leftv) 111 111 { 112 112 return FALSE; … … 149 149 if (bb->blackbox_Op3==NULL) bb->blackbox_Op3=blackbox_default_Op3; 150 150 if (bb->blackbox_OpM==NULL) bb->blackbox_OpM=blackbox_default_OpM; 151 if (bb->blackbox_Check ==NULL) bb->blackbox_Check=blackbox_default_Check;151 if (bb->blackbox_CheckAssign==NULL) bb->blackbox_CheckAssign=blackbox_default_Check; 152 152 if (bb->blackbox_serialize==NULL) bb->blackbox_serialize=blackbox_default_serialize; 153 153 if (bb->blackbox_deserialize==NULL) bb->blackbox_deserialize=blackbox_default_deserialize; -
Singular/blackbox.h
r6dffa9 r8357e21 39 39 /// interpreter: operations with undefined number of operands 40 40 BOOLEAN (*blackbox_OpM)(int op,leftv l, leftv r); 41 /// check internal structure42 BOOLEAN (*blackbox_Check )(blackbox *b,void *d);41 /// is an assign of r to l (part of b) impossible? 42 BOOLEAN (*blackbox_CheckAssign)(blackbox *b,leftv l, leftv r); 43 43 /// serialize 44 44 BOOLEAN (*blackbox_serialize)(blackbox *b,void *d, si_link f); -
Singular/ipassign.cc
r6dffa9 r8357e21 1510 1510 { 1511 1511 bb=getBlackboxStuff(bt); 1512 like_lists=BB_LIKE_LIST(bb); 1512 like_lists=BB_LIKE_LIST(bb); // bb like a list 1513 1513 } 1514 1514 else if (((l->rtyp==IDHDL) && (IDTYP((idhdl)l->data)==LIST_CMD)) 1515 1515 || (l->rtyp==LIST_CMD)) 1516 1516 { 1517 like_lists=2; 1517 like_lists=2; // bb in a list 1518 1518 } 1519 1519 if(like_lists) 1520 1520 { 1521 1521 if (TEST_V_ALLWARN) PrintS("assign list[..]=...or similiar\n"); 1522 if (like_lists==1) 1523 { 1524 // check blackbox/newtype type: 1525 if(bb->blackbox_CheckAssign(bb,l,r)) return TRUE; 1526 } 1522 1527 b=jiAssign_list(l,r); 1523 1528 if((!b) && (like_lists==2)) … … 1538 1543 omFreeBin((ADDRESS)l->e, sSubexpr_bin); 1539 1544 l->e=h; 1540 }1541 if ((!b) && (like_lists==1))1542 {1543 // check blackbox/newtype type:1544 if(bb->blackbox_Check(bb,l->Data())) return TRUE;1545 1545 } 1546 1546 return b; -
Singular/newstruct.cc
r6dffa9 r8357e21 39 39 }; 40 40 41 int newstruct_desc_size() 41 int newstruct_desc_size() 42 42 { 43 43 return sizeof(newstruct_desc_s); … … 441 441 } 442 442 newstruct_proc p=nt->procs; 443 443 444 444 while((p!=NULL) &&( (p->t!=op) || (p->args!=4) )) p=p->next; 445 445 … … 510 510 } 511 511 512 BOOLEAN newstruct_Check(blackbox *b, void *d) 512 BOOLEAN newstruct_CheckAssign(blackbox *b, leftv L, leftv R) 513 { 514 int lt=L->Typ(); 515 int rt=R->Typ(); 516 if ((lt!=DEF_CMD)&&(lt!=rt)) 517 { 518 Werror("can not assign %s(%d) to member of type %s(%d)", 519 Tok2Cmdname(rt),rt, 520 Tok2Cmdname(lt),lt); 521 return TRUE; 522 } 523 return FALSE; 524 } 525 526 /* check internal structure: 527 * BOOLEAN newstruct_Check(blackbox *b, void *d) 513 528 { 514 529 newstruct_desc n=(newstruct_desc)b->data; … … 529 544 return FALSE; 530 545 } 546 */ 531 547 532 548 BOOLEAN newstruct_serialize(blackbox *b, void *d, si_link f) … … 598 614 //b->blackbox_Op3=blackbox_default_Op3; 599 615 b->blackbox_OpM=newstruct_OpM; 600 b->blackbox_Check =newstruct_Check;616 b->blackbox_CheckAssign=newstruct_CheckAssign; 601 617 b->blackbox_serialize=newstruct_serialize; 602 618 b->blackbox_deserialize=newstruct_deserialize;
Note: See TracChangeset
for help on using the changeset viewer.