From d53e057f92fb74a6655f33388d2ffcbc7954489d Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Thu, 5 Apr 2012 13:42:49 -0500 Subject: [PATCH] Fix typos. --- indexlib/bitio.h | 10 +++++----- indexlib/bitio.tcc | 6 +++--- indexlib/leafdata.cpp | 6 +++--- indexlib/leafdata.h | 2 +- indexlib/mempool.tcc | 2 +- indexlib/memvector.h | 14 +++++++------- indexlib/memvector.tcc | 10 +++++----- indexlib/thing.h | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/indexlib/bitio.h b/indexlib/bitio.h index 40f4ef7d..913f44ea 100644 --- a/indexlib/bitio.h +++ b/indexlib/bitio.h @@ -50,11 +50,11 @@ namespace byte_io { T read( const unsigned char* ); template - struct byte_lenght_struct { }; + struct byte_length_struct { }; template - struct byte_lenght_struct { - static const int value = byte_lenght_struct::value; + struct byte_length_struct { + static const int value = byte_length_struct::value; }; @@ -63,8 +63,8 @@ namespace byte_io { * for supported types. */ template - unsigned byte_lenght() { - return byte_lenght_struct::value; + unsigned byte_length() { + return byte_length_struct::value; } } diff --git a/indexlib/bitio.tcc b/indexlib/bitio.tcc index 2779cfed..f6dbdfc0 100644 --- a/indexlib/bitio.tcc +++ b/indexlib/bitio.tcc @@ -39,7 +39,7 @@ namespace byte_io { } template<> - struct byte_lenght_struct { + struct byte_length_struct { static const int value = 1; }; @@ -60,7 +60,7 @@ namespace byte_io { } template<> - struct byte_lenght_struct { + struct byte_length_struct { static const int value = 2; }; @@ -84,7 +84,7 @@ namespace byte_io { return res; } template<> - struct byte_lenght_struct { + struct byte_length_struct { static const int value = 4; }; } diff --git a/indexlib/leafdata.cpp b/indexlib/leafdata.cpp index 70773330..db61119a 100644 --- a/indexlib/leafdata.cpp +++ b/indexlib/leafdata.cpp @@ -50,7 +50,7 @@ uint32_t leaf_data::get_reference( unsigned idx ) const { } bool leaf_data::can_add( uint32_t ref ) const { - if ( ( capacity() - usedbytes() ) > ( 1 + byte_io::byte_lenght() ) ) return true; + if ( ( capacity() - usedbytes() ) > ( 1 + byte_io::byte_length() ) ) return true; if ( capacity() == usedbytes() ) return false; uint32_t last = 0; for ( iterator first = begin(), past = end(); first != past; ++first ) { @@ -97,7 +97,7 @@ void leaf_data::add_reference( uint32_t ref ) { } else { *target++ = 0; byte_io::write( target, ref ); - set_usedbytes( usedbytes() + 1 + byte_io::byte_lenght() ); + set_usedbytes( usedbytes() + 1 + byte_io::byte_length() ); } assert( usedbytes() <= capacity() ); } @@ -123,7 +123,7 @@ void leaf_data::remove_reference( uint32_t ref ) { else { ++iter; byte_io::write(iter,byte_io::read(iter)-1); - iter += byte_io::byte_lenght(); + iter += byte_io::byte_length(); } } } diff --git a/indexlib/leafdata.h b/indexlib/leafdata.h index fa08645e..4b54a4e8 100644 --- a/indexlib/leafdata.h +++ b/indexlib/leafdata.h @@ -60,7 +60,7 @@ struct leafdata_iterator : public std::iterator( data_ ); - data_ += byte_io::byte_lenght(); + data_ += byte_io::byte_length(); } return value_ - 1; } diff --git a/indexlib/mempool.tcc b/indexlib/mempool.tcc index 19a5e6d4..a130bffe 100644 --- a/indexlib/mempool.tcc +++ b/indexlib/mempool.tcc @@ -135,7 +135,7 @@ void mempool::print( std::ostream& out ) const { template memory_reference mempool::free_list( unsigned order ) { assert( order ); - return memory_reference( manager_->rw_base( order * byte_io::byte_lenght() ) ); + return memory_reference( manager_->rw_base( order * byte_io::byte_length() ) ); } template diff --git a/indexlib/memvector.h b/indexlib/memvector.h index d4cc446e..446fddf9 100644 --- a/indexlib/memvector.h +++ b/indexlib/memvector.h @@ -72,23 +72,23 @@ struct memory_iterator : public std::iterator(); + data_ += byte_io::byte_length(); return *this; } memory_iterator& operator --() { - data_ -= byte_io::byte_lenght(); + data_ -= byte_io::byte_length(); return *this; } memory_iterator& operator += ( ptrdiff_t dif ) { - data_ += dif * byte_io::byte_lenght(); + data_ += dif * byte_io::byte_length(); return *this; } ptrdiff_t operator - ( const memory_iterator& other ) const { - assert( !( ( raw() - other.raw() )%byte_io::byte_lenght() ) ); - return ( raw() - other.raw() )/byte_io::byte_lenght(); + assert( !( ( raw() - other.raw() )%byte_io::byte_length() ) ); + return ( raw() - other.raw() )/byte_io::byte_length(); } bool operator < ( const memory_iterator& other ) const { @@ -211,8 +211,8 @@ struct memvector { boost::scoped_ptr data_; unsigned char* address_of( unsigned i ) { return data_->rw_base( - byte_io::byte_lenght() + - i * byte_io::byte_lenght() ); + byte_io::byte_length() + + i * byte_io::byte_length() ); } const unsigned char* address_of( unsigned i ) const { return const_cast( this )->address_of( i ); diff --git a/indexlib/memvector.tcc b/indexlib/memvector.tcc index 792c389c..0acfef58 100644 --- a/indexlib/memvector.tcc +++ b/indexlib/memvector.tcc @@ -9,7 +9,7 @@ memvector::memvector( std::string fname ): data_( new mmap_manager( fname ) ) { if ( !data_->size() ) { - data_->resize( byte_io::byte_lenght() ); + data_->resize( byte_io::byte_length() ); byte_io::write( data_->rw_base( 0 ), 0 ); } } @@ -31,7 +31,7 @@ void memvector::resize( size_type n_s ) { if ( size() >= n_s ) return; using namespace byte_io; - data_->resize( n_s * byte_lenght() + byte_lenght() ); + data_->resize( n_s * byte_length() + byte_length() ); iterator p_end = end(); write( data_->rw_base( 0 ), n_s ); while ( p_end != end() ) { @@ -45,10 +45,10 @@ void memvector::insert( const_iterator where, const value_type v ) { assert( !( where < begin() ) ); assert( where <= end() ); const unsigned to_idx = where.raw() - data_->ronly_base( 0 ); - data_->resize( ( size() + 1 ) * byte_io::byte_lenght() + byte_io::byte_lenght() ); + data_->resize( ( size() + 1 ) * byte_io::byte_length() + byte_io::byte_length() ); unsigned char* to = data_->rw_base( to_idx ); // make space: - std::memmove( to + byte_io::byte_lenght(), to, end().raw() - to ); + std::memmove( to + byte_io::byte_length(), to, end().raw() - to ); byte_io::write( to, v ); byte_io::write( data_->rw_base( 0 ), size() + 1 ); } @@ -68,7 +68,7 @@ void memvector::erase( iterator where ) { template void memvector::clear() { - data_->resize( byte_io::byte_lenght() ); + data_->resize( byte_io::byte_length() ); byte_io::write( data_->rw_base( 0 ), 0 ); } diff --git a/indexlib/thing.h b/indexlib/thing.h index 923bad33..0fc495f7 100644 --- a/indexlib/thing.h +++ b/indexlib/thing.h @@ -157,8 +157,8 @@ struct simple_accessor { write( out, p.cast_to_uint32() ); \ } \ template<> \ - struct byte_lenght_struct< pointer > { \ - static const unsigned value = byte_lenght_struct::value; \ + struct byte_length_struct< pointer > { \ + static const unsigned value = byte_length_struct::value; \ }; \ } // namespace