/[ascend]/trunk/ascend/compiler/mathinst.c
ViewVC logotype

Diff of /trunk/ascend/compiler/mathinst.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2687 by jpye, Tue Oct 9 12:29:42 2012 UTC revision 2688 by jpye, Mon Mar 4 08:11:49 2013 UTC
# Line 384  void AddRelation(struct Instance *i, str Line 384  void AddRelation(struct Instance *i, str
384    }    }
385  }  }
386    
387  void RemoveRelation(struct Instance *i, struct Instance *reln)  void RemoveRelation(struct Instance *i, struct Instance *reln){
388  {      register unsigned long c;
389    register unsigned long c;      CONSOLE_DEBUG("Var %p: remove reference to rel %p",i,reln);
390    assert(i&&reln&&(reln->t==REL_INST));      assert(i&&reln&&(reln->t==REL_INST));
391    AssertMemory(i);      AssertMemory(i);
392    switch(i->t) {      switch(i->t){
393    case REAL_ATOM_INST:      case REAL_ATOM_INST:
394      if (RA_INST(i)->relations==NULL) {          CONSOLE_DEBUG("It is a real atom");
395        return;          if(RA_INST(i)->relations==NULL){
396      }              return;
397      c = gl_search(RA_INST(i)->relations,(char *)reln,(CmpFunc)CmpRelations);          }
398      if (c>0) {          c = gl_search(RA_INST(i)->relations,(char *)reln,(CmpFunc)CmpRelations);
399        gl_delete(RA_INST(i)->relations,c,0);          if(c>0){
400      }              gl_delete(RA_INST(i)->relations,c,0);
401      break;          }
402    default:          break;
403      PANIC_INCORRECT_TYPE(i);      default:
404    }          PANIC_INCORRECT_TYPE(i);
405        }
406  }  }
407    
408  /*------------------------------------------------------------------------------  /*------------------------------------------------------------------------------

Legend:
Removed from v.2687  
changed lines
  Added in v.2688

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22