Changeset 13834
- Timestamp:
- 02/21/08 15:59:54 (4 months ago)
- Files:
-
- spike/grib/degrib18/degrib/clock.c (modified) (2 diffs)
- spike/grib/degrib18/degrib/datasource.h (modified) (1 diff)
- spike/grib/degrib18/degrib/degrib1.cpp (modified) (8 diffs)
- spike/grib/degrib18/degrib/degrib2.cpp (modified) (3 diffs)
- spike/grib/degrib18/degrib/grib2api.c (modified) (16 diffs)
- spike/grib/degrib18/degrib/inventory.cpp (modified) (8 diffs)
- spike/grib/degrib18/degrib/memorydatasource.cpp (modified) (2 diffs)
- spike/grib/degrib18/degrib/metaparse.cpp (modified) (4 diffs)
- spike/grib/degrib18/degrib/metaprint.cpp (modified) (10 diffs)
- spike/grib/degrib18/degrib/myutil.c (modified) (2 diffs)
- spike/grib/degrib18/degrib/tdlpack.cpp (modified) (6 diffs)
- spike/grib/degrib18/g2clib-1.0.4/g2_addfield.c (modified) (2 diffs)
- spike/grib/degrib18/g2clib-1.0.4/g2_addgrid.c (modified) (1 diff)
- spike/grib/degrib18/g2clib-1.0.4/g2_addlocal.c (modified) (2 diffs)
- spike/grib/degrib18/g2clib-1.0.4/g2_getfld.c (modified) (2 diffs)
- spike/grib/degrib18/g2clib-1.0.4/g2_gribend.c (modified) (1 diff)
- spike/grib/degrib18/g2clib-1.0.4/g2_info.c (modified) (1 diff)
- spike/grib/degrib18/g2clib-1.0.4/jpcunpack.c (modified) (1 diff)
- spike/grib/gribdataset.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spike/grib/degrib18/degrib/clock.c
r10748 r13834 518 518 return; 519 519 case 'Y': 520 sprintf (buffer, "%04 ld", year);520 sprintf (buffer, "%04d", year); 521 521 return; 522 522 case 'H': … … 1861 1861 Clock_PrintDate (clock, &year, &month, &day, &hour, &min, &d_sec); 1862 1862 sec = (int) d_sec; 1863 sprintf (buffer, "%04 ld%02d%02d%02d%02d%02d", year, month, day, hour, min,1863 sprintf (buffer, "%04d%02d%02d%02d%02d%02d", year, month, day, hour, min, 1864 1864 sec); 1865 1865 } spike/grib/degrib18/degrib/datasource.h
r10749 r13834 7 7 { 8 8 public: 9 virtual ~DataSource() {} 9 10 virtual size_t DataSourceFread(void* lpBuf, size_t size, size_t count) = 0; 10 11 virtual int DataSourceFgetc() = 0; spike/grib/degrib18/degrib/degrib1.cpp
r12078 r13834 588 588 if ((sectLen < 100) && (sectLen != 86)) { 589 589 printf ("Warning! Problems with Ensemble Clustering section\n"); 590 printf ("Section length == % ld\n", sectLen);590 printf ("Section length == %d\n", sectLen); 591 591 return 0; 592 592 } … … 625 625 pds += 12; 626 626 i_temp = GRIB_SIGN_INT2 (pds[3], pds[4]); 627 printf ("ID %d Class %d Type %d Stream % ld", pds[0], pds[1], pds[2],627 printf ("ID %d Class %d Type %d Stream %d", pds[0], pds[1], pds[2], 628 628 i_temp); 629 629 pds += 5; 630 630 printf (" Ver %c%c%c%c, ", pds[0], pds[1], pds[2], pds[3]); 631 631 pds += 4; 632 printf ("Octet-50 %d, Octet-51 %d SectLen % ld\n", pds[0], pds[1],632 printf ("Octet-50 %d, Octet-51 %d SectLen %d\n", pds[0], pds[1], 633 633 sectLen); 634 634 } else { … … 1288 1288 for (i = 0; i < P2; i++) { 1289 1289 memBitRead (&uli_temp, sizeof (sInt4), bds, 1, &bufLoc, &numUsed); 1290 printf ("(%d % ld) ", i, uli_temp);1290 printf ("(%d %d) ", i, uli_temp); 1291 1291 if (numUsed != 0) { 1292 1292 printf ("\n"); … … 1299 1299 secLen++; 1300 1300 } 1301 printf ("Observed Sec Len % ld\n", secLen);1301 printf ("Observed Sec Len %d\n", secLen); 1302 1302 } else { 1303 1303 /* Jump over widths and secondary bitmap */ … … 1309 1309 for (i = 0; i < P1; i++) { 1310 1310 memBitRead (&uli_temp, sizeof (sInt4), bds, numBits, &bufLoc, &numUsed); 1311 printf ("(%d % ld) (numUsed %d numBits %d)", i, uli_temp, numUsed,1312 numBits);1311 printf ("(%d %d) (numUsed %ld numBits %d)", i, uli_temp, 1312 (long) numUsed, numBits); 1313 1313 if (numUsed != 0) { 1314 1314 printf ("\n"); … … 1322 1322 } 1323 1323 1324 printf ("Observed Sec Len % ld\n", secLen);1324 printf ("Observed Sec Len %d\n", secLen); 1325 1325 printf ("N2 = %d\n", N2); 1326 1326 … … 1478 1478 if (!f_bms && (meta->gds.numPts * numBits + numUnusedBit) != 1479 1479 (sectLen - 11) * 8) { 1480 printf ("numPts * (numBits in a Group) + # of unused bits % ld != "1481 "# of available bits % ld\n",1480 printf ("numPts * (numBits in a Group) + # of unused bits %d != " 1481 "# of available bits %d\n", 1482 1482 (sInt4) (meta->gds.numPts * numBits + numUnusedBit), 1483 1483 (sInt4) ((sectLen - 11) * 8)); … … 1724 1724 /* nd5 needs to be gribLen in (sInt4) units rounded up. */ 1725 1725 #ifdef DEBUG 1726 printf ("GribLen == % ld\n", gribLen);1726 printf ("GribLen == %d\n", gribLen); 1727 1727 #endif 1728 1728 nd5 = (gribLen + 3) / 4; spike/grib/degrib18/degrib/degrib2.cpp
r10749 r13834 859 859 int version; /* Which version of GRIB is in this message. */ 860 860 sInt4 cnt; /* Used to help compact the weather table. */ 861 gdsType newGds; /* The GDS of the subgrid if needed. */862 861 int x1, y1; /* The original grid coordinates of the lower left 863 862 * corner of the subgrid. */ … … 1048 1047 /* Warning. */ 1049 1048 #ifdef DEBUG 1050 printf ("Warning: Unpack library warning code (% ld %ld)\n",1049 printf ("Warning: Unpack library warning code (%d %d)\n", 1051 1050 jer[i], jer[ndjer + i]); 1052 1051 #endif … … 1070 1069 if ((fp = fopen ("dump.is0", "wt")) != NULL) { 1071 1070 for (i = 0; i < 8; i++) { 1072 fprintf (fp, "---Section %d---\n", i);1071 fprintf (fp, "---Section %d---\n", (int) i); 1073 1072 for (j = 1; j <= IS->ns[i]; j++) { 1074 fprintf (fp, "IS%d Item %d = % ld\n", i,j, IS->is[i][j - 1]);1073 fprintf (fp, "IS%d Item %d = %d\n", (int) i, (int) j, IS->is[i][j - 1]); 1075 1074 } 1076 1075 } spike/grib/degrib18/degrib/grib2api.c
r13832 r13834 369 369 if (nd2x3 < ngrdpts) { 370 370 #ifdef DEBUG 371 printf ("nd2x3(% ld) is < ngrdpts(%ld)\n", nd2x3, ngrdpts);371 printf ("nd2x3(%d) is < ngrdpts(%d)\n", nd2x3, ngrdpts); 372 372 #endif 373 373 return 1; … … 392 392 if (nx * ny != ngrdpts) { 393 393 #ifdef DEBUG 394 printf ("nx * ny (% ld) != ngrdpts(%ld)\n", nx * ny, ngrdpts);394 printf ("nx * ny (%d) != ngrdpts(%d)\n", nx * ny, ngrdpts); 395 395 #endif 396 396 return 2; … … 474 474 if (nd2x3 < ngrdpts) { 475 475 #ifdef DEBUG 476 printf ("nd2x3(% ld) is < ngrdpts(%ld)\n", nd2x3, ngrdpts);476 printf ("nd2x3(%d) is < ngrdpts(%d)\n", nd2x3, ngrdpts); 477 477 #endif 478 478 return 1; … … 497 497 if (nx * ny != ngrdpts) { 498 498 #ifdef DEBUG 499 printf ("nx * ny (% ld) != ngrdpts(%ld)\n", nx * ny, ngrdpts);499 printf ("nx * ny (%d) != ngrdpts(%d)\n", nx * ny, ngrdpts); 500 500 #endif 501 501 return 2; … … 1191 1191 ***************************************************************************** 1192 1192 */ 1193 #ifdef notdef 1193 1194 static int validate (char *filename, float * ain, sInt4 * iain, 1194 1195 sInt4 * nd2x3, sInt4 * idat, sInt4 * nidat, … … 1211 1212 } 1212 1213 for (i = 0; i < *ns0; i++) { 1213 fprintf (fp, "Sect 0 : %d of % ld : %ld\n", i, *ns0, is0[i]);1214 fprintf (fp, "Sect 0 : %d of %d : %d\n", i, *ns0, is0[i]); 1214 1215 } 1215 1216 for (i = 0; i < *ns1; i++) { 1216 fprintf (fp, "Sect 1 : %d of % ld : %ld\n", i, *ns1, is1[i]);1217 fprintf (fp, "Sect 1 : %d of %d : %d\n", i, *ns1, is1[i]); 1217 1218 } 1218 1219 for (i = 0; i < *ns2; i++) { 1219 fprintf (fp, "Sect 2 : %d of % ld : %ld\n", i, *ns2, is2[i]);1220 fprintf (fp, "Sect 2 : %d of %d : %d\n", i, *ns2, is2[i]); 1220 1221 } 1221 1222 for (i = 0; i < idat[0]; i++) { 1222 fprintf (fp, "idat : %d of % ld : %ld\n", i, idat[0], idat[i]);1223 fprintf (fp, "idat : %d of %d : %d\n", i, idat[0], idat[i]); 1223 1224 } 1224 1225 for (i = 0; i < rdat[0]; i++) { … … 1226 1227 } 1227 1228 for (i = 0; i < *ns3; i++) { 1228 fprintf (fp, "Sect 3 : %d of % ld : %ld\n", i, *ns3, is3[i]);1229 fprintf (fp, "Sect 3 : %d of %d : %d\n", i, *ns3, is3[i]); 1229 1230 } 1230 1231 for (i = 0; i < *ns4; i++) { 1231 fprintf (fp, "Sect 4 : %d of % ld : %ld\n", i, *ns4, is4[i]);1232 fprintf (fp, "Sect 4 : %d of %d : %d\n", i, *ns4, is4[i]); 1232 1233 } 1233 1234 for (i = 0; i < *ns5; i++) { 1234 fprintf (fp, "Sect 5 : %d of % ld : %ld\n", i, *ns5, is5[i]);1235 fprintf (fp, "Sect 5 : %d of %d : %d\n", i, *ns5, is5[i]); 1235 1236 } 1236 1237 for (i = 0; i < *ns6; i++) { 1237 fprintf (fp, "Sect 6 : %d of % ld : %ld\n", i, *ns6, is6[i]);1238 fprintf (fp, "Sect 6 : %d of %d : %d\n", i, *ns6, is6[i]); 1238 1239 } 1239 1240 for (i = 0; i < *ns7; i++) { 1240 fprintf (fp, "Sect 7 : %d of % ld : %ld\n", i, *ns7, is7[i]);1241 fprintf (fp, "Sect 7 : %d of %d : %d\n", i, *ns7, is7[i]); 1241 1242 } 1242 1243 fprintf (fp, "Xmissp = %f\n", *xmissp); … … 1245 1246 if (is5[20] == 1) { 1246 1247 for (i = 0; i < *nd2x3; i++) { 1247 fprintf (fp, "Int Data : %d of % ld : %ld\n", i, *nd2x3, iain[i]);1248 fprintf (fp, "Int Data : %d of %d : %d\n", i, *nd2x3, iain[i]); 1248 1249 } 1249 1250 } 1250 1251 } else { 1251 1252 for (i = 0; i < *nd2x3; i++) { 1252 fprintf (fp, "Float Data : %d of % ld : %f\n", i, *nd2x3, ain[i]);1253 } 1254 } 1255 fprintf (fp, "ibitmap = % ld\n", *ibitmap);1253 fprintf (fp, "Float Data : %d of %d : %f\n", i, *nd2x3, ain[i]); 1254 } 1255 } 1256 fprintf (fp, "ibitmap = %d\n", *ibitmap); 1256 1257 if (*ibitmap) { 1257 1258 for (i = 0; i < *nd2x3; i++) { 1258 fprintf (fp, "Bitmap Data : %d of % ld : %ld\n", i, *nd2x3, ib[i]);1259 fprintf (fp, "Bitmap Data : %d of %d : %d\n", i, *nd2x3, ib[i]); 1259 1260 } 1260 1261 } 1261 1262 for (i = 0; i < *ndjer; i++) { 1262 fprintf (fp, "jer(i,1) % ld jer(i,2) %ld\n", jer[i], jer[i + *ndjer]);1263 } 1264 fprintf (fp, "kjer = % ld\n", *kjer);1265 fprintf (fp, "iendpk = % ld\n", *iendpk);1263 fprintf (fp, "jer(i,1) %d jer(i,2) %d\n", jer[i], jer[i + *ndjer]); 1264 } 1265 fprintf (fp, "kjer = %d\n", *kjer); 1266 fprintf (fp, "iendpk = %d\n", *iendpk); 1266 1267 fclose (fp); 1267 1268 return 0; 1268 1269 } 1270 #endif /* def notdef */ 1269 1271 1270 1272 /***************************************************************************** … … 1314 1316 ***************************************************************************** 1315 1317 */ 1318 /* 1316 1319 static void clear (float * ain, sInt4 * iain, sInt4 * nd2x3, sInt4 * idat, 1317 1320 sInt4 * nidat, float * rdat, sInt4 * nrdat, sInt4 * is0, … … 1345 1348 *kjer = 0; 1346 1349 } 1350 */ 1347 1351 1348 1352 /***************************************************************************** … … 1505 1509 default: 1506 1510 #ifdef DEBUG 1507 printf ("Invalid section id % ld.\n", sectId);1511 printf ("Invalid section id %d.\n", sectId); 1508 1512 #endif 1509 1513 return 2; … … 1627 1631 sInt4 drsTmpl; 1628 1632 sInt4 numGrps; 1629 sInt4 *jmin; 1630 sInt4 *lbit; 1631 sInt4 *nov; 1632 sInt4 *iwork; 1633 char f_useMDL = 0; /* Instructed 3/8/2005 10:30 to not use MDL. */ 1633 char f_useMDL = 0; /* Instructed 3/8/2005 10:30 to not use MDL. */ 1634 1634 uChar f_noBitmap; /* 0 if bitmap, else no bitmap. */ 1635 1635 sInt4 orderDiff; 1636 1637 #ifdef DEBUG1638 f_useMDL = 0; /* Experiment with smoke data 12/16/2005 */1639 #endif1640 1636 1641 1637 if (FindTemplateIDs (ipack, *nd5, 0, &gdsTmpl, &pdsTmpl, &drsTmpl, … … 1645 1641 *kjer = 1; 1646 1642 } 1647 #ifdef DEBUG1648 printf ("gdsTemplate number = %ld\n", gdsTmpl);1649 printf ("pdsTemplate number = %ld\n", pdsTmpl);1650 printf ("drsTemplate number = %ld\n", drsTmpl);1651 printf ("f_noBitmap = %d\n", f_noBitmap);1652 #endif1653 1643 if ((gdsTmpl != 0) && (gdsTmpl != 10) && (gdsTmpl != 20) && 1654 1644 (gdsTmpl != 30) && (gdsTmpl != 90) && (gdsTmpl != 110) && … … 1661 1651 f_useMDL = 0; 1662 1652 } 1663 #ifdef DEBUG1664 printf ("UseMDL? 1=yes 0=no : ans %d\n", f_useMDL);1665 #endif1666 1653 if ((drsTmpl != 0) && (drsTmpl != 2) && (drsTmpl != 3)) { 1667 1654 f_useMDL = 0; 1668 1655 } 1669 #ifdef DEBUG1670 printf ("UseMDL? 1=yes 0=no : ans %d\n", f_useMDL);1671 #endif1672 1656 /* MDL GRIB2 lib does not support drsTmpl 2 or 3 if there is a bitmap. */ 1673 1657 if ((!f_noBitmap) && ((drsTmpl == 2) || (drsTmpl == 3))) { 1674 1658 f_useMDL = 0; 1675 1659 } 1676 #ifdef DEBUG1677 printf ("UseMDL? 1=yes 0=no : ans %d\n", f_useMDL);1678 #endif1679 1660 /* MDL GRIB2 lib does not support anything but second order differencing. */ 1680 1661 if ((drsTmpl == 3) && (orderDiff != 2) && (orderDiff != 0)) { 1681 1662 f_useMDL = 0; 1682 1663 } 1683 #ifdef DEBUG1684 printf ("orderDiff = %d, drsTmpl = %d\n", orderDiff, drsTmpl),1685 printf ("UseMDL? 1=yes 0=no : ans %d\n", f_useMDL);1686 #endif1687 1664 1688 1665 #ifdef _FORTRAN … … 2035 2012 sInt4 *newboxp; 2036 2013 sInt4 *ia; 2037 unsigned char *c_ipack;2038 2014 /* float *a;*/ 2039 2015 char f_useMDL = 1; … … 2137 2113 2138 2114 printf ("Unable to use MDL Pack library?\n"); 2139 printf ("gdsTmpl : % ld , pdsTmpl %ld : drsTmpl %ld\n", gdsTmpl,2115 printf ("gdsTmpl : %d , pdsTmpl %d : drsTmpl %d\n", gdsTmpl, 2140 2116 pdsTmpl, drsTmpl); 2141 2117 jer[0 + *ndjer] = 31415926; spike/grib/degrib18/degrib/inventory.cpp
r12066 r13834 124 124 delta = myRound (delta, 2); 125 125 if (Inv[i].comment == NULL) { 126 printf ("%d.%d, % ld, %d, %s, %s, %s, %s, %.2f\n",126 printf ("%d.%d, %d, %d, %s, %s, %s, %s, %.2f\n", 127 127 Inv[i].msgNum, Inv[i].subgNum, Inv[i].start, 128 128 Inv[i].GribVersion, Inv[i].element, Inv[i].shortFstLevel, … … 130 130 fflush (stdout); 131 131 } else { 132 printf ("%d.%d, % ld, %d, %s=\"%s\", %s, %s, %s, %.2f\n",132 printf ("%d.%d, %d, %d, %s=\"%s\", %s, %s, %s, %.2f\n", 133 133 Inv[i].msgNum, Inv[i].subgNum, Inv[i].start, 134 134 Inv[i].GribVersion, Inv[i].element, Inv[i].comment, … … 627 627 /* Try to convert lenTime to hourly. */ 628 628 if (timeRangeUnit == 0) { 629 lenTime = lenTime / 60.;629 lenTime = (sInt4) (lenTime / 60.); 630 630 timeRangeUnit = 1; 631 631 } else if (timeRangeUnit == 1) { … … 643 643 timeRangeUnit = 1; 644 644 } else if (timeRangeUnit == 13) { 645 lenTime = lenTime / 3600.;645 lenTime = (sInt4) (lenTime / 3600.); 646 646 timeRangeUnit = 1; 647 647 } else { … … 895 895 /* Handle case where there are trailing bytes. */ 896 896 msg = errSprintf (NULL); 897 printf ("Warning: Inside GRIB2Inventory, Message # % ld\n",897 printf ("Warning: Inside GRIB2Inventory, Message # %d\n", 898 898 msgNum); 899 899 printf ("%s", msg); … … 903 903 fileLen = fp.DataSourceFtell(); 904 904 /* fseek (fp, 0L, SEEK_SET); */ 905 printf ("There were % ld trailing bytes in the file.\n",905 printf ("There were %d trailing bytes in the file.\n", 906 906 fileLen - offset); 907 907 free (buffer); … … 1128 1128 /* Handle case where there are trailing bytes. */ 1129 1129 msg = errSprintf (NULL); 1130 printf ("Warning: Inside GRIB2RefTime, Message # % ld\n", msgNum);1130 printf ("Warning: Inside GRIB2RefTime, Message # %d\n", msgNum); 1131 1131 printf ("%s", msg); 1132 1132 free (msg); … … 1135 1135 fileLen = fp.DataSourceFtell(); 1136 1136 /* fseek (fp, 0L, SEEK_SET); */ 1137 printf ("There were % ld trailing bytes in the file.\n",1137 printf ("There were %d trailing bytes in the file.\n", 1138 1138 fileLen - offset); 1139 1139 free (buffer); spike/grib/degrib18/degrib/memorydatasource.cpp
r10749 r13834 4 4 MemoryDataSource::MemoryDataSource(unsigned char * block, long length) 5 5 : seekPos(0) 6 , memoryBlock(block)7 6 , blockLength(length) 8 7 , eof(false) 8 , memoryBlock(block) 9 9 { 10 10 } … … 16 16 size_t MemoryDataSource::DataSourceFread(void* lpBuf, size_t size, size_t count) 17 17 { 18 if (seekPos + size * count >blockLength)18 if (seekPos + size * count > (size_t) blockLength) 19 19 { 20 20 count = (blockLength - seekPos) / size; spike/grib/degrib18/degrib/metaparse.cpp
r12066 r13834 1150 1150 if (is4[4] != 4) { 1151 1151 #ifdef DEBUG 1152 printf ("ERROR IS4 not labeled correctly. % ld\n", is4[4]);1152 printf ("ERROR IS4 not labeled correctly. %d\n", is4[4]); 1153 1153 #endif 1154 errSprintf ("ERROR IS4 not labeled correctly. % ld\n", is4[4]);1154 errSprintf ("ERROR IS4 not labeled correctly. %d\n", is4[4]); 1155 1155 return -2; 1156 1156 } … … 1170 1170 (is4[7] != GS4_SATELLITE) && (is4[7] != GS4_DERIVED_INTERVAL)) { 1171 1171 #ifdef DEBUG 1172 printf ("Un-supported Template. % ld\n", is4[7]);1172 printf ("Un-supported Template. %d\n", is4[7]); 1173 1173 #endif 1174 errSprintf ("Un-supported Template. % ld\n", is4[7]);1174 errSprintf ("Un-supported Template. %d\n", is4[7]); 1175 1175 return -4; 1176 1176 } … … 1790 1790 meta->pds2.refTime) / 3600); 1791 1791 } else if (meta->pds2.sect4.Interval[0].timeRangeUnit == 0) { 1792 lenTime = meta->pds2.sect4.Interval[0].lenTime / 60.;1792 lenTime = (sInt4) (meta->pds2.sect4.Interval[0].lenTime / 60.); 1793 1793 } else if (meta->pds2.sect4.Interval[0].timeRangeUnit == 1) { 1794 1794 lenTime = meta->pds2.sect4.Interval[0].lenTime; … … 1802 1802 lenTime = meta->pds2.sect4.Interval[0].lenTime * 12; 1803 1803 } else if (meta->pds2.sect4.Interval[0].timeRangeUnit == 13) { 1804 lenTime = meta->pds2.sect4.Interval[0].lenTime / 3600.;1804 lenTime = (sInt4) (meta->pds2.sect4.Interval[0].lenTime / 3600.); 1805 1805 } else { 1806 1806 lenTime = 0; spike/grib/degrib18/degrib/metaprint.cpp
r10748 r13834 306 306 for (i = 0; i < sect2->wx.dataLen; i++) { 307 307 if (sect2->wx.ugly[i].validIndex != -1) { 308 sprintf (buffer, "Elem %3d Is Used",i);308 sprintf (buffer, "Elem %3d Is Used", (int) i); 309 309 } else { 310 sprintf (buffer, "Elem %3d NOT Used",i);310 sprintf (buffer, "Elem %3d NOT Used", (int) i); 311 311 } 312 312 Print ("PDS-S2", buffer, Prt_S, sect2->wx.data[i]); … … 317 317 sect2->unknown.dataLen); 318 318 for (i = 0; i < sect2->unknown.dataLen; i++) { 319 sprintf (buffer, "Element %d",i);319 sprintf (buffer, "Element %d", (int) i); 320 320 Print ("PDS-S2", buffer, Prt_F, sect2->unknown.data[i]); 321 321 } … … 701 701 sect4->Interval[i].incrType)); 702 702 /* Following is so we get "# str" not "# (str)" */ 703 sprintf (buffer, "% ld %s", sect4->Interval[i].lenTime,703 sprintf (buffer, "%d %s", sect4->Interval[i].lenTime, 704 704 Lookup (tbl44, sizeof (tbl44), 705 705 sect4->Interval[i].timeRangeUnit)); 706 706 Print ("PDS-S4", "Time range for processing", Prt_S, buffer); 707 707 /* Following is so we get "# str" not "# (str)" */ 708 sprintf (buffer, "% ld %s", sect4->Interval[i].timeIncr,708 sprintf (buffer, "%d %s", sect4->Interval[i].timeIncr, 709 709 Lookup (tbl44, sizeof (tbl44), 710 710 sect4->Interval[i].incrUnit)); … … 742 742 sect4->Interval[i].incrType)); 743 743 /* Following is so we get "# str" not "# (str)" */ 744 sprintf (buffer, "% ld %s", sect4->Interval[i].lenTime,744 sprintf (buffer, "%d %s", sect4->Interval[i].lenTime, 745 745 Lookup (tbl44, sizeof (tbl44), 746 746 sect4->Interval[i].timeRangeUnit)); 747 747 Print ("PDS-S4", "Time range for processing", Prt_S, buffer); 748 748 /* Following is so we get "# str" not "# (str)" */ 749 sprintf (buffer, "% ld %s", sect4->Interval[i].timeIncr,749 sprintf (buffer, "%d %s", sect4->Interval[i].timeIncr, 750 750 Lookup (tbl44, sizeof (tbl44), 751 751 sect4->Interval[i].incrUnit)); … … 760 760 Print ("PDS-S4", "Probability type", Prt_DS, sect4->probType, 761 761 Lookup (tbl49, sizeof (tbl49), sect4->probType)); 762 sprintf (buffer, "% ld, %d", sect4->lowerLimit.value,762 sprintf (buffer, "%d, %d", sect4->lowerLimit.value, 763 763 sect4->lowerLimit.factor); 764 764 Print ("PDS-S4", "Lower limit (scale value, scale factor)", Prt_GS, 765 765 sect4->lowerLimit.value * 766 766 pow (10, -1 * sect4->lowerLimit.factor), buffer); 767 sprintf (buffer, "% ld, %d", sect4->upperLimit.value,767 sprintf (buffer, "%d, %d", sect4->upperLimit.value, 768 768 sect4->upperLimit.factor); 769 769 Print ("PDS-S4", "Upper limit (scale value, scale factor)", Prt_GS, … … 795 795 sect4->Interval[i].incrType)); 796 796 /* Following is so we get "# str" not "# (str)" */ 797 sprintf (buffer, "% ld %s", sect4->Interval[i].lenTime,797 sprintf (buffer, "%d %s", sect4->Interval[i].lenTime, 798 798 Lookup (tbl44, sizeof (tbl44), 799 799 sect4->Interval[i].timeRangeUnit)); 800 800 Print ("PDS-S4", "Time range for processing", Prt_S, buffer); 801 801 /* Following is so we get "# str" not "# (str)" */ 802 sprintf (buffer, "% ld %s", sect4->Interval[i].timeIncr,802 sprintf (buffer, "%d %s", sect4->Interval[i].timeIncr, 803 803 Lookup (tbl44, sizeof (tbl44), 804 804 sect4->Interval[i].incrUnit)); … … 813 813 Print ("PDS-S4", "Probability type", Prt_DS, sect4->probType, 814 814 Lookup (tbl49, sizeof (tbl49), sect4->probType)); 815 sprintf (buffer, "% ld, %d", sect4->lowerLimit.value,815 sprintf (buffer, "%d, %d", sect4->lowerLimit.value, 816 816 sect4->lowerLimit.factor); 817 817 Print ("PDS-S4", "Lower limit (scale value, scale factor)", Prt_GS, 818 818 sect4->lowerLimit.value * 819 819 pow (10, -1 * sect4->lowerLimit.factor), buffer); 820 sprintf (buffer, "% ld, %d", sect4->upperLimit.value,820 sprintf (buffer, "%d, %d", sect4->upperLimit.value, 821 821 sect4->upperLimit.factor); 822 822 Print ("PDS-S4", "Upper limit (scale value, scale factor)", Prt_GS, … … 846 846 sect4->Interval[i].incrType)); 847 847 /* Following is so we get "# str" not "# (str)" */ 848 sprintf (buffer, "% ld %s", sect4->Interval[i].lenTime,848 sprintf (buffer, "%d %s", sect4->Interval[i].lenTime, 849 849 Lookup (tbl44, sizeof (tbl44), 850 850 sect4->Interval[i].timeRangeUnit)); 851 851 Print ("PDS-S4", "Time range for processing", Prt_S, buffer); 852 852 /* Following is so we get "# str" not "# (str)" */ 853 sprintf (buffer, "% ld %s", sect4->Interval[i].timeIncr,853 sprintf (buffer, "%d %s", sect4->Interval[i].timeIncr, 854 854 Lookup (tbl44, sizeof (tbl44), 855 855 sect4->Interval[i].incrUnit)); … … 860 860 /* This case should have been handled in first switch statement of 861 861 * this procedure, but just in case... */ 862 errSprintf ("Un-supported Sect4 template % ld\n", sect4->templat);862 errSprintf ("Un-supported Sect4 template %d\n", sect4->templat); 863 863 return -2; 864 864 } … … 1151 1151 default: 1152 1152 Print ("GDS", "Projection Type", Prt_D, gds->projType); 1153 errSprintf ("Un-supported Map Projection % ld\n", gds->projType);1153 errSprintf ("Un-supported Map Projection %d\n", gds->projType); 1154 1154 return -1; 1155 1155 } spike/grib/degrib18/degrib/myutil.c
r10749 r13834 407 407 } 408 408 409 /** 409 410 static int FileMatch (const char *filename, const char *filter) 410 411 { … … 437 438 return (*ptr2 == '\0'); 438 439 } 440 **/ 439 441 440 442 int myGlob (const char *dirName, const char *filter, size_t *Argc, spike/grib/degrib18/degrib/tdlpack.cpp
r12066 r13834 236 236 if (tau != project_hr) { 237 237 printf ("Warning: Inconsistant Projections in hours in " 238 "ReadTDLPSect1 (% ld vs %d)\n", tau, project_hr);238 "ReadTDLPSect1 (%d vs %d)\n", tau, project_hr); 239 239 /* 240 240 errSprintf ("Warning: Inconsistant Projections in hours in " … … 339 339 Print ("PDS-TDLP", "Reference Time", Prt_S, buffer); 340 340 Print ("PDS-TDLP", "Plain Language", Prt_S, pds->Descriptor); 341 sprintf (buffer, "%09 ld", pds->ID1);341 sprintf (buffer, "%09d", pds->ID1); 342 342 Print ("PDS-TDLP", "ID 1", Prt_S, buffer); 343 sprintf (buffer, "%09 ld", pds->ID2);343 sprintf (buffer, "%09d", pds->ID2); 344 344 Print ("PDS-TDLP", "ID 2", Prt_S, buffer); 345 sprintf (buffer, "%09 ld", pds->ID3);345 sprintf (buffer, "%09d", pds->ID3); 346 346 Print ("PDS-TDLP", "ID 3", Prt_S, buffer); 347 347 Print ("PDS-TDLP", "ID 4", Prt_D, pds->ID4); … … 1066 1066 printf ("nbit %d, ibit %d, jbit %d, kbit %d\n", nbit, ibit, jbit, kbit); 1067 1067 if ((t_numBytes + ceil (t_numBits / 8.)) != sectLen) { 1068 printf ("Caution: # bytes in groups % ld (%ld + %ld / 8) != "1069 "sectLen % ld\n", (sInt4) (t_numBytes + ceil (t_numBits / 8.)),1068 printf ("Caution: # bytes in groups %d (%d + %d / 8) != " 1069 "sectLen %d\n", (sInt4) (t_numBytes + ceil (t_numBits / 8.)), 1070 1070 t_numBytes, t_numBits, sectLen); 1071 1071 } … … 1175 1175 #ifdef DEBUG 1176 1176 printf ("This doesn't happen often.\n"); 1177 printf ("%d %d % ld\n",i, grp[i].bit, grp[i].min);1177 printf ("%d %d %d\n", (int) i, grp[i].bit, grp[i].min); 1178 1178 #endif 1179 1179 myAssert (1 == 2); … … 1374 1374 #ifdef DEBUG 1375 1375 printf ("This doesn't happen often.\n"); 1376 printf ("%d %d % ld\n",i, grp[i].bit, grp[i].min);1376 printf ("%d %d %d\n", (int) i, grp[i].bit, grp[i].min); 1377 1377 myAssert (1 == 2); 1378 1378 #endif … … 4382 4382 /* Sanity check ! */ 4383 4383 if (li_temp != DataLen) { 4384 printf ("Total packed in groups % ld != DataLen %ld\n", li_temp,4384 printf ("Total packed in groups %d != DataLen %d\n", li_temp, 4385 4385 DataLen); 4386 4386 } spike/grib/degrib18/g2clib-1.0.4/g2_addfield.c
r13666 r13834 190 190 if ( len > lencurr ) { 191 191 printf("g2_addfield: Section byte counts don''t add to total.\n"); 192 printf("g2_addfield: Sum of section byte counts = % ld\n",len);193 printf("g2_addfield: Total byte count in Section 0 = % ld\n",lencurr);192 printf("g2_addfield: Sum of section byte counts = %d\n",len); 193 printf("g2_addfield: Total byte count in Section 0 = %d\n",lencurr); 194 194 ierr=-3; 195 195 return(ierr); … … 392 392 #endif /* USE_PNG */ 393 393 else { 394 printf("g2_addfield: Data Representation Template 5.% ld not yet implemented.\n",idrsnum);394 printf("g2_addfield: Data Representation Template 5.%d not yet implemented.\n",idrsnum); 395 395 ierr=-7; 396 396 return(ierr); spike/grib/degrib18/g2clib-1.0.4/g2_addgrid.c
r13666 r13834 125 125 if ( len > lencurr ) { 126 126 printf("g2_addgrid: Section byte counts don''t add to total.\n"); 127 printf("g2_addgrid: Sum of section byte counts = % ld\n",len);128 printf("g2_addgrid: Total byte count in Section 0 = % ld\n",lencurr);127 printf("g2_addgrid: Sum of section byte counts = %d\n",len); 128 printf("g2_addgrid: Total byte count in Section 0 = %d\n",lencurr); 129 129 ierr=-3; 130 130 return(ierr); spike/grib/degrib18/g2clib-1.0.4/g2_addlocal.c
r10748 r13834 103 103 if ( len > lencurr ) { 104 104 printf("g2_addlocal: Section byte counts don't add to total.\n"); 105 printf("g2_addlocal: Sum of section byte counts = % ld\n",len);106 printf("g2_addlocal: Total byte count in Section 0 = % ld\n",lencurr);105 printf("g2_addlocal: Sum of section byte counts = %d\n",len); 106 printf("g2_addlocal: Total byte count in Section 0 = %d\n",lencurr); 107 107 ierr=-3; 108 108 return(ierr); … … 114 114 if ( (isecnum!=1) && (isecnum!=7) ) { 115 115 printf("g2_addlocal: Section 2 can only be added after Section 1 or Section 7.\n"); 116 printf("g2_addlocal: Section % ld was the last found in given GRIB message.\n",isecnum);116 printf("g2_addlocal: Section %d was the last found in given GRIB message.\n",isecnum); 117 117 ierr=-4; 118 118 return(ierr); spike/grib/degrib18/g2clib-1.0.4/g2_getfld.c
r10748 r13834 350 350 // 351 351 if ( isecnum<1 || isecnum>7 ) { 352 printf("g2_getfld: Unrecognized Section Encountered=% ld\n",isecnum);352 printf("g2_getfld: Unrecognized Section Encountered=%d\n",isecnum); 353 353 ierr=8; 354 354 return(ierr); … … 542 542 // before the requested field was found. 543 543 // 544 printf("g2_getfld: GRIB message contained % ld different fields.\n",numfld);545 printf("g2_getfld: The request was for field % ld.\n",ifldnum);544 printf("g2_getfld: GRIB message contained %d different fields.\n",numfld); 545 printf("g2_getfld: The request was for field %d.\n",ifldnum); 546 546 ierr=6; 547 547 spike/grib/degrib18/g2clib-1.0.4/g2_gribend.c
r10748 r13834 98 98 if ( isecnum != 7 ) { 99 99 printf("g2_gribend: Section 8 can only be added after Section 7.\n"); 100 printf("g2_gribend: Section % ld was the last found in given GRIB message.\n",isecnum);100 printf("g2_gribend: Section %d was the last found in given GRIB message.\n",isecnum); 101 101 ierr=-4; 102 102 return (ierr); spike/grib/degrib18/g2clib-1.0.4/g2_info.c
r10748 r13834 179 179 } 180 180 else { 181 printf("g2_info: Invalid section number found in GRIB message: % ld\n" ,isecnum);181 printf("g2_info: Invalid section number found in GRIB message: %d\n" ,isecnum); 182 182 ierr=6; 183 183 return(ierr); spike/grib/degrib18/g2clib-1.0.4/jpcunpack.c
r12077 r13834 59 59 return(1); 60 60 } 61 iret=(g2int)dec_jpeg2000( cpack,len,ifld);61 iret=(g2int)dec_jpeg2000((char *) cpack,len,ifld); 62 62 for (j=0;j<ndpts;j++) { 63 63 fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale; spike/grib/gribdataset.cpp
r13830 r13834 208 208 209 209 char * errMsg = errSprintf(NULL); // no intention to show errors, just swallow it and free the memory 210 CPLDebug( "GRIB", "%s", errMsg ); 210 if( errMsg != NULL ) 211 CPLDebug( "GRIB", "%s", errMsg ); 211 212 free(errMsg); 212 213 IS_Free(&is); … … 302 303 free (buff); 303 304 char * errMsg = errSprintf(NULL); 304 CPLDebug( "GRIB", "%s", errMsg ); 305 if( errMsg != NULL ) 306 CPLDebug( "GRIB", "%s", errMsg ); 305 307 free(errMsg); 306 308 return NULL;
