r145: *** empty log message ***
[ctsim.git] / libctsim / array2dfile.cpp
index 0ed6354454b0a2386cbd9142fd9e64a6834c3968..ed04a7c04f3ee149dc6a7266a885eaa4b96be7c7 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: array2dfile.cpp,v 1.5 2000/07/09 08:16:17 kevin Exp $
+**  $Id: array2dfile.cpp,v 1.6 2000/07/13 07:03:21 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -107,7 +107,7 @@ const string&
 Array2dFileLabel::getDateString (void) const
 {
   ostringstream oss;
-  oss <<  m_month + 1 <<"/"<< m_day <<"/"<< m_year + 1900 << " " << m_hour <<":"<<  m_minute <<":"<< m_second;
+  oss <<  static_cast<int>(m_month + 1) <<"/"<< static_cast<int>(m_day) <<"/"<< static_cast<int>(m_year + 1900) << " " << static_cast<int>(m_hour) <<":"<<  static_cast<int>(m_minute) <<":"<< static_cast<int>(m_second);
   m_strDate = oss.str();
   return m_strDate;
 }
@@ -225,7 +225,7 @@ Array2dFile::allocArray (void)
     m_arrayData = new unsigned char* [m_nx];
     
     int columnBytes = m_ny * m_pixelSize;
-    for (int i = 0; i < m_nx; i++)
+    for (unsigned int i = 0; i < m_nx; i++)
        m_arrayData[i] = new unsigned char [columnBytes];
 }
 
@@ -233,7 +233,7 @@ void
 Array2dFile::freeArray (void)
 {
     if (m_arrayData) {
-       for (int i = 0; i < m_nx; i++)
+       for (unsigned int i = 0; i < m_nx; i++)
            delete m_arrayData[i];
        delete m_arrayData;
        m_arrayData = NULL;
@@ -439,7 +439,7 @@ Array2dFile::arrayDataRead (frnetorderstream& fs)
 
   fs.seekg (m_headersize);
   int columnSize = m_ny * m_pixelSize;
-  for (int ix = 0; ix < m_nx; ix++) {
+  for (unsigned int ix = 0; ix < m_nx; ix++) {
       unsigned char* ptrColumn = m_arrayData[ix];
       if (NativeBigEndian()) {
          for (unsigned int iy = 0; iy < m_ny; iy++) {
@@ -551,7 +551,7 @@ void
 Array2dFile::labelsCopy (Array2dFile& copyFile, const char* const idStr)
 {
     string id = idStr;
-    for (int i = 0; i < copyFile.getNumLabels(); i++) {
+    for (unsigned int i = 0; i < copyFile.getNumLabels(); i++) {
       Array2dFileLabel l (copyFile.labelGet (i));
       string lstr = l.getLabelString();
       lstr = idStr + lstr;
@@ -565,7 +565,7 @@ Array2dFile::arrayDataClear (void)
 {
     if (m_arrayData) {
        int columnSize = m_ny * m_pixelSize;
-       for (int ix = 0; ix < m_nx; ix++)
+       for (unsigned int ix = 0; ix < m_nx; ix++)
            memset (m_arrayData[ix], 0, columnSize);
     }
 }
@@ -573,8 +573,6 @@ Array2dFile::arrayDataClear (void)
 void
 Array2dFile::printLabels (ostream& os) const
 {
-    int nlabels = getNumLabels();
-
     for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) {
       const Array2dFileLabel& label = **l;