ucif/antlr3/src/antlr3collections.c
static  void
antlr3VectorClear       (pANTLR3_VECTOR vector)
{
        ANTLR3_UINT32   entry;

        // We must traverse every entry in the vector and if it has
        // a pointer to a free function then we call it with the
        // the entry pointer
        //
        for     (entry = 0; entry < vector->count; entry++)
        {
                if  (vector->elements[entry].freeptr != NULL)
                {
                        vector->elements[entry].freeptr(vector->elements[entry].element);
                }
                vector->elements[entry].freeptr    = NULL;
                vector->elements[entry].element    = NULL;
        }

        // Having called any free pointers, we just reset the entry count
        // back to zero.
        //
        vector->count   = 0;
}
// Clear the entries in a vector.
// Clearing the vector leaves its capacity the same but
// it walks the entries first to see if any of them
// have a free routine that must be called.
//
Clear the entries in a vector.
Clearing the vector leaves its capacity the same but
it walks the entries first to see if any of them
have a free routine that must be called.
Clear the entries in a vector . Clearing the vector leaves its capacity the same but it walks the entries first to see if any of them have a free routine that must be called .
static  void
antlr3VectorClear       (pANTLR3_VECTOR vector)
{
        ANTLR3_UINT32   entry;
        for     (entry = 0; entry < vector->count; entry++)
        {
                if  (vector->elements[entry].freeptr != NULL)
                {
                        vector->elements[entry].freeptr(vector->elements[entry].element);
                }
                vector->elements[entry].freeptr    = NULL;
                vector->elements[entry].element    = NULL;
        }
         Having called any free pointers, we just reset the entry count
         back to zero.
        vector->count   = 0;
}
static void antlr3VectorClear ( pANTLR3_VECTOR vector ) { ANTLR3_UINT32 entry ; for ( entry = 0 ; entry < vector -> count ; entry ++ ) { if ( vector -> elements [ entry ] . freeptr != NULL ) { vector -> elements [ entry ] . freeptr ( vector -> elements [ entry ] . element ) ; } vector -> elements [ entry ] . freeptr = NULL ; vector -> elements [ entry ] . element = NULL ; } vector -> count = 0 ; }
Clear the entries in a vector.
Clear the entries in a vector .
// We must traverse every entry in the vector and if it has // a pointer to a free function then we call it with the // the entry pointer // // Having called any free pointers, we just reset the entry count // back to zero. //