Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix indentation
  • Loading branch information
vcloarec authored and nyalldawson committed May 24, 2023
1 parent 2e0b299 commit fcc8a5c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
8 changes: 4 additions & 4 deletions external/mdal/3rdparty/libplyxx.h
Expand Up @@ -79,7 +79,7 @@ namespace libply
virtual IProperty &operator=( unsigned char value ) = 0;
virtual IProperty &operator=( char value ) = 0;
virtual IProperty &operator=( unsigned short value ) = 0;
virtual IProperty &operator=( short value) = 0;
virtual IProperty &operator=( short value ) = 0;
virtual IProperty &operator=( unsigned int value ) = 0;
virtual IProperty &operator=( int value ) = 0;
virtual IProperty &operator=( float value ) = 0;
Expand All @@ -105,7 +105,7 @@ namespace libply

virtual ~ScalarProperty() = default;

virtual ScalarProperty &operator= ( unsigned char value) override
virtual ScalarProperty &operator= ( unsigned char value ) override
{
m_value = static_cast<InternalType>( value );
return *this;
Expand All @@ -115,12 +115,12 @@ namespace libply
m_value = static_cast<InternalType>( value );
return *this;
};
virtual ScalarProperty &operator= ( unsigned short value) override
virtual ScalarProperty &operator= ( unsigned short value ) override
{
m_value = static_cast<InternalType>( value );
return *this;
};
virtual ScalarProperty &operator= ( short value ) override
virtual ScalarProperty &operator= ( short value ) override
{
m_value = static_cast<InternalType>( value );
return *this;
Expand Down
14 changes: 8 additions & 6 deletions external/mdal/3rdparty/libplyxx/libplyxx.cpp
Expand Up @@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Updated (c) 2021 / 23 Runette Software Ltd to make multiplatform, to complete the
Updated (c) 2021 / 23 Runette Software Ltd to make multiplatform, to complete the
typemaps and add voxel types.
Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace libply

std::string File::format() const
{
return formatString(m_parser->format);
return formatString( m_parser->format );
}


Expand Down Expand Up @@ -381,10 +381,11 @@ namespace libply
for ( PropertyDefinition p : properties )
{
uint32_t endian;
if ( format == File::Format::BINARY_LITTLE_ENDIAN)
if ( format == File::Format::BINARY_LITTLE_ENDIAN )
{
endian = LITTLE_ENDIAN;
} else
}
else
{
endian = BIG_ENDIAN;
}
Expand Down Expand Up @@ -581,7 +582,8 @@ namespace libply
if ( format == File::Format::BINARY_LITTLE_ENDIAN )
{
endian = LITTLE_ENDIAN;
} else
}
else
{
endian = BIG_ENDIAN;
}
Expand Down Expand Up @@ -662,7 +664,7 @@ namespace libply
file << "ply" << std::endl;
file << "format " << formatString( m_format ) << " 1.0" << std::endl;
file << "obj_info Generated by MDAL" << std::endl;
for( const std::pair<const std::string, std::string>& item : metadata )
for ( const std::pair<const std::string, std::string> &item : metadata )
{
file << "comment " << item.first << ": " << item.second << std::endl;
}
Expand Down
22 changes: 11 additions & 11 deletions external/mdal/3rdparty/libplyxx/libplyxx_internal.h
Expand Up @@ -108,24 +108,24 @@ namespace libply
};

template <typename T>
T endian_convert(T w, uint32_t endian)
T endian_convert( T w, uint32_t endian )
{
// This gets optimized out into if (endian == host_endian) return w;
union { uint64_t quad; uint32_t islittle; } t;
t.quad = 1;
if (t.islittle ^ endian) return w;
if ( t.islittle ^ endian ) return w;

auto ptr = reinterpret_cast<std::uint8_t*>(&w);
std::array<std::uint8_t, sizeof(T)> raw_src, raw_dst;
auto ptr = reinterpret_cast<std::uint8_t *>( &w );
std::array<std::uint8_t, sizeof( T )> raw_src, raw_dst;

for(std::size_t i = 0; i < sizeof(T); ++i)
raw_src[i] = ptr[i];
for ( std::size_t i = 0; i < sizeof( T ); ++i )
raw_src[i] = ptr[i];

std::reverse_copy(raw_src.begin(), raw_src.end(), raw_dst.begin());
std::reverse_copy( raw_src.begin(), raw_src.end(), raw_dst.begin() );

for(std::size_t i = 0; i < sizeof(T); ++i)
ptr[i] = raw_dst[i];
return *reinterpret_cast<T*>(ptr);
for ( std::size_t i = 0; i < sizeof( T ); ++i )
ptr[i] = raw_dst[i];
return *reinterpret_cast<T *>( ptr );
};

/// Type conversion functions.
Expand Down Expand Up @@ -244,7 +244,7 @@ namespace libply

inline std::stringstream &write_convert_DOUBLE( IProperty &property, std::stringstream &ss )
{
ss << MDAL::doubleToString( static_cast<double>( property ), 12);
ss << MDAL::doubleToString( static_cast<double>( property ), 12 );
return ss;
}

Expand Down

0 comments on commit fcc8a5c

Please sign in to comment.