Changeset 14787

Show
Ignore:
Timestamp:
06/29/08 17:46:15 (5 months ago)
Author:
rouault
Message:

Change CPLHashSetFind signature and rename it to CPLHashSetLookup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/ogr/ogrsf_frmts/xplane/ogr_xplane_awy_reader.cpp

    r14021 r14787  
    355355    poFeature->SetField( 0, pszIntersectionName ); 
    356356 
    357     if (CPLHashSetFind(poSet, poFeature) == FALSE
     357    if (CPLHashSetLookup(poSet, poFeature) == NULL
    358358    { 
    359359        CPLHashSetInsert(poSet, poFeature->Clone()); 
  • trunk/gdal/port/cpl_hash_set.cpp

    r14693 r14787  
    290290 
    291291/************************************************************************/ 
    292 /*                          CPLHashSetFind()                            */ 
    293 /************************************************************************/ 
    294  
    295 /** 
    296  * Returns if an element is inserted in a hash set 
     292/*                        CPLHashSetLookup()                            */ 
     293/************************************************************************/ 
     294 
     295/** 
     296 * Returns the element found in the hash set corresponding to the element to look up 
     297 * The element must not be modified. 
    297298 *  
    298299 * @param set the hash set 
    299300 * @param elt the element to look up in the hash set 
    300301 * 
    301  * @return TRUE if the element is in the hash set 
    302  */ 
    303  
    304 int CPLHashSetFind(CPLHashSet* set, const void* elt) 
     302 * @return the element found in the hash set or NULL 
     303 */ 
     304 
     305void* CPLHashSetLookup(CPLHashSet* set, const void* elt) 
    305306{ 
    306307    CPLAssert(set != NULL); 
    307308    void** pElt = CPLHashSetFindPtr(set, elt); 
    308     return pElt != NULL; 
     309    if (pElt) 
     310        return *pElt; 
     311    else 
     312        return NULL; 
    309313} 
    310314 
  • trunk/gdal/port/cpl_hash_set.h

    r14021 r14787  
    7575int          CPL_DLL CPLHashSetInsert(CPLHashSet* set, void* elt); 
    7676 
    77 int          CPL_DLL CPLHashSetFind(CPLHashSet* set, const void* elt); 
     77void         CPL_DLL * CPLHashSetLookup(CPLHashSet* set, const void* elt); 
    7878 
    7979int          CPL_DLL CPLHashSetRemove(CPLHashSet* set, const void* elt);