Пример #1
0
void* CMemoryPool::AllocZero()
{
	return AllocZero( m_BlockSize );
}
Пример #2
0
void ImplicitAtt(FILE *Nf)
/*   -----------  */
{
#ifdef CUBIST
    _UNK.cval = UNKNOWN;
#else
    _UNK.dval = UNKNOWN;
#endif
    _NA.dval  = NA;

    /*  Get definition as a string in Buff  */

    ReadDefinition(Nf);

    PreviousError = false;
    BN = 0;

    /*  Allocate initial stack and attribute definition  */

    TStack = Alloc(TStackSize=50, EltRec);
    TSN = 0;

    AttDef[MaxAtt] = Alloc(DefSize = 100, DefElt);
    DN = 0;

    /*  Parse Buff as an expression terminated by a period  */

    Expression();
    if ( ! Find(".") ) DefSyntaxError("'.' ending definition");

    /*  Final check -- defined attribute must not be of type String  */

    if ( ! PreviousError )
    {
        if ( DN == 1 && DefOp(AttDef[MaxAtt][0]) == OP_ATT &&
                strcmp(AttName[MaxAtt], "case weight") )
        {
            Error(SAMEATT, AttName[ (long) DefSVal(AttDef[MaxAtt][0]) ], Nil);
        }

        if ( TStack[0].Type == 'B' )
        {
            /*  Defined attributes should never have a value N/A  */

            MaxAttVal[MaxAtt] = 3;
            AttValName[MaxAtt] = AllocZero(4, String);
            AttValName[MaxAtt][1] = strdup("??");
            AttValName[MaxAtt][2] = strdup("t");
            AttValName[MaxAtt][3] = strdup("f");
        }
        else
        {
            MaxAttVal[MaxAtt] = 0;
        }
    }

    if ( PreviousError )
    {
        DN = 0;
        SpecialStatus[MaxAtt] = EXCLUDE;
    }

    /*  Write a terminating marker  */

    DefOp(AttDef[MaxAtt][DN]) = OP_END;

    Free(Buff);
    Free(TStack);
}