Skip to content

Commit

Permalink
Eliminated most warnings messages when OpenEXR is compiled
Browse files Browse the repository at this point in the history
with Visual C++.  The OpenEXR code uses lots of (intentional
and unintended) implicit type conversions.  By default, Visual
C++ warns about almost all of them.  Most implicit conversions
have been removed from the .h files, so that including them
should not generate warnings even at warning level 3.  Most
.cpp files are now compiled with warning level 1.
  • Loading branch information
fkainz committed May 18, 2004
1 parent cba2d87 commit a27e048
Show file tree
Hide file tree
Showing 33 changed files with 203 additions and 188 deletions.
9 changes: 9 additions & 0 deletions OpenEXR/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
* Eliminated most warnings messages when OpenEXR is compiled
with Visual C++. The OpenEXR code uses lots of (intentional
and unintended) implicit type conversions. By default, Visual
C++ warns about almost all of them. Most implicit conversions
have been removed from the .h files, so that including them
should not generate warnings even at warning level 3. Most
.cpp files are now compiled with warning level 1.
(Florian Kainz)

Version 1.2.0:
* Production-ready release.
* Disable long double warnings on OS X. (Drew Hess)
Expand Down
8 changes: 4 additions & 4 deletions OpenEXR/Half/half.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ void printBits (char c[35], float f);
// Limits
//-------

#define HALF_MIN 5.96046448e-08 // Smallest positive half
#define HALF_MIN 5.96046448e-08f // Smallest positive half

#define HALF_NRM_MIN 6.10351562e-05 // Smallest positive normalized half
#define HALF_NRM_MIN 6.10351562e-05f // Smallest positive normalized half

#define HALF_MAX 65504.0 // Largest positive half
#define HALF_MAX 65504.0f // Largest positive half

#define HALF_EPSILON 0.00097656 // Smallest positive e for which
#define HALF_EPSILON 0.00097656f // Smallest positive e for which
// half (1.0 + e) != half (1.0)

#define HALF_MANT_DIG 11 // Number of digits in mantissa
Expand Down
16 changes: 8 additions & 8 deletions OpenEXR/IexTest/testBaseExc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ throwNested()
{
throwArgExc();
}
catch (const Iex::ArgExc &e)
catch (const Iex::ArgExc &)
{
try
{
Expand All @@ -90,11 +90,11 @@ test1 ()
{
throwArgExc();
}
catch (const Iex::ArgExc &e)
catch (const Iex::ArgExc &)
{
return;
}
catch (std::exception &e)
catch (std::exception &)
{
assert (false);
}
Expand All @@ -115,11 +115,11 @@ test2 ()
{
throwLogicError();
}
catch (const Iex::ArgExc &e)
catch (const Iex::ArgExc &)
{
assert (false);
}
catch (std::exception &e)
catch (std::exception &)
{
return;
}
Expand All @@ -140,7 +140,7 @@ test3 ()
{
throwArgExc();
}
catch (std::exception &e)
catch (std::exception &)
{
return;
}
Expand All @@ -161,11 +161,11 @@ test4 ()
{
throwInt();
}
catch (const Iex::ArgExc &e)
catch (const Iex::ArgExc &)
{
assert (false);
}
catch (std::exception &e)
catch (std::exception &)
{
assert (false);
}
Expand Down
14 changes: 7 additions & 7 deletions OpenEXR/IlmImf/ImfCRgbaFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ IMF_EXPORT void ImfHalfToFloatArray (int n,
** RGBA pixel; memory layout must be the same as struct Imf::Rgba.
*/

IMF_EXPORT struct ImfRgba
struct ImfRgba
{
ImfHalf r;
ImfHalf g;
Expand Down Expand Up @@ -155,7 +155,7 @@ typedef struct ImfRgba ImfRgba;
** RGBA file header
*/

IMF_EXPORT struct ImfHeader;
struct ImfHeader;
typedef struct ImfHeader ImfHeader;

IMF_EXPORT ImfHeader * ImfNewHeader (void);
Expand Down Expand Up @@ -310,7 +310,7 @@ IMF_EXPORT int ImfHeaderM44fAttribute (const ImfHeader *hdr,
** RGBA output file
*/

IMF_EXPORT struct ImfOutputFile;
struct ImfOutputFile;
typedef struct ImfOutputFile ImfOutputFile;

IMF_EXPORT ImfOutputFile * ImfOpenOutputFile (const char name[],
Expand Down Expand Up @@ -338,7 +338,7 @@ IMF_EXPORT int ImfOutputChannels (const ImfOutputFile *out);
** Tiled RGBA output file
*/

IMF_EXPORT struct ImfTiledOutputFile;
struct ImfTiledOutputFile;
typedef struct ImfTiledOutputFile ImfTiledOutputFile;

IMF_EXPORT ImfTiledOutputFile * ImfOpenTiledOutputFile (const char name[],
Expand Down Expand Up @@ -375,7 +375,7 @@ IMF_EXPORT int ImfTiledOutputLevelRoundingMode
** RGBA input file
*/

IMF_EXPORT struct ImfInputFile;
struct ImfInputFile;
typedef struct ImfInputFile ImfInputFile;

IMF_EXPORT ImfInputFile * ImfOpenInputFile (const char name[]);
Expand All @@ -402,7 +402,7 @@ IMF_EXPORT const char * ImfInputFileName (const ImfInputFile *in);
** Tiled RGBA input file
*/

IMF_EXPORT struct ImfTiledInputFile;
struct ImfTiledInputFile;
typedef struct ImfTiledInputFile ImfTiledInputFile;

IMF_EXPORT ImfTiledInputFile * ImfOpenTiledInputFile (const char name[]);
Expand Down Expand Up @@ -437,7 +437,7 @@ IMF_EXPORT int ImfTiledInputLevelRoundingMode
** Lookup tables
*/

IMF_EXPORT struct ImfLut;
struct ImfLut;
typedef struct ImfLut ImfLut;

IMF_EXPORT ImfLut * ImfNewRound12logLut (int channels);
Expand Down
8 changes: 4 additions & 4 deletions OpenEXR/IlmImf/ImfChromaticities.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ struct Chromaticities
Imath::V2f blue;
Imath::V2f white;

Chromaticities (const Imath::V2f &red = Imath::V2f (0.6400, 0.3300),
const Imath::V2f &green = Imath::V2f (0.3000, 0.6000),
const Imath::V2f &blue = Imath::V2f (0.1500, 0.0600),
const Imath::V2f &white = Imath::V2f (0.3127, 0.3290));
Chromaticities (const Imath::V2f &red = Imath::V2f (0.6400f, 0.3300f),
const Imath::V2f &green = Imath::V2f (0.3000f, 0.6000f),
const Imath::V2f &blue = Imath::V2f (0.1500f, 0.0600f),
const Imath::V2f &white = Imath::V2f (0.3127f, 0.3290f));
};


Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class InputFile
const char *&pixelData,
int &pixelDataSize);

class Data;
struct Data;

private:

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfOutputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class OutputFile

void updatePreviewImage (const PreviewRgba newPixels[]);

class Data;
struct Data;

private:

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfScanLineInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ScanLineInputFile
const char *&pixelData,
int &pixelDataSize);

class Data;
struct Data;

private:

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfTiledInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class TiledInputFile
const char *&pixelData,
int &pixelDataSize);

class Data;
struct Data;

private:

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfTiledOutputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class TiledOutputFile
void updatePreviewImage (const PreviewRgba newPixels[]);


class Data;
struct Data;

private:

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const int ALL_FLAGS = TILED_FLAG;
// Utility functions
//

inline bool isTiled (int version) {return version & TILED_FLAG;}
inline bool isTiled (int version) {return !!(version & TILED_FLAG);}
inline int makeTiled (int version) {return version | TILED_FLAG;}
inline int makeNotTiled (int version) {return version & ~TILED_FLAG;}
inline int getVersion (int version) {return version & VERSION_NUMBER_FIELD;}
Expand Down
Loading

0 comments on commit a27e048

Please sign in to comment.