Skip to content

Commit

Permalink
Remove some warnings when compiling on newer compilers (#1841)
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd authored Sep 23, 2024
1 parent 6a46ae8 commit 821c1fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/lib/OpenEXRCore/attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ attr_init (exr_context_t ctxt, exr_attribute_t* nattr)
switch (nattr->type)
{
case EXR_ATTR_BOX2I: {
exr_attr_box2i_t nil = {0};
exr_attr_box2i_t nil = {{0}};
*(nattr->box2i) = nil;
break;
}
case EXR_ATTR_BOX2F: {
exr_attr_box2f_t nil = {0};
exr_attr_box2f_t nil = {{0}};
*(nattr->box2f) = nil;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/OpenEXRCore/channel_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exr_attr_chlist_add_with_length (
int32_t xsamp,
int32_t ysamp)
{
exr_attr_chlist_entry_t nent = {0};
exr_attr_chlist_entry_t nent = {{0}};
exr_attr_chlist_entry_t *nlist, *olist;
int newcount, insertpos;
int32_t maxlen;
Expand Down
10 changes: 5 additions & 5 deletions src/test/OpenEXRCoreTest/write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ testWriteBaseHeader (const std::string& tempdir)
&outf, outfn.c_str (), EXR_WRITE_FILE_DIRECTLY, &cinit));
EXRCORE_TEST_RVAL (
exr_add_part (outf, "beauty", EXR_STORAGE_SCANLINE, &partidx));
exr_attr_box2i_t dataw = {-2, -3, 514, 515};
exr_attr_box2i_t dispw = {0, 0, 512, 512};
exr_attr_box2i_t dataw = {{-2, -3}, {514, 515}};
exr_attr_box2i_t dispw = {{0, 0}, {512, 512}};
exr_attr_v2f_t swc = {0.5f, 0.5f};
EXRCORE_TEST_RVAL (exr_initialize_required_attr (
outf,
Expand Down Expand Up @@ -493,7 +493,7 @@ testWriteBaseHeader (const std::string& tempdir)
&outf, outfn.c_str (), EXR_WRITE_FILE_DIRECTLY, &cinit));
EXRCORE_TEST_RVAL (
exr_add_part (outf, "beauty", EXR_STORAGE_TILED, &partidx));
dataw = {0, 0, 512, 512};
dataw = {{0, 0}, {512, 512}};
EXRCORE_TEST_RVAL (exr_initialize_required_attr (
outf,
partidx,
Expand Down Expand Up @@ -929,7 +929,7 @@ testWriteAttrs (const std::string& tempdir)
}

{
exr_attr_box2i_t tb2i = {1, 2, 3, 4};
exr_attr_box2i_t tb2i = {{1, 2}, {3, 4}};
TEST_CORNER_CASE_NAME (box2i, tb2i, int);
EXRCORE_TEST (tb2i.min.x == 1);
EXRCORE_TEST (tb2i.min.y == 2);
Expand All @@ -938,7 +938,7 @@ testWriteAttrs (const std::string& tempdir)
}

{
exr_attr_box2f_t tb2f = {1.f, 2.f, 3.f, 4.f};
exr_attr_box2f_t tb2f = {{1.f, 2.f}, {3.f, 4.f}};
TEST_CORNER_CASE_NAME (box2f, tb2f, int);
EXRCORE_TEST (tb2f.min.x == 1.f);
EXRCORE_TEST (tb2f.min.y == 2.f);
Expand Down
5 changes: 3 additions & 2 deletions website/src/readTiled1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ readTiledOtherVersions (const char fileName[])
{
// read tile function versions
TiledInputFile in(fileName);
int tileX, tileY, levelX, levelY, tileXMin, tileXMax, tileYMin, tileYMax;
int tileX = 0, tileY = 0, levelX = 0, levelY = 0;
int tileXMin = 0, tileXMax = 0, tileYMin = 0, tileYMax = 0;
// [begin v1]
in.readTile (tileX, tileY, levelX, levelY);
// [end v1]
in.readTiles (tileXMin, tileXMax, tileYMin, tileYMax, levelX, levelY);
// [end v2]
}
}

0 comments on commit 821c1fc

Please sign in to comment.