X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmArgMgr.cxx;h=32e3765ef519e0d623c9b9ad911003b087e294fb;hb=b9ab864bfba21c5ee320d0223afac0ec115423ce;hp=6564bce4e1639cbef20976329de5250f21baf225;hpb=8c5f96ecbfa04d347b11ed4e35716f11eb0b22b7;p=gdcm.git diff --git a/src/gdcmArgMgr.cxx b/src/gdcmArgMgr.cxx index 6564bce4..32e3765e 100644 --- a/src/gdcmArgMgr.cxx +++ b/src/gdcmArgMgr.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmArgMgr.cxx,v $ Language: C++ - Date: $Date: 2005/07/30 18:18:44 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/12/22 14:46:06 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -117,29 +117,30 @@ ArgMgr::~ArgMgr() /** * \brief checks if a parameter exists in the command line * @param param label name - * @return false if label is not found - * true if label is not found + * @return 0 if label is not found + * else, returns the number of the spot it was found last time. */ -bool ArgMgr::ArgMgrDefined( const char *param ) +int ArgMgr::ArgMgrDefined( const char *param ) { - int i, trouve ; + int i; + bool trouve; char *temp; temp = Majuscule ( param ) ; - for ( trouve = false, i = ArgCount-1; i>0; i-- ) + for ( i = ArgCount-1; i>0; i-- ) { - trouve = ! strcmp( ArgLab[i], temp ) ; + trouve = ( strcmp( ArgLab[i], temp )==0 ) ; if ( trouve ) { ArgUsed[i] = true ; for ( int j=1; j0 ) { @@ -476,9 +483,12 @@ float *ArgMgr::ArgMgrGetListOfFloat ( const char *label, int *number ) taille= *number; liste = (float *) calloc (1,sizeof(float)*taille ); if ( !liste ) + { + *number = 0; return 0; + } elem = liste; - *number = 1; + //*number = 1; while ( taille>0 ) {