Changeset 19b018 in git for Singular/countedref.cc
- Timestamp:
- Sep 7, 2012, 10:17:48 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- c4d8c3a681ea70bc8bd0864ac803ece0f451e619
- Parents:
- 8357e215b04863da2f7f9897d29475d589e7c2f8
- git-author:
- Alexander Dreyer <alexander.dreyer@itwm.fraunhofer.de>2012-09-07 22:17:48+02:00
- git-committer:
- Alexander Dreyer <alexander.dreyer@itwm.fraunhofer.de>2012-09-08 00:20:23+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/countedref.cc
r8357e21 r19b018 26 26 #include "ipshell.h" 27 27 28 class CountedRefEnv {29 typedef CountedRefEnv self;30 31 public:32 33 static int& ref_id() {34 static int g_ref_id = 0;35 return g_ref_id;36 }37 38 static int& sh_id() {39 static int g_sh_id = 0;40 return g_sh_id;41 }42 };43 28 44 29 /// Overloading ring destruction … … 198 183 } 199 184 185 /// We use the as a marker of refernce types. 186 BOOLEAN countedref_CheckAssign(blackbox *b, leftv L, leftv R) 187 { 188 return FALSE; 189 } 190 200 191 201 192 class CountedRef { … … 215 206 static BOOLEAN is_ref(leftv arg) { 216 207 int typ = arg->Typ(); 217 return ((typ==CountedRefEnv::ref_id()) ||(typ==CountedRefEnv::sh_id()) ); 218 // return ((typ > MAX_TOK) && 219 // (getBlackboxStuff(typ)->blackbox_Init == countedref_Init)); 208 return ((typ > MAX_TOK) && 209 (getBlackboxStuff(typ)->blackbox_CheckAssign == countedref_CheckAssign)); 220 210 } 221 211 … … 684 674 { 685 675 blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox)); 676 bbx->blackbox_CheckAssign = countedref_CheckAssign; 686 677 bbx->blackbox_destroy = countedref_destroy; 687 678 bbx->blackbox_String = countedref_String; … … 697 688 bbx->blackbox_deserialize = countedref_deserialize; 698 689 bbx->data = omAlloc0(newstruct_desc_size()); 699 CountedRefEnv::ref_id()=setBlackboxStuff(bbx, "reference");690 setBlackboxStuff(bbx, "reference"); 700 691 701 692 /// The @c shared type is "inherited" from @c reference. … … 703 694 blackbox *bbxshared = 704 695 (blackbox*)memcpy(omAlloc(sizeof(blackbox)), bbx, sizeof(blackbox)); 696 bbxshared->blackbox_CheckAssign = countedref_CheckAssign; 705 697 bbxshared->blackbox_Assign = countedref_AssignShared; 706 698 bbxshared->blackbox_destroy = countedref_destroyShared; … … 709 701 bbxshared->blackbox_Init = countedref_InitShared; 710 702 bbxshared->data = omAlloc0(newstruct_desc_size()); 711 CountedRefEnv::sh_id()=setBlackboxStuff(bbxshared, "shared");703 setBlackboxStuff(bbxshared, "shared"); 712 704 } 713 705
Note: See TracChangeset
for help on using the changeset viewer.