From 2a5e0fa7722770a51f954aa06757e1042230dff8 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Wed, 8 Dec 2021 14:07:37 -0500 Subject: [PATCH] Fix spelling and run clang-format (#85) --- include/E57SimpleData.h | 4 ++-- include/E57SimpleReader.h | 16 ++++++++-------- include/E57SimpleWriter.h | 2 +- src/Decoder.cpp | 8 ++++---- src/E57Exception.cpp | 2 +- src/E57Format.cpp | 10 +++++----- src/E57XmlParser.cpp | 2 +- src/ReaderImpl.cpp | 4 ++-- src/ReaderImpl.h | 2 +- src/SourceDestBufferImpl.cpp | 4 ++-- src/StringNodeImpl.cpp | 2 +- src/WriterImpl.cpp | 6 +++--- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/E57SimpleData.h b/include/E57SimpleData.h index b1e9220..47eb35e 100644 --- a/include/E57SimpleData.h +++ b/include/E57SimpleData.h @@ -38,7 +38,7 @@ namespace e57 //! Indicates to use FloatNode instead of ScaledIntegerNode in fields that can use both. constexpr double E57_NOT_SCALED_USE_FLOAT = 0.; - //! Indicates to use ScaledIntegerNode insterad of FloatNode in fields that can use both. + //! Indicates to use ScaledIntegerNode instead of FloatNode in fields that can use both. constexpr double E57_NOT_SCALED_USE_INTEGER = -1.; //! @cond documentNonPublic The following isn't part of the API, and isn't documented. @@ -144,7 +144,7 @@ namespace e57 double elevationMinimum; //!< The minimum extent of the bounding region from the horizontal plane double elevationMaximum; //!< The maximum extent of the bounding region from the horizontal plane double azimuthStart; //!< The starting azimuth angle defining the extent of the bounding region around the z axis - double azimuthEnd; //!< The ending azimuth angle defining the extent of the bounding region around the z axix + double azimuthEnd; //!< The ending azimuth angle defining the extent of the bounding region around the z axis bool operator==( const SphericalBounds &rhs ) const { diff --git a/include/E57SimpleReader.h b/include/E57SimpleReader.h index 1874238..1e6b48b 100644 --- a/include/E57SimpleReader.h +++ b/include/E57SimpleReader.h @@ -54,7 +54,7 @@ namespace e57 //! @brief This function returns the file header information //! @param [out] fileHeader is the main header information - //! @return Returns true if sucessful + //! @return Returns true if successful bool GetE57Root( E57Root &fileHeader ) const; //!@} @@ -69,7 +69,7 @@ namespace e57 //! @brief This function returns the image2D header and positions the cursor //! @param [in] imageIndex This in the index into the image2D vector //! @param [out] image2DHeader pointer to the Image2D structure to receive the picture information - //! @return Returns true if sucessful + //! @return Returns true if successful bool ReadImage2D( int64_t imageIndex, Image2D &image2DHeader ) const; //! @brief This function returns the size of the image data @@ -81,7 +81,7 @@ namespace e57 //! @param [out] imageSize This is the total number of bytes for the image blob. //! @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the projection //! @param [out] imageVisualType This is image type of the VisualReferenceRepresentation if given. - //! @return Returns true if sucessful + //! @return Returns true if successful bool GetImage2DSizes( int64_t imageIndex, Image2DProjection &imageProjection, Image2DType &imageType, int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize, Image2DType &imageMaskType, Image2DType &imageVisualType ) const; @@ -109,7 +109,7 @@ namespace e57 //! @brief This function returns the Data3D header //! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount(). //! @param [out] data3DHeader Data3D header - //! @return Returns true if sucessful + //! @return Returns true if successful bool ReadData3D( int64_t dataIndex, Data3D &data3DHeader ) const; //! @brief This function returns the size of the point data @@ -117,21 +117,21 @@ namespace e57 //! @param [out] rowMax This is the maximum row size //! @param [out] columnMax This is the maximum column size //! @param [out] pointsSize This is the total number of point records - //! @param [out] groupsSize This is the total number of group reocrds + //! @param [out] groupsSize This is the total number of group records //! @param [out] countSize This is the maximum point count per group //! @param [out] columnIndex This indicates that the idElementName is "columnIndex" - //! @return Return true if sucessful, false otherwise + //! @return Return true if successful, false otherwise bool GetData3DSizes( int64_t dataIndex, int64_t &rowMax, int64_t &columnMax, int64_t &pointsSize, int64_t &groupsSize, int64_t &countSize, bool &columnIndex ) const; - //! @brief This funtion reads the group data into the provided buffers. + //! @brief This function reads the group data into the provided buffers. //! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount(). //! @param [in] groupCount size of each of the buffers given //! @param [out] idElementValue pointer to the buffer holding indices index for this group //! @param [out] startPointIndex pointer to the buffer holding Starting index in to the "points" data vector for //! the groups //! @param [out] pointCount pointer to the buffer holding size of the groups given - //! @return Return true if sucessful, false otherwise + //! @return Return true if successful, false otherwise bool ReadData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount ) const; diff --git a/include/E57SimpleWriter.h b/include/E57SimpleWriter.h index 9c21470..32c5a0a 100644 --- a/include/E57SimpleWriter.h +++ b/include/E57SimpleWriter.h @@ -105,7 +105,7 @@ namespace e57 //! @param [in] buffer of idElementValue index for this group //! @param [in] startPointIndex buffer with starting indices in to the "points" data vector for the groups //! @param [in] pointCount buffer with sizes of the groups given - //! @return Return true if sucessful, false otherwise + //! @return Return true if successful, false otherwise bool WriteData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount ); diff --git a/src/Decoder.cpp b/src/Decoder.cpp index 439c274..7824f60 100644 --- a/src/Decoder.cpp +++ b/src/Decoder.cpp @@ -361,8 +361,8 @@ BitpackFloatDecoder::BitpackFloatDecoder( unsigned bytestreamNumber, SourceDestB size_t BitpackFloatDecoder::inputProcessAligned( const char *inbuf, const size_t firstBit, const size_t endBit ) { #ifdef E57_MAX_VERBOSE - std::cout << "BitpackFloatDecoder::inputProcessAligned() called, inbuf=" << reinterpret_cast(inbuf) << " firstBit=" << firstBit - << " endBit=" << endBit << std::endl; + std::cout << "BitpackFloatDecoder::inputProcessAligned() called, inbuf=" << reinterpret_cast( inbuf ) + << " firstBit=" << firstBit << " endBit=" << endBit << std::endl; #endif /// Read from inbuf, decode, store in destBuffer /// Repeat until have filled destBuffer, or completed all records @@ -674,7 +674,7 @@ size_t BitpackIntegerDecoder::inputProcessAligned( const char *inbuf, if ((reinterpret_cast(inbuf)) % sizeof(RegisterT)) throw E57_EXCEPTION2(E57_ERROR_INTERNAL, "inbuf=" + toString(reinterpret_cast(inbuf))); #endif - /// Verfiy first bit is in first word + /// Verify first bit is in first word if ( firstBit >= 8 * sizeof( RegisterT ) ) { throw E57_EXCEPTION2( E57_ERROR_INTERNAL, "firstBit=" + toString( firstBit ) ); @@ -777,7 +777,7 @@ size_t BitpackIntegerDecoder::inputProcessAligned( const char *inbuf, destBuffer_->setNextInt64( value ); } - /// Store the result in next avaiable position in the user's dest buffer + /// Store the result in next available position in the user's dest buffer /// Calc next bit alignment and which word it starts in bitOffset += bitsPerRecord_; diff --git a/src/E57Exception.cpp b/src/E57Exception.cpp index c2aa367..69b4f94 100644 --- a/src/E57Exception.cpp +++ b/src/E57Exception.cpp @@ -87,7 +87,7 @@ namespace e57 available about nodes in the tree. So if the ImageFile is closed (by calling ImageFile::close), the API user must be ready for many of the API functions to throw E57Exception(E57_ERROR_IMAGEFILE_NOT_OPEN). Secondly, regarding the - E57_ERROR_INTERNAL error, there is a lot of consistancy checking in the + E57_ERROR_INTERNAL error, there is a lot of consistency checking in the Reference Implementation, and there may be much more added. Even if some API routines do not now throw E57_ERROR_INTERNAL, they could some time in the future, or in different implementations. So the right to throw diff --git a/src/E57Format.cpp b/src/E57Format.cpp index 77d30cb..c526794 100644 --- a/src/E57Format.cpp +++ b/src/E57Format.cpp @@ -940,7 +940,7 @@ out as root nodes. It is possible to temporarily create small trees that are unattached to any ImageFile. In these temporary trees, the top-most node will be a root node. After the tree is attached to the ImageFile tree, the only root node will be the pre-created one of the ImageTree (the one returned by -ImageFile::root). The concept of @em attachement is slightly larger than that of +ImageFile::root). The concept of @em attachment is slightly larger than that of the parent-child relationship (see Node::isAttached and CompressedVectorNode::CompressedVectorNode for more details). @pre The destination ImageFile must be open (i.e. destImageFile().isOpen()). @@ -968,7 +968,7 @@ types, but a parent node can only be one of the 3 container node types (E57_STRUCTURE, E57_VECTOR, and E57_COMPRESSED_VECTOR). Each parent-child link has a string name (the elementName) associated with it (See Node::elementName for more details). More than one tree can be formed at any given time. Typically -small trees are temporarily constructed before attachement to an ImageFile so +small trees are temporarily constructed before attachment to an ImageFile so that they will be written to the disk. @b Warning: user algorithms that use this function to walk the tree must take @@ -1173,7 +1173,7 @@ before and after any operation on the object. An invariant is useful for testing correct operation of an implementation. Statements in an invariant can involve only externally visible state, or can refer to internal implementation-specific state that is not visible to the API user. The following C++ code checks -externally visible state for consistancy and throws an exception if the +externally visible state for consistency and throws an exception if the invariant is violated: @dontinclude E57Format.cpp @skip begin StructureNode::checkInvariant @@ -3303,7 +3303,7 @@ before and after any operation on the object. An invariant is useful for testing correct operation of an implementation. Statements in an invariant can involve only externally visible state, or can refer to internal implementation-specific state that is not visible to the API user. The following C++ code checks -externally visible state for consistancy and throws an exception if the +externally visible state for consistency and throws an exception if the invariant is violated: @dontinclude E57Format.cpp @skip begin ScaledIntegerNode::checkInvariant @@ -3319,7 +3319,7 @@ invariant is violated: be stored. @param [in] rawValue The raw integer value of the element. @param [in] minimum The smallest rawValue that the element may take. -@param [in] maximum The largest rawWalue that the element may take. +@param [in] maximum The largest rawValue that the element may take. @param [in] scale The scaling factor used to compute scaledValue from rawValue. @param [in] offset The offset factor used to compute scaledValue from diff --git a/src/E57XmlParser.cpp b/src/E57XmlParser.cpp index 64de022..7e267cb 100644 --- a/src/E57XmlParser.cpp +++ b/src/E57XmlParser.cpp @@ -526,7 +526,7 @@ void E57XmlParser::startElement( const XMLCh *const uri, const XMLCh *const loca { #ifdef E57_VERBOSE std::cout << "declared extension, prefix=" << toUString( attributes.getLocalName( i ) ) - << " URI=" << toUString( attributes.getValue( i ) ) << std::endl; + << " URI=" << toUString( attributes.getValue( i ) ) << std::endl; #endif imf_->extensionsAdd( toUString( attributes.getLocalName( i ) ), toUString( attributes.getValue( i ) ) ); } diff --git a/src/ReaderImpl.cpp b/src/ReaderImpl.cpp index c4beb9a..f473787 100644 --- a/src/ReaderImpl.cpp +++ b/src/ReaderImpl.cpp @@ -1218,7 +1218,7 @@ namespace e57 return true; } - // This funtion writes out the group data + // This function writes out the group data bool ReaderImpl::ReadData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount ) const { @@ -1297,7 +1297,7 @@ namespace e57 { ustring name = proto.get( protoIndex ).elementName(); NodeType type = proto.get( protoIndex ).type(); - bool scaled = (type == E57_SCALED_INTEGER); + bool scaled = ( type == E57_SCALED_INTEGER ); // E57_EXT_surface_normals ustring norExtUri; bool haveNormalsExt = imf_.extensionsLookupPrefix( "nor", norExtUri ); diff --git a/src/ReaderImpl.h b/src/ReaderImpl.h index e2faf3f..6570beb 100644 --- a/src/ReaderImpl.h +++ b/src/ReaderImpl.h @@ -94,7 +94,7 @@ namespace e57 //! @param [out] imageHeight The image height (in pixels). //! @param [out] imageSize This is the total number of bytes for the image blob. //! @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the projection - //! @return Returns true if sucessful + //! @return Returns true if successful bool GetImage2DNodeSizes( StructureNode image, Image2DType &imageType, int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize, Image2DType &imageMaskType ) const; diff --git a/src/SourceDestBufferImpl.cpp b/src/SourceDestBufferImpl.cpp index 5b1ed6c..9db0122 100644 --- a/src/SourceDestBufferImpl.cpp +++ b/src/SourceDestBufferImpl.cpp @@ -388,7 +388,7 @@ int64_t SourceDestBufferImpl::getNextInt64( double scale, double offset ) /// Reverse scale (undo scaling) of a user's number to get raw value to put /// in file. - /// Encorporating the scale is optional (requested by user when constructing + /// Incorporating the scale is optional (requested by user when constructing /// the sdbuf). If the user did not request scaling, then we get raw values /// from user's buffer. if ( !doScaling_ ) @@ -807,7 +807,7 @@ void SourceDestBufferImpl::setNextInt64( int64_t value, double scale, double off /// Apply a scale and offset to numbers from file before puting in user's /// buffer. - /// Encorporating the scale is optional (requested by user when constructing + /// Incorporating the scale is optional (requested by user when constructing /// the sdbuf). If the user did not request scaling, then we send raw values /// to user's buffer. if ( !doScaling_ ) diff --git a/src/StringNodeImpl.cpp b/src/StringNodeImpl.cpp index ab8da36..11a9fb8 100644 --- a/src/StringNodeImpl.cpp +++ b/src/StringNodeImpl.cpp @@ -106,7 +106,7 @@ namespace e57 size_t currentPosition = 0; size_t len = value_.length(); - /// Loop, searching for occurences of "]]>", which will be split across + /// Loop, searching for occurrences of "]]>", which will be split across /// two CDATA directives while ( currentPosition < len ) { diff --git a/src/WriterImpl.cpp b/src/WriterImpl.cpp index 4e94acb..c1d3afc 100644 --- a/src/WriterImpl.cpp +++ b/src/WriterImpl.cpp @@ -38,7 +38,7 @@ namespace e57 { // We are using the E57 v1.0 data format standard fieldnames. // The standard fieldnames are used without an extension prefix (in the default namespace). - // We explicitly register it for completeness (the reference implementaion would do it for us, if we didn't). + // We explicitly register it for completeness (the reference implementation would do it for us, if we didn't). imf_.extensionsAdd( "", E57_V1_0_URI ); // Set per-file properties. @@ -907,7 +907,7 @@ namespace e57 // E57_EXT_surface_normals if ( data3DHeader.pointFields.normalX || data3DHeader.pointFields.normalY || data3DHeader.pointFields.normalZ ) { - // make sure we declare the extesion before using the fields with prefix + // make sure we declare the extension before using the fields with prefix ustring norExtUri; if ( !imf_.extensionsLookupPrefix( "nor", norExtUri ) ) { @@ -1069,7 +1069,7 @@ namespace e57 template CompressedVectorWriter WriterImpl::SetUpData3DPointsData( int64_t dataIndex, size_t pointCount, const Data3DPointsData_t &buffers ); - // This funtion writes out the group data + // This function writes out the group data bool WriterImpl::WriteData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount ) {