Skip to content

Commit

Permalink
Add "E57_" to macros in E57Exception.h (#285)
Browse files Browse the repository at this point in the history
These were intended for library use only, but they are in a public header,
so rename to avoid potential conflict with user code.
  • Loading branch information
asmaloney committed Apr 20, 2024
1 parent db07ea2 commit 0b2ad65
Show file tree
Hide file tree
Showing 23 changed files with 139 additions and 137 deletions.
130 changes: 65 additions & 65 deletions include/E57Exception.h

Large diffs are not rendered by default.

46 changes: 24 additions & 22 deletions include/E57Format.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,24 @@ namespace e57
TypeBlob = 8, ///< BlobNode class

/// @deprecated Will be removed in 4.0. Use e57::TypeStructure.
E57_STRUCTURE DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeStructure." ) = TypeStructure,
E57_STRUCTURE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeStructure." ) =
TypeStructure,
/// @deprecated Will be removed in 4.0. Use e57::TypeVector.
E57_VECTOR DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeVector." ) = TypeVector,
E57_VECTOR E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeVector." ) = TypeVector,
/// @deprecated Will be removed in 4.0. Use e57::TypeCompressedVector.
E57_COMPRESSED_VECTOR DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeCompressedVector." ) =
TypeCompressedVector,
E57_COMPRESSED_VECTOR E57_DEPRECATED_ENUM(
"Will be removed in 4.0. Use TypeCompressedVector." ) = TypeCompressedVector,
/// @deprecated Will be removed in 4.0. Use e57::TypeInteger.
E57_INTEGER DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeInteger." ) = TypeInteger,
E57_INTEGER E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeInteger." ) = TypeInteger,
/// @deprecated Will be removed in 4.0. Use e57::TypeScaledInteger.
E57_SCALED_INTEGER DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeScaledInteger." ) =
E57_SCALED_INTEGER E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeScaledInteger." ) =
TypeScaledInteger,
/// @deprecated Will be removed in 4.0. Use e57::TypeFloat.
E57_FLOAT DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeFloat." ) = TypeFloat,
E57_FLOAT E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeFloat." ) = TypeFloat,
/// @deprecated Will be removed in 4.0. Use e57::TypeString.
E57_STRING DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeString." ) = TypeString,
E57_STRING E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeString." ) = TypeString,
/// @deprecated Will be removed in 4.0. Use e57::TypeBlob.
E57_BLOB DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeBlob." ) = TypeBlob
E57_BLOB E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeBlob." ) = TypeBlob
};

/// @brief The IEEE floating point number precisions supported
Expand All @@ -92,10 +93,11 @@ namespace e57
PrecisionDouble = 2, ///< 64 bit IEEE floating point number format

/// @deprecated Will be removed in 4.0. Use e57::PrecisionSingle.
E57_SINGLE DEPRECATED_ENUM( "Will be removed in 4.0. Use PrecisionSingle." ) =
E57_SINGLE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use PrecisionSingle." ) =
PrecisionSingle,
/// @deprecated Will be removed in 4.0. Use e57::PrecisionDouble.
E57_DOUBLE DEPRECATED_ENUM( "Will be removed in 4.0. Use PrecisionDouble." ) = PrecisionDouble
E57_DOUBLE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use PrecisionDouble." ) =
PrecisionDouble
};

/// @brief Identifies the representations of memory elements API can transfer data to/from
Expand All @@ -114,27 +116,27 @@ namespace e57
UString = 11, ///< Unicode UTF-8 std::string

/// @deprecated Will be removed in 4.0. Use e57::Int8.
E57_INT8 DEPRECATED_ENUM( "Will be removed in 4.0. Use Int8." ) = Int8,
E57_INT8 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int8." ) = Int8,
/// @deprecated Will be removed in 4.0. Use e57::UInt8.
E57_UINT8 DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt8." ) = UInt8,
E57_UINT8 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt8." ) = UInt8,
/// @deprecated Will be removed in 4.0. Use e57::Int16.
E57_INT16 DEPRECATED_ENUM( "Will be removed in 4.0. Use Int16." ) = Int16,
E57_INT16 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int16." ) = Int16,
/// @deprecated Will be removed in 4.0. Use e57::UInt16.
E57_UINT16 DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt16." ) = UInt16,
E57_UINT16 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt16." ) = UInt16,
/// @deprecated Will be removed in 4.0. Use e57::Int32.
E57_INT32 DEPRECATED_ENUM( "Will be removed in 4.0. Use Int32." ) = Int32,
E57_INT32 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int32." ) = Int32,
/// @deprecated Will be removed in 4.0. Use e57::UInt32.
E57_UINT32 DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt32." ) = UInt32,
E57_UINT32 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt32." ) = UInt32,
/// @deprecated Will be removed in 4.0. Use e57::Int64.
E57_INT64 DEPRECATED_ENUM( "Will be removed in 4.0. Use Int64." ) = Int64,
E57_INT64 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int64." ) = Int64,
/// @deprecated Will be removed in 4.0. Use e57::Bool.
E57_BOOL DEPRECATED_ENUM( "Will be removed in 4.0. Use Bool." ) = Bool,
E57_BOOL E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Bool." ) = Bool,
/// @deprecated Will be removed in 4.0. Use e57::Real32.
E57_REAL32 DEPRECATED_ENUM( "Will be removed in 4.0. Use Real32." ) = Real32,
E57_REAL32 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Real32." ) = Real32,
/// @deprecated Will be removed in 4.0. Use e57::Real64.
E57_REAL64 DEPRECATED_ENUM( "Will be removed in 4.0. Use Real64." ) = Real64,
E57_REAL64 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Real64." ) = Real64,
/// @deprecated Will be removed in 4.0. Use e57::UString.
E57_USTRING DEPRECATED_ENUM( "Will be removed in 4.0. Use UString." ) = UString
E57_USTRING E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UString." ) = UString
};

/// @brief Default checksum policies for e57::ReadChecksumPolicy
Expand Down
18 changes: 9 additions & 9 deletions include/E57SimpleData.h
Original file line number Diff line number Diff line change
Expand Up @@ -961,13 +961,13 @@ namespace e57
ImageMaskPNG = 3, ///< PNG format image mask.

/// @deprecated Will be removed in 4.0. Use e57::ImageNone.
E57_NO_IMAGE DEPRECATED_ENUM( "Will be removed in 4.0. Use ImageNone." ) = ImageNone,
E57_NO_IMAGE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ImageNone." ) = ImageNone,
/// @deprecated Will be removed in 4.0. Use e57::ImageJPEG.
E57_JPEG_IMAGE DEPRECATED_ENUM( "Will be removed in 4.0. Use ImageJPEG." ) = ImageJPEG,
E57_JPEG_IMAGE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ImageJPEG." ) = ImageJPEG,
/// @deprecated Will be removed in 4.0. Use e57::ImagePNG.
E57_PNG_IMAGE DEPRECATED_ENUM( "Will be removed in 4.0. Use ImagePNG." ) = ImagePNG,
E57_PNG_IMAGE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ImagePNG." ) = ImagePNG,
/// @deprecated Will be removed in 4.0. Use e57::ImageMaskPNG.
E57_PNG_IMAGE_MASK DEPRECATED_ENUM( "Will be removed in 4.0. Use ImageMaskPNG." ) =
E57_PNG_IMAGE_MASK E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ImageMaskPNG." ) =
ImageMaskPNG,
};

Expand All @@ -981,19 +981,19 @@ namespace e57
ProjectionCylindrical = 4, ///< CylindricalRepresentation for the image data

/// @deprecated Will be removed in 4.0. Use e57::ProjectionNone.
E57_NO_PROJECTION DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionNone." ) =
E57_NO_PROJECTION E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionNone." ) =
ProjectionNone,
/// @deprecated Will be removed in 4.0. Use e57::ProjectionVisual.
E57_VISUAL DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionVisual." ) =
E57_VISUAL E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionVisual." ) =
ProjectionVisual,
/// @deprecated Will be removed in 4.0. Use e57::ProjectionPinhole.
E57_PINHOLE DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionPinhole." ) =
E57_PINHOLE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionPinhole." ) =
ProjectionPinhole,
/// @deprecated Will be removed in 4.0. Use e57::ProjectionSpherical.
E57_SPHERICAL DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionSpherical." ) =
E57_SPHERICAL E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionSpherical." ) =
ProjectionSpherical,
/// @deprecated Will be removed in 4.0. Use e57::ProjectionCylindrical.
E57_CYLINDRICAL DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionCylindrical." ) =
E57_CYLINDRICAL E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ProjectionCylindrical." ) =
ProjectionCylindrical,
};
} // end namespace e57
4 changes: 2 additions & 2 deletions src/BlobNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ void BlobNode::dump( int indent, std::ostream &os ) const
#else
void BlobNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/CheckedFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ void CheckedFile::unlink()
std::cout << "std::remove() failed, result=" << result << std::endl;
}
#else
UNUSED( result );
E57_UNUSED( result );
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#endif

// Used to mark unused parameters to indicate intent and suppress warnings.
#define UNUSED( expr ) (void)( expr )
#define E57_UNUSED( expr ) (void)( expr )

// For readability of preprocessor using E57_VALIDATION_LEVEL
#define VALIDATION_OFF 0
Expand Down
4 changes: 2 additions & 2 deletions src/CompressedVectorNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ void CompressedVectorNode::dump( int indent, std::ostream &os ) const
#else
void CompressedVectorNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/CompressedVectorReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void CompressedVectorReader::dump( int indent, std::ostream &os ) const
#else
void CompressedVectorReader::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif
6 changes: 3 additions & 3 deletions src/CompressedVectorReaderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ namespace e57
const char *srcFunctionName ) const
{
// unimplemented...
UNUSED( srcFileName );
UNUSED( srcLineNumber );
UNUSED( srcFunctionName );
E57_UNUSED( srcFileName );
E57_UNUSED( srcLineNumber );
E57_UNUSED( srcFunctionName );
}

void CompressedVectorReaderImpl::checkReaderOpen( const char *srcFileName, int srcLineNumber,
Expand Down
4 changes: 2 additions & 2 deletions src/CompressedVectorWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void CompressedVectorWriter::dump( int indent, std::ostream &os ) const
#else
void CompressedVectorWriter::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif
6 changes: 3 additions & 3 deletions src/CompressedVectorWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,9 @@ namespace e57
const char *srcFunctionName ) const
{
// unimplemented...
UNUSED( srcFileName );
UNUSED( srcLineNumber );
UNUSED( srcFunctionName );
E57_UNUSED( srcFileName );
E57_UNUSED( srcLineNumber );
E57_UNUSED( srcFunctionName );
}

void CompressedVectorWriterImpl::checkWriterOpen( const char *srcFileName, int srcLineNumber,
Expand Down
4 changes: 2 additions & 2 deletions src/Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ size_t ConstantIntegerDecoder::inputProcess( const char *source, const size_t av
std::cout << "ConstantIntegerDecoder::inputprocess() called, source=" << (void *)( source )
<< " availableByteCount=" << availableByteCount << std::endl;
#else
UNUSED( source );
UNUSED( availableByteCount );
E57_UNUSED( source );
E57_UNUSED( availableByteCount );
#endif

// We don't need any input bytes to produce output, so ignore source and
Expand Down
2 changes: 1 addition & 1 deletion src/E57XmlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ void E57XmlParser::characters( const XMLCh *const chars, const XMLSize_t length
#ifdef E57_VERBOSE
std::cout << "characters, chars=\"" << toUString( chars ) << "\" length=" << length << std::endl;
#else
UNUSED( length );
E57_UNUSED( length );
#endif

// Get active element
Expand Down
4 changes: 2 additions & 2 deletions src/FloatNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ void FloatNode::dump( int indent, std::ostream &os ) const
#else
void FloatNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/ImageFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ void ImageFile::dump( int indent, std::ostream &os ) const
#else
void ImageFile::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/IntegerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ judiciously, in debug versions of the application.
*/
void IntegerNode::checkInvariant( bool doRecurse, bool doUpcast ) const
{
UNUSED( doRecurse );
E57_UNUSED( doRecurse );

// If destImageFile not open, can't test invariant (almost every call would throw)
if ( !destImageFile().isOpen() )
Expand Down Expand Up @@ -269,8 +269,8 @@ void IntegerNode::dump( int indent, std::ostream &os ) const
#else
void IntegerNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ void Node::dump( int indent, std::ostream &os ) const
#else
void Node::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void PacketReadCache::unlock( unsigned cacheIndex )
#ifdef E57_VERBOSE
std::cout << "PacketReadCache::unlock() called, cacheIndex=" << cacheIndex << std::endl;
#else
UNUSED( cacheIndex );
E57_UNUSED( cacheIndex );
#endif

if ( lockCount_ != 1 )
Expand Down Expand Up @@ -563,8 +563,8 @@ void IndexPacket::verify( unsigned bufferLength, uint64_t totalRecordCount,
uint64_t fileSize ) const
{
#if ( E57_VALIDATION_LEVEL < VALIDATION_DEEP )
UNUSED( totalRecordCount );
UNUSED( fileSize );
E57_UNUSED( totalRecordCount );
E57_UNUSED( fileSize );
#endif

//??? do all packets need versions? how extend without breaking older
Expand Down
4 changes: 2 additions & 2 deletions src/ScaledIntegerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ void ScaledIntegerNode::dump( int indent, std::ostream &os ) const
#else
void ScaledIntegerNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/SourceDestBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ void SourceDestBuffer::dump( int indent, std::ostream &os ) const
#else
void SourceDestBuffer::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif
4 changes: 2 additions & 2 deletions src/StringNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void StringNode::dump( int indent, std::ostream &os ) const
#else
void StringNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/StructureNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ void StructureNode::dump( int indent, std::ostream &os ) const
#else
void StructureNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/VectorNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ void VectorNode::dump( int indent, std::ostream &os ) const
#else
void VectorNode::dump( int indent, std::ostream &os ) const
{
UNUSED( indent );
UNUSED( os );
E57_UNUSED( indent );
E57_UNUSED( os );
}
#endif

Expand Down

0 comments on commit 0b2ad65

Please sign in to comment.