diff --git a/src/libs/tgf/params.cpp b/src/libs/tgf/params.cpp index 411854949..25c9d2345 100644 --- a/src/libs/tgf/params.cpp +++ b/src/libs/tgf/params.cpp @@ -2418,9 +2418,9 @@ GfParmGetEltNb (void *handle, const char *path) @ingroup paramsdata @param handle handle of parameters @param path path of section - @return 0 if doesn't exist, 1 otherwise. + @return false if doesn't exist, true otherwise. */ -int +bool GfParmExistsSection (void *handle, const char *path) { struct parmHandle *parmHandle = (struct parmHandle *)handle; @@ -2429,14 +2429,14 @@ GfParmExistsSection (void *handle, const char *path) if ((parmHandle == NULL) || (parmHandle->magic != PARM_MAGIC)) { GfLogError ("GfParmExistsSection: bad handle (%p)\n", parmHandle); - return 0; + return false; } conf = parmHandle->conf; section = (struct section *)GfHashGetStr (conf->sectionHash, path); - return section != 0 ? 1 : 0; + return section != 0; } /** Check if a parameter exists. @@ -2444,10 +2444,10 @@ GfParmExistsSection (void *handle, const char *path) @param handle handle of parameters @param path path of param @param key key name - @return 1 exists - 0 doesn't exist + @return true exists + false doesn't exist */ -int +bool GfParmExistsParam(void *handle, const char *path, const char *key) { struct parmHandle *parmHandle = (struct parmHandle *)handle; @@ -2456,7 +2456,7 @@ GfParmExistsParam(void *handle, const char *path, const char *key) if ((parmHandle == NULL) || (parmHandle->magic != PARM_MAGIC)) { GfLogError ("GfParmExistsParam: bad handle (%p)\n", parmHandle); - return 0; + return false; } conf = parmHandle->conf; @@ -2464,10 +2464,10 @@ GfParmExistsParam(void *handle, const char *path, const char *key) param = getParamByName (conf, path, key, 0); if (!param) { - return 0; + return false; } - return 1; + return true; } /** Seek the first sub-section element of a section. diff --git a/src/libs/tgf/tgf.h b/src/libs/tgf/tgf.h index 52863efa2..b7f5f37c0 100644 --- a/src/libs/tgf/tgf.h +++ b/src/libs/tgf/tgf.h @@ -494,9 +494,9 @@ TGF_API int GfParmGetNumBoundaries(void *handle, char *path, char *key, tdble *m TGF_API void GfParmRemove(void *handle, const char *path, const char *key); TGF_API int GfParmRemoveSection (void *handle, const char *path); -TGF_API int GfParmExistsSection(void *handle, const char *path); +TGF_API bool GfParmExistsSection(void *handle, const char *path); TGF_API std::vector GfParmListGetSectionNamesList(void *handle); -TGF_API int GfParmExistsParam(void *handle, const char *path, const char *key); +TGF_API bool GfParmExistsParam(void *handle, const char *path, const char *key); TGF_API int GfParmGetEltNb(void *handle, const char *path); TGF_API int GfParmListSeekFirst(void *handle, const char *path); TGF_API int GfParmListSeekNext(void *handle, const char *path);