]> Creatis software - gdcm.git/blobdiff - src/gdcmUtil.cxx
COMP: Fix warning
[gdcm.git] / src / gdcmUtil.cxx
index 4aa3619ff8b81e6b09e1f5ba95fcdab3efaed368..0129a6dd279352865d06c46cf36427a46cb5a063 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/27 18:14:01 $
-  Version:   $Revision: 1.171 $
+  Date:      $Date: 2005/11/03 14:04:43 $
+  Version:   $Revision: 1.174 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -110,7 +110,7 @@ std::string Util::GDCM_MAC_ADRESS = GetMACAddress();
 /**
  * \brief Provide a better 'c++' approach for sprintf
  * For example c code is:
- * char result[200]; // hope 200 is enough
+ * char result[2048]; // hope 2048 is enough
  * sprintf(result, "%04x|%04x", group , elem);
  *
  * c++ code is 
@@ -126,7 +126,7 @@ std::string Util::GDCM_MAC_ADRESS = GetMACAddress();
  */
 std::string Util::Format(const char *format, ...)
 {
-   char buffer[2048];
+   char buffer[2048]; // hope 2048 is enough
    va_list args;
    va_start(args, format);
    vsprintf(buffer, format, args);  //might be a security flaw
@@ -195,7 +195,6 @@ bool Util::IsCleanString(std::string const &s)
    //std::cout<< std::endl << s << std::endl;
    for(unsigned int i=0; i<s.size(); i++)
    {
-      //std::cout<< std::endl << i << " : " << (unsigned char)s[i] << std::endl;
       if (!isprint((unsigned char)s[i]) )
       {
          return false;
@@ -979,7 +978,7 @@ std::ostream &binary_write(std::ostream &os, const uint32_t &val)
 std::ostream &binary_write(std::ostream &os, const double &val)
 {
 #if defined(GDCM_WORDS_BIGENDIAN) || defined(GDCM_FORCE_BIGENDIAN_EMULATION)    
-   double swap;
+   double swap = val;
    
    char *beg = (char *)&swap;
    char *end = beg + 7;
@@ -1027,7 +1026,6 @@ std::ostream &binary_write(std::ostream &os, std::string const &val)
  */ 
 std::ostream &binary_write(std::ostream &os, const uint8_t *val, size_t len)
 {
-    gdcmDebugMacro( "binary_write " << len );
    // We are writting sizeof(char) thus no need to swap bytes
    return os.write(reinterpret_cast<const char*>(val), len);
 }