Skip to content

Commit 85d84d3

Browse files
committed
Merge branch 'master' of github.com:gwaldron/osgearth
2 parents 6456865 + 4f1c54d commit 85d84d3

File tree

10 files changed

+29
-28
lines changed

10 files changed

+29
-28
lines changed

src/osgEarth/Decals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ DecalDecorator::setBindings(Util::ShaderPackage& package) const
311311
void
312312
DecalDecorator::dirtyUniforms()
313313
{
314-
for (int i = 0; i < _globjects.size(); ++i)
314+
for (unsigned i = 0; i < _globjects.size(); ++i)
315315
{
316316
_globjects[i].dirty = true;
317317
}

src/osgEarth/Elevation.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ NormalMapGenerator::createNormalMap(const TileKey& key, const Map* map, unsigned
279279
double dv = 1.0 / (double)(tileSize - 1);
280280

281281
// Process interior pixels only (excluding edges that need external sampling)
282-
for (int t = 1; t < tileSize - 1; ++t)
282+
for (int t = 1; t < (int)tileSize - 1; ++t)
283283
{
284284
double v = (double)t / (double)(tileSize - 1);
285285
double y_or_lat = ex.yMin() + v * ex.height();
286286

287-
for (int s = 1; s < tileSize - 1; ++s)
287+
for (int s = 1; s < (int)tileSize - 1; ++s)
288288
{
289289
double u = (double)s / (double)(tileSize - 1);
290290
double x_or_lon = ex.xMin() + u * ex.width();
@@ -330,28 +330,28 @@ NormalMapGenerator::createNormalMap(const TileKey& key, const Map* map, unsigned
330330
double r = res.getValue();
331331

332332
// bottom row
333-
for (int s = 0; s < tileSize; ++s)
333+
for (int s = 0; s < (int)tileSize; ++s)
334334
{
335335
double u = (double)s / (double)(tileSize - 1);
336336
double x = ex.xMin() + u * ex.width();
337337
w.vectorToSample.emplace_back(x, ex.yMin() - r, 0, r);
338338
}
339339
// top row
340-
for (int s = 0; s < tileSize; ++s)
340+
for (int s = 0; s < (int)tileSize; ++s)
341341
{
342342
double u = (double)s / (double)(tileSize - 1);
343343
double x = ex.xMin() + u * ex.width();
344344
w.vectorToSample.emplace_back(x, ex.yMax() + r, 0, r);
345345
}
346346
// left column
347-
for (int t = 0; t < tileSize; ++t)
347+
for (int t = 0; t < (int)tileSize; ++t)
348348
{
349349
double v = (double)t / (double)(tileSize - 1);
350350
double y = ex.yMin() + v * ex.height();
351351
w.vectorToSample.emplace_back(ex.xMin() - r, y, 0, r);
352352
}
353353
// right column
354-
for (int t = 0; t < tileSize; ++t)
354+
for (int t = 0; t < (int)tileSize; ++t)
355355
{
356356
double v = (double)t / (double)(tileSize - 1);
357357
double y = ex.yMin() + v * ex.height();
@@ -390,12 +390,12 @@ NormalMapGenerator::createNormalMap(const TileKey& key, const Map* map, unsigned
390390
double dy = srs->transformDistance(res, Units::METERS, 0.0);
391391

392392
// Process all edge pixels
393-
for (int t = 0; t < tileSize; ++t)
393+
for (int t = 0; t < (int)tileSize; ++t)
394394
{
395-
for (int s = 0; s < tileSize; ++s)
395+
for (int s = 0; s < (int)tileSize; ++s)
396396
{
397397
// Skip interior pixels - they were already processed
398-
if (t > 0 && t < tileSize - 1 && s > 0 && s < tileSize - 1)
398+
if (t > 0 && t < (int)tileSize - 1 && s > 0 && s < (int)tileSize - 1)
399399
continue;
400400

401401
double u = (double)s / (double)(tileSize - 1);

src/osgEarth/ElevationLayer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ ElevationLayer::assembleHeightField(const TileKey& key, ProgressCallback* progre
255255
auto mosaic = new osg::HeightField();
256256
mosaic->allocate(cols, rows);
257257
auto& heights = mosaic->getHeightList();
258-
for(int i=0; i<cols*rows; ++i)
258+
for(unsigned i=0; i<cols*rows; ++i)
259259
heights[i] = NO_DATA_VALUE;
260260

261261
// Working set of points. it's much faster to xform an entire vector all at once.
@@ -301,9 +301,9 @@ ElevationLayer::assembleHeightField(const TileKey& key, ProgressCallback* progre
301301
}
302302

303303
// Mosaic our sources into a single output image.
304-
for (int row = 0; row < rows; ++row)
304+
for (unsigned row = 0; row < rows; ++row)
305305
{
306-
for (int col = 0; col < cols; ++col)
306+
for (unsigned col = 0; col < cols; ++col)
307307
{
308308
int i = row * cols + col;
309309
auto& h = mosaic->getHeight(col, row);

src/osgEarth/Feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ namespace osgEarth
230230
void set(const std::string& name, const char* value);
231231
void set(const std::string& name, double value);
232232
void set(const std::string& name, std::int64_t value);
233+
void set(const std::string& name, int value) { set(name, static_cast<std::int64_t>(value)); }
233234
void set(const std::string& name, bool value);
234235
void set(const std::string& name, const AttributeValue& value);
235236

src/osgEarth/GDAL.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ GDAL_detail::Driver::createHeightField(const TileKey& key, unsigned tileSize, Pr
14191419

14201420
if (!hasNoDataValue)
14211421
{
1422-
double ri, ci, realPart;
1422+
double ri, ci;
14231423

14241424
GDALRIOResampleAlg alg =
14251425
gdalOptions().interpolation() == INTERP_AVERAGE ? GRIORA_Average : // note: broken
@@ -1502,9 +1502,9 @@ GDAL_detail::Driver::createHeightField(const TileKey& key, unsigned tileSize, Pr
15021502

15031503
// flip the raster, and scale by linear units
15041504
int halfHeight = tileSize / 2;
1505-
for (int t = 0; t < tileSize; ++t)
1505+
for (int t = 0; t < (int)tileSize; ++t)
15061506
{
1507-
for (int s = 0; s < tileSize; ++s)
1507+
for (int s = 0; s < (int)tileSize; ++s)
15081508
{
15091509
if (t < halfHeight)
15101510
std::swap(hf_raw[t * tileSize + s], hf_raw[(tileSize - t - 1) * tileSize + s]);
@@ -2305,10 +2305,10 @@ osgEarth::GDAL_detail::heightFieldToTiff(const osg::HeightField* hf)
23052305
std::vector<float> heights;
23062306
heights.reserve(width * height);
23072307
// Flip the heightfield to match the GDAL orientation
2308-
for (unsigned int r = 0; r < height; ++r)
2308+
for (int r = 0; r < height; ++r)
23092309
{
2310-
unsigned int inv_r = height - r - 1;
2311-
for (unsigned int c = 0; c < width; ++c)
2310+
int inv_r = height - r - 1;
2311+
for (int c = 0; c < width; ++c)
23122312
{
23132313
heights.push_back(hf->getHeight(c, inv_r));
23142314
}

src/osgEarth/ObjectIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ObjectIndex::tagDrawable(osg::Drawable* drawable, ObjectID id) const
148148
{
149149
line->setVertexAttribArray(_attribLocation, ids);
150150
auto size = line->size();
151-
for (int i = 0; i < size; ++i)
151+
for (int i = 0; i < (int)size; ++i)
152152
line->pushVertexAttrib(ids.get(), id);
153153
}
154154
}

src/osgEarth/TMS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,14 +1436,14 @@ TMSElevationLayer::createHeightFieldImplementation(const TileKey& key, ProgressC
14361436
key.getExtent().getBounds(xmin, ymin, xmax, ymax);
14371437

14381438
osg::Vec4f pixel;
1439-
for (int c = 0; c < getTileSize(); c++)
1439+
for (int c = 0; c < (int)getTileSize(); c++)
14401440
{
14411441
if (progress && progress->isCanceled())
14421442
return {};
14431443

14441444
double u = (double)c / (double)(getTileSize() - 1);
14451445
double x = xmin + u * (xmax - xmin);
1446-
for (int r = 0; r < getTileSize(); r++)
1446+
for (int r = 0; r < (int)getTileSize(); r++)
14471447
{
14481448
double v = (double)r / (double)(getTileSize() - 1);
14491449
double y = ymin + v * (ymax - ymin);

src/osgEarth/XYZ.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ XYZElevationLayer::createHeightFieldImplementation(const TileKey& key, ProgressC
350350
key.getExtent().getBounds(xmin, ymin, xmax, ymax);
351351

352352
osg::Vec4f pixel;
353-
for (int c = 0; c < getTileSize(); c++)
353+
for (int c = 0; c < (int)getTileSize(); c++)
354354
{
355355
if (progress && progress->isCanceled())
356356
return {};
357357

358358
double u = (double)c / (double)(getTileSize() - 1);
359359
double x = xmin + u * (xmax - xmin);
360-
for (int r = 0; r < getTileSize(); r++)
360+
for (int r = 0; r < (int)getTileSize(); r++)
361361
{
362362
double v = (double)r / (double)(getTileSize() - 1);
363363
double y = ymin + v * (ymax - ymin);

src/osgEarth/XYZFeatureSource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ Status
377377
XYZFeatureSource::insert(const TileKey& key, const FeatureList& features, bool overwrite)
378378
{
379379
OE_SOFT_ASSERT_AND_RETURN(key.valid(), Status::AssertionFailure);
380-
OE_SOFT_ASSERT_AND_RETURN(key.getLOD() >= getMinLevel(), Status::ConfigurationError);
381-
OE_SOFT_ASSERT_AND_RETURN(key.getLOD() <= getMaxLevel(), Status::ConfigurationError);
380+
OE_SOFT_ASSERT_AND_RETURN((int)key.getLOD() >= getMinLevel(), Status::ConfigurationError);
381+
OE_SOFT_ASSERT_AND_RETURN((int)key.getLOD() <= getMaxLevel(), Status::ConfigurationError);
382382
OE_SOFT_ASSERT_AND_RETURN(ci_equals(options().format().value(), "json"), Status::ConfigurationError);
383383

384384
auto url = createURL(Query(key));

src/osgEarthDrivers/fastdxt/FastDXTImageProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ void padImageToMultipleOf4(osg::Image* input)
6464

6565
osg::Vec4 pixel;
6666

67-
for (unsigned t = 0; t < read.t(); ++t)
67+
for (int t = 0; t < read.t(); ++t)
6868
{
69-
for (unsigned s = 0; s < read.s(); ++s)
69+
for (int s = 0; s < read.s(); ++s)
7070
{
7171
read(pixel, s, t);
7272
write(pixel, s, t);

0 commit comments

Comments
 (0)