Skip to content

Commit 0fd325c

Browse files
committed
Reduce dependency on BitDepthUtils.h , prefer cmath over math.h
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
1 parent 1f6a871 commit 0fd325c

File tree

19 files changed

+42
-30
lines changed

19 files changed

+42
-30
lines changed

src/OpenColorIO/BitDepthUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Copyright Contributors to the OpenColorIO Project.
33

44

5+
#include <string>
6+
57
#include <OpenColorIO/OpenColorIO.h>
68

79
#include "BitDepthUtils.h"

src/OpenColorIO/CPUInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
typedef unsigned __int32 uint32_t;
1212
typedef __int64 int64_t;
1313
#else
14-
#include <stdint.h>
14+
#include <cstdint>
1515
#endif
1616

1717
namespace OCIO_NAMESPACE

src/OpenColorIO/CPUProcessor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <cstring>
55
#include <sstream>
6+
#include <memory>
67

78
#include <OpenColorIO/OpenColorIO.h>
89

src/OpenColorIO/GpuShaderUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
// Copyright Contributors to the OpenColorIO Project.
33

4-
#include <math.h>
4+
#include <cmath>
55
#include <limits>
66
#include <sstream>
77

src/OpenColorIO/ImageDesc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Copyright Contributors to the OpenColorIO Project.
33

44
#include <cstdlib>
5-
#include <math.h>
5+
#include <cmath>
6+
#include <string>
67
#include <ostream>
78

89
#include <OpenColorIO/OpenColorIO.h>

src/OpenColorIO/ImagePacking.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
#include <OpenColorIO/OpenColorIO.h>
66

7-
#include "BitDepthUtils.h"
7+
#include <IMath/half.h>
8+
89
#include "ImagePacking.h"
910

1011

src/OpenColorIO/OpOptimizers.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,8 @@ void OpRcPtrVec::optimize(OptimizationFlags oFlags)
619619
if (IsDebugLoggingEnabled())
620620
{
621621
std::ostringstream oss;
622-
oss << std::endl
623-
<< "**" << std::endl
624-
<< "Optimizing Op Vec..." << std::endl
625-
<< SerializeOpVec(*this, 4) << std::endl;
622+
oss << "\n**\nOptimizing Op Vec...\n"
623+
<< SerializeOpVec(*this, 4) << "\n";
626624

627625
LogDebug(oss.str());
628626
}
@@ -639,8 +637,7 @@ void OpRcPtrVec::optimize(OptimizationFlags oFlags)
639637
OpRcPtrVec::size_type finalSize = size();
640638

641639
std::ostringstream os;
642-
os << "**" << std::endl;
643-
os << "Optimized ";
640+
os << "**\nOptimized ";
644641
os << originalSize << "->" << finalSize << ", 1 pass, ";
645642
os << total_nooptype << " no-op types removed\n";
646643
os << SerializeOpVec(*this, 4);
@@ -727,11 +724,11 @@ void OpRcPtrVec::optimize(OptimizationFlags oFlags)
727724
if (passes == MAX_OPTIMIZATION_PASSES)
728725
{
729726
std::ostringstream os;
730-
os << "The max number of passes, " << passes << ", ";
731-
os << "was reached during optimization. This is likely a sign ";
732-
os << "that either the complexity of the color transform is ";
733-
os << "very high, or that some internal optimizers are in conflict ";
734-
os << "(undo-ing / redo-ing the other's results).";
727+
os << "The max number of passes, " << passes << ", "
728+
"was reached during optimization. This is likely a sign "
729+
"that either the complexity of the color transform is "
730+
"very high, or that some internal optimizers are in conflict "
731+
"(undo-ing / redo-ing the other's results).";
735732
LogDebug(os.str());
736733
}
737734

@@ -740,8 +737,7 @@ void OpRcPtrVec::optimize(OptimizationFlags oFlags)
740737
OpRcPtrVec::size_type finalSize = size();
741738

742739
std::ostringstream os;
743-
os << "**" << std::endl;
744-
os << "Optimized ";
740+
os << "**\nOptimized ";
745741
os << originalSize << "->" << finalSize << ", ";
746742
os << passes << " passes, ";
747743
os << total_nooptype << " no-op types removed, ";

src/OpenColorIO/fileformats/FileFormat3DL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
#include <algorithm>
55
#include <cmath>
66
#include <cstdio>
7+
#include <string>
78
#include <sstream>
9+
#include <iostream>
10+
#include <memory>
811

912
#include <OpenColorIO/OpenColorIO.h>
1013

src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
#include <algorithm>
55
#include <cstdio>
66
#include <cstring>
7+
#include <string>
78
#include <sstream>
89
#include <istream>
10+
#include <memory>
911

1012
#include <pystring.h>
1113

src/OpenColorIO/ops/OpTools.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
// Copyright Contributors to the OpenColorIO Project.
33

4+
#include <vector>
5+
46
#include <OpenColorIO/OpenColorIO.h>
57

6-
#include "BitDepthUtils.h"
78
#include "ops/OpTools.h"
89

910
namespace OCIO_NAMESPACE

0 commit comments

Comments
 (0)