[Dcmlib] Pourquoi gcc/VC6 sucks

Benoit Regrain benoit.regrain at creatis.insa-lyon.fr
Thu Feb 10 11:31:49 CET 2005


C'est vrai que l'égalité entre pointeur de chaine de caractères est bien 
marrante...
Vive les passage entre char * et std::string ;-)

Benoit


----- Original Message ----- 
From: "Mathieu Malaterre" <mathieu.malaterre at kitware.com>
To: "Mailing list gdcm" <dcmlib at creatis.insa-lyon.fr>
Sent: Wednesday, February 09, 2005 10:30 PM
Subject: [Dcmlib] Pourquoi gcc/VC6 sucks


> Benoit,
>
> Ci joint la petite blague que tu nous a mis dans gdcm.
> Faut reconnaitre c'est du bien vicieux
>
> Mathieu
> Ps: comme quoi meme -Wall n'est pas assez paranoid
>


--------------------------------------------------------------------------------


> Index: gdcmDefaultDicts.cxx.in
> ===================================================================
> RCS file: /cvs/public/gdcm/src/gdcmDefaultDicts.cxx.in,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -3 -p -r1.5 -r1.6
> --- gdcmDefaultDicts.cxx.in 7 Jan 2005 12:29:17 -0000 1.5
> +++ gdcmDefaultDicts.cxx.in 20 Jan 2005 17:15:54 -0000 1.6
> @@ -3,8 +3,8 @@
>   Program:   gdcm
>   Module:    $RCSfile: gdcmDefaultDicts.cxx.in,v $
>   Language:  C++
> -  Date:      $Date: 2005/01/07 12:29:17 $
> -  Version:   $Revision: 1.5 $
> +  Date:      $Date: 2005/01/20 17:15:54 $
> +  Version:   $Revision: 1.6 $
>
>   Copyright (c) CREATIS (Centre de Recherche et d'Applications en 
> Traitement de
>   l'Image). All rights reserved. See Doc/License.txt or
> @@ -30,11 +30,11 @@ namespace gdcm
>
> typedef struct
> {
> -  uint16_t group;
> -  uint16_t element;
> -  const char *vr;
> -  const char *vm;
> -  const char *name;
> +   uint16_t group;
> +   uint16_t element;
> +   const char *vr;
> +   const char *vm;
> +   const char *name;
> } DICT_ENTRY;
>
> static DICT_ENTRY datadir[] = {
> @@ -43,14 +43,14 @@ static DICT_ENTRY datadir[] = {
>
> void FillDefaultDataDict(Dict *d)
> {
> -  unsigned int i = 0;
> -  DICT_ENTRY n = datadir[i];
> -  while( n.name != 0 )
> -    {
> -    const DictEntry e( n.group, n.element, n.vr, n.vm, n.name);
> -    d->AddNewEntry( e );
> -    n = datadir[++i];
> -    }
> +   unsigned int i = 0;
> +   DICT_ENTRY n = datadir[i];
> +   while( n.name != 0 )
> +   {
> +      const DictEntry e( n.group, n.element, n.vr, n.vm, n.name);
> +      d->AddNewEntry( e );
> +      n = datadir[++i];
> +   }
> }
>
> void FillDefaultTSDict(TSHT & ts)
> @@ -65,29 +65,44 @@ void FillDefaultVRDict(VRHT & vr)
>
> typedef struct
> {
> -  const char *type;
> -  unsigned short group;
> -  unsigned short element;
> -  const char *value;
> +   const char *type;
> +   unsigned short group;
> +   unsigned short element;
> +   const char *value;
> } ELEMENT;
>
> -static ELEMENT dataelement[] = {
> +static ELEMENT dataElement[] = {
> @DICOM_DIR_DICTIONARY@
> };
>
> void FillDefaultDIRDict(DicomDirElement *dde)
> {
> -  unsigned int i = 0;
> -  ELEMENT e = dataelement[i];
> -  Element elem;
> -  while( e.type != 0 )
> -    {
> -    elem.Group = e.group;
> -    elem.Elem  = e.element;
> -    elem.Value = e.value;
> -    dde->AddNewEntry( e.type, elem);
> -    e = dataelement[++i];
> -    }
> +   unsigned int i = 0;
> +   ELEMENT e = dataElement[i];
> +   Element elem;
> +   DicomDirType type;
> +
> +   while( e.type != 0 )
> +   {
> +      if( e.type == "metaElem" )
> +         type = DD_META;
> +      else if( e.type == "patientElem" )
> +         type = DD_PATIENT;
> +      else if( e.type == "studyElem" )
> +         type = DD_STUDY;
> +      else if( e.type == "serieElem" )
> +         type = DD_SERIE;
> +      else if( e.type == "imageElem" )
> +         type = DD_IMAGE;
> +      else
> +         type = DD_UNKNOWN;
> +
> +      elem.Group = e.group;
> +      elem.Elem  = e.element;
> +      elem.Value = e.value;
> +      dde->AddNewEntry( type, elem);
> +      e = dataElement[++i];
> +   }
> }
>
> } //end gdcm namespace
>


--------------------------------------------------------------------------------


> _______________________________________________
> Dcmlib mailing list
> Dcmlib at creatis.insa-lyon.fr
> http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
> 




More information about the Dcmlib mailing list