[omim] [coding] Remove bit_shift.hpp.

This commit is contained in:
Maxim Pimenov 2015-07-14 13:17:32 +03:00 committed by Alex Zolotarev
parent b798afdb64
commit ec38e53941
5 changed files with 0 additions and 57 deletions

View file

@ -1,26 +0,0 @@
#pragma once
#include "std/limits.hpp"
namespace bits
{
template <class T>
struct bits_of
{
enum
{
value = sizeof(T) * CHAR_BIT
};
};
template <class T>
T ror(T val, unsigned int n)
{
enum
{
bits = bits_of<T>::value
};
n = n % bits;
return (val >> n) | (val << (bits - n));
}
}

View file

@ -75,7 +75,6 @@ HEADERS += \
bzip2_compressor.hpp \
gzip_compressor.hpp \
timsort/timsort.hpp \
bit_shift.hpp \
base64.hpp \
sha2.hpp \
value_opt_string.hpp \

View file

@ -1,25 +0,0 @@
#include "base/SRC_FIRST.hpp"
#include "testing/testing.hpp"
#include "std/limits.hpp"
#include "coding/bit_shift.hpp"
UNIT_TEST(BitShift)
{
TEST_EQUAL(INT_MIN, bits::ror(1, 1), ());
uint8_t ui8 = 1;
TEST_EQUAL(0x80U, bits::ror(ui8, 1), ());
uint16_t ui16 = 1;
TEST_EQUAL(0x8000U, bits::ror(ui16, 1), ());
uint32_t ui32 = 1;
TEST_EQUAL(0x80000000U, bits::ror(ui32, 1), ());
uint64_t ui64 = 1;
TEST_EQUAL(0x8000000000000000LL, bits::ror(ui64, 1), ());
uint16_t v = 0x58b1;
TEST_EQUAL(0x2b16, bits::ror(v, 3), ());
TEST_EQUAL(v, bits::ror(v, 32), ());
TEST_EQUAL(v, bits::ror(v, 0), ());
}

View file

@ -15,7 +15,6 @@ SOURCES += ../../testing/testingmain.cpp \
arithmetic_codec_test.cpp \
base64_for_user_id_test.cpp \
base64_test.cpp \
bit_shift_test.cpp \
bit_streams_test.cpp \
# blob_storage_test.cpp \
bzip2_test.cpp \

View file

@ -18,7 +18,6 @@
675342811A3F588C00A0A8C3 /* arithmetic_codec.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753422A1A3F588B00A0A8C3 /* arithmetic_codec.hpp */; };
675342821A3F588C00A0A8C3 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6753422B1A3F588B00A0A8C3 /* base64.cpp */; };
675342831A3F588C00A0A8C3 /* base64.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753422C1A3F588B00A0A8C3 /* base64.hpp */; };
675342841A3F588C00A0A8C3 /* bit_shift.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753422D1A3F588B00A0A8C3 /* bit_shift.hpp */; };
675342851A3F588C00A0A8C3 /* bit_streams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6753422E1A3F588B00A0A8C3 /* bit_streams.cpp */; };
675342861A3F588C00A0A8C3 /* bit_streams.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753422F1A3F588B00A0A8C3 /* bit_streams.hpp */; };
675342871A3F588C00A0A8C3 /* blob_indexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675342301A3F588B00A0A8C3 /* blob_indexer.cpp */; };
@ -115,7 +114,6 @@
6753422A1A3F588B00A0A8C3 /* arithmetic_codec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arithmetic_codec.hpp; sourceTree = "<group>"; };
6753422B1A3F588B00A0A8C3 /* base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = base64.cpp; sourceTree = "<group>"; };
6753422C1A3F588B00A0A8C3 /* base64.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = base64.hpp; sourceTree = "<group>"; };
6753422D1A3F588B00A0A8C3 /* bit_shift.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bit_shift.hpp; sourceTree = "<group>"; };
6753422E1A3F588B00A0A8C3 /* bit_streams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bit_streams.cpp; sourceTree = "<group>"; };
6753422F1A3F588B00A0A8C3 /* bit_streams.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bit_streams.hpp; sourceTree = "<group>"; };
675342301A3F588B00A0A8C3 /* blob_indexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blob_indexer.cpp; sourceTree = "<group>"; };
@ -258,7 +256,6 @@
6753422A1A3F588B00A0A8C3 /* arithmetic_codec.hpp */,
6753422B1A3F588B00A0A8C3 /* base64.cpp */,
6753422C1A3F588B00A0A8C3 /* base64.hpp */,
6753422D1A3F588B00A0A8C3 /* bit_shift.hpp */,
6753422E1A3F588B00A0A8C3 /* bit_streams.cpp */,
6753422F1A3F588B00A0A8C3 /* bit_streams.hpp */,
675342301A3F588B00A0A8C3 /* blob_indexer.cpp */,
@ -407,7 +404,6 @@
675342AA1A3F588C00A0A8C3 /* lodepng_io.hpp in Headers */,
675342BC1A3F588C00A0A8C3 /* reader.hpp in Headers */,
675342D21A3F588C00A0A8C3 /* zip_creator.hpp in Headers */,
675342841A3F588C00A0A8C3 /* bit_shift.hpp in Headers */,
675342A91A3F588C00A0A8C3 /* lodepng_io_private.hpp in Headers */,
675342B11A3F588C00A0A8C3 /* multilang_utf8_string.hpp in Headers */,
675342D41A3F588C00A0A8C3 /* zip_reader.hpp in Headers */,