MCPcopy Create free account
hub / github.com/Singular/Singular / newstruct_CheckAssign

Function newstruct_CheckAssign

Singular/newstruct.cc:557–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555}
556
557BOOLEAN newstruct_CheckAssign(blackbox */*b*/, leftv L, leftv R)
558{
559 int lt=L->Typ();
560 int rt=R->Typ();
561 if (iiTestConvert(rt,lt,dConvertTypes)==0)
562 {
563 const char *rt1=Tok2Cmdname(rt);
564 const char *lt1=Tok2Cmdname(lt);
565 if ((rt>0) && (lt>0)
566 && ((strcmp(rt1,Tok2Cmdname(0))==0)||(strcmp(lt1,Tok2Cmdname(0))==0)))
567 {
568 Werror("can not assign %s(%d) to member of type %s(%d)",
569 rt1,rt,lt1,lt);
570 }
571 else
572 {
573 Werror("can not assign %s to member of type %s",rt1,lt1);
574 }
575 return TRUE;
576 }
577 return FALSE;
578}
579
580/* check internal structure:
581* BOOLEAN newstruct_Check(blackbox *b, void *d)

Callers

nothing calls this directly

Calls 4

WerrorFunction · 0.85
iiTestConvertFunction · 0.70
Tok2CmdnameFunction · 0.70
TypMethod · 0.45

Tested by

no test coverage detected