Skip to content

Commit 0797032

Browse files
committed
fix use of int vs size_t
Signed-off-by: Cary Phillips <[email protected]>
1 parent 6b2f2e8 commit 0797032

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/lib/OpenEXRCore/internal_ht_common.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ make_channel_map (
5959

6060
cs_to_file_ch.resize (channel_count);
6161

62-
for (size_t i = 0; i < static_cast<size_t>(channel_count); i++)
62+
for (int i = 0; i < channel_count; i++)
6363
{
6464
const char* channel_name = channels[i].channel_name;
6565
const char* suffix = strrchr (channel_name, '.');
@@ -143,14 +143,14 @@ make_channel_map (
143143

144144
int avail_cs_i = 3;
145145
int offset = 0;
146-
for (size_t file_i = 0; file_i < static_cast<size_t>(channel_count); file_i++)
146+
for (int file_i = 0; file_i < channel_count; file_i++)
147147
{
148148
int cs_i;
149-
if (static_cast<int>(file_i) == r_index) {
149+
if (file_i == r_index) {
150150
cs_i = 0;
151-
} else if (static_cast<int>(file_i) == g_index) {
151+
} else if (file_i == g_index) {
152152
cs_i = 1;
153-
} else if (static_cast<int>(file_i) == b_index) {
153+
} else if (file_i == b_index) {
154154
cs_i = 2;
155155
} else {
156156
cs_i = avail_cs_i++;

src/test/OpenEXRCoreTest/compression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,9 +1720,9 @@ testHTChannelMap (const std::string& tempdir)
17201720
{{{"redqueen"}, {"greens"}, {"blueberry"}}, 3, false, {0, 1, 2}},
17211721
{{{"hello.R"}, {"bye.G"}, {"hello.B"}}, 3, false, {0, 2, 4}},
17221722
};
1723-
int test_count = sizeof(tests) / sizeof(ht_channel_map_tests);
1723+
size_t test_count = sizeof(tests) / sizeof(ht_channel_map_tests);
17241724

1725-
for (size_t i = 0; i < static_cast<size_t>(test_count); i++)
1725+
for (size_t i = 0; i < test_count; i++)
17261726
{
17271727
EXRCORE_TEST (
17281728
make_channel_map (

0 commit comments

Comments
 (0)