Beispiel #1
0
Datalist*
getfiller(Symbol* tvsym)
{
    Datalist* filler = NULL;
    Symbol* tsym = tvsym;
    ASSERT(tvsym->objectclass == NC_VAR || tvsym->objectclass == NC_TYPE);
    if(tvsym->objectclass == NC_VAR) {
	tsym = tvsym->typ.basetype;
        filler = tvsym->var.special._Fillvalue; /* get cached value (if any)*/
    }
    if(filler == NULL || tvsym->objectclass == NC_TYPE) {
        filler = tvsym->typ._Fillvalue; /* get cached value (if any)*/
    }
    if(filler == NULL) { /* need to compute it*/
        filler = builddatalist(0);
	fill(tsym,filler);
    }
#ifdef DEBUG2
    dumpdatalist(filler,"getfiller");
#endif
    if(tvsym->objectclass == NC_VAR) {
        tvsym->var.special._Fillvalue = filler;
    } else if(tvsym->objectclass == NC_TYPE) {
        tvsym->typ._Fillvalue = filler; /* cache value*/
    }
    return filler;        
}
Beispiel #2
0
static void
setconstlist(NCConstant* con, Datalist* dl)
{
#ifdef VERIFY
    int pos = verify(alldatalists,dl);
    if(pos >= 0) {
        dumpdatalist(listget(alldatalists,pos),"XXX");
    }
#endif
    con->value.compoundv = dl;
}
Datalist*
getfiller(Symbol* tvsym, Datalist* fillsrc)
{
    Datalist* filler = fillsrc;
    if(filler == NULL)
        filler = tvsym->var.special._Fillvalue; /* get cached value (if any)*/
    if(filler == NULL) { /* need to compute it*/
	filler = buildfill(tvsym);
        tvsym->var.special._Fillvalue = filler; /* cache value*/
    }
if(debug >= 1)
    dumpdatalist(filler,"getfiller");
    return filler;        
}