From: <sch...@us...> - 2012-04-24 08:23:42
|
Revision: 10321 http://octave.svn.sourceforge.net/octave/?rev=10321&view=rev Author: schloegl Date: 2012-04-24 08:23:36 +0000 (Tue, 24 Apr 2012) Log Message: ----------- clean up code - get rid of some warnings Modified Paths: -------------- trunk/octave-forge/extra/NaN/src/xptopen.cpp Modified: trunk/octave-forge/extra/NaN/src/xptopen.cpp =================================================================== --- trunk/octave-forge/extra/NaN/src/xptopen.cpp 2012-04-24 07:58:12 UTC (rev 10320) +++ trunk/octave-forge/extra/NaN/src/xptopen.cpp 2012-04-24 08:23:36 UTC (rev 10321) @@ -833,7 +833,7 @@ size_t maxlen = b_endian_u16(*(int16_t*)(H2+k*sz2+4)); ListOfVarNames[k] = VarNames+pos; - unsigned int n = k*sz2+8; + size_t n = k*sz2+8; // int flagDate = (!memcmp(H2+n+48,"DATE ",8) || !memcmp(H2+n+48,"MONNAME ",8)); // not used do { VarNames[pos++] = H2[n]; @@ -936,7 +936,7 @@ mxArray **F = (mxArray**) mxMalloc(NS*sizeof(mxArray*)); char **Fstr = (char**) malloc(NS*sizeof(char*)); size_t *MAXLEN = (size_t*) malloc(NS*sizeof(size_t*)); - for (int16_t k = 0; k < NS; k++) { + for (uint16_t k = 0; k < NS; k++) { Fstr[k] = NULL; MAXLEN[k]=0; F[k] = mxGetFieldByNumber(PInputs[2],0,k); @@ -978,7 +978,7 @@ /* write OBS header line */ count += fwrite(LO, 1, strlen(LO), fid); for (mwIndex m = 0; m < M; m++) { - for (int16_t k = 0; k < NS; k++) { + for (uint16_t k = 0; k < NS; k++) { if (*(int16_t*)(H2+k*sz2) == b_endian_u16(1)) { // numeric @@ -1130,7 +1130,7 @@ // Set start of year to March by moving Jan. and Feb. to previous year. // Correct for months > 12 by moving to subsequent years. - Y += fix ((M-14.0)/12); + Y += (int)fix ((M-14.0)/12); const int monthstart[] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; // Lookup number of days since start of the current year. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |