X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Farray2dfile.cpp;h=ed04a7c04f3ee149dc6a7266a885eaa4b96be7c7;hp=0ed6354454b0a2386cbd9142fd9e64a6834c3968;hb=3fba6928127cd65870bdcd96c8114ad5894247ae;hpb=1fd4f7cc977b9f1499716de10d15656bd50f4816 diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index 0ed6354..ed04a7c 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -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(m_month + 1) <<"/"<< static_cast(m_day) <<"/"<< static_cast(m_year + 1900) << " " << static_cast(m_hour) <<":"<< static_cast(m_minute) <<":"<< static_cast(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;