|
1 | | -use fastpfor::{cpp, rust}; |
| 1 | +use fastpfor::{AnyLenCodec, cpp, rust}; |
2 | 2 |
|
3 | | -pub type BoxedCppCodec = Box<dyn cpp::Codec32>; |
| 3 | +pub type BoxedCppCodec = Box<dyn AnyLenCodec>; |
4 | 4 |
|
5 | 5 | #[derive(arbitrary::Arbitrary)] |
6 | 6 | pub struct FuzzInput<C> { |
@@ -77,41 +77,47 @@ pub enum CppCodec { |
77 | 77 |
|
78 | 78 | impl From<CppCodec> for BoxedCppCodec { |
79 | 79 | fn from(codec: CppCodec) -> Self { |
80 | | - use cpp::*; |
| 80 | + use cpp::{ |
| 81 | + BP32, Copy as CppCopy, FastBinaryPacking8, FastBinaryPacking16, FastBinaryPacking32, |
| 82 | + FastPFor128, FastPFor256, MaskedVByte, NewPFor, OptPFor, PFor, PFor2008, |
| 83 | + SimdBinaryPacking, SimdFastPFor128, SimdFastPFor256, SimdGroupSimple, |
| 84 | + SimdGroupSimpleRingBuf, SimdNewPFor, SimdOptPFor, SimdPFor, SimdSimplePFor, |
| 85 | + StreamVByte, VByte, VarInt, VarIntGb, |
| 86 | + }; |
81 | 87 | match codec { |
82 | | - CppCodec::BP32 => Box::new(BP32Codec::default()), |
83 | | - CppCodec::Copy => Box::new(CopyCodec::default()), |
84 | | - CppCodec::FastBinaryPacking8 => Box::new(FastBinaryPacking8Codec::default()), |
85 | | - CppCodec::FastPFor128 => Box::new(FastPFor128Codec::default()), |
86 | | - CppCodec::FastPFor256 => Box::new(FastPFor256Codec::default()), |
87 | | - CppCodec::FastBinaryPacking16 => Box::new(FastBinaryPacking16Codec::default()), |
88 | | - CppCodec::FastBinaryPacking32 => Box::new(FastBinaryPacking32Codec::default()), |
89 | | - CppCodec::MaskedVByte => Box::new(MaskedVByteCodec::default()), |
90 | | - CppCodec::NewPFor => Box::new(NewPForCodec::default()), |
91 | | - CppCodec::OptPFor => Box::new(OptPForCodec::default()), |
92 | | - CppCodec::PFor2008 => Box::new(PFor2008Codec::default()), |
93 | | - CppCodec::PFor => Box::new(PForCodec::default()), |
94 | | - CppCodec::SimdBinaryPacking => Box::new(SimdBinaryPackingCodec::default()), |
95 | | - CppCodec::SimdFastPFor128 => Box::new(SimdFastPFor128Codec::default()), |
96 | | - CppCodec::SimdFastPFor256 => Box::new(SimdFastPFor256Codec::default()), |
97 | | - CppCodec::SimdGroupSimple => Box::new(SimdGroupSimpleCodec::default()), |
98 | | - CppCodec::SimdGroupSimpleRingBuf => Box::new(SimdGroupSimpleRingBufCodec::default()), |
99 | | - CppCodec::SimdNewPFor => Box::new(SimdNewPForCodec::default()), |
100 | | - CppCodec::SimdOptPFor => Box::new(SimdOptPForCodec::default()), |
101 | | - CppCodec::SimdPFor => Box::new(SimdPForCodec::default()), |
102 | | - CppCodec::SimdSimplePFor => Box::new(SimdSimplePForCodec::default()), |
| 88 | + CppCodec::BP32 => Box::new(BP32::default()), |
| 89 | + CppCodec::Copy => Box::new(CppCopy::default()), |
| 90 | + CppCodec::FastBinaryPacking8 => Box::new(FastBinaryPacking8::default()), |
| 91 | + CppCodec::FastPFor128 => Box::new(FastPFor128::default()), |
| 92 | + CppCodec::FastPFor256 => Box::new(FastPFor256::default()), |
| 93 | + CppCodec::FastBinaryPacking16 => Box::new(FastBinaryPacking16::default()), |
| 94 | + CppCodec::FastBinaryPacking32 => Box::new(FastBinaryPacking32::default()), |
| 95 | + CppCodec::MaskedVByte => Box::new(MaskedVByte::default()), |
| 96 | + CppCodec::NewPFor => Box::new(NewPFor::default()), |
| 97 | + CppCodec::OptPFor => Box::new(OptPFor::default()), |
| 98 | + CppCodec::PFor2008 => Box::new(PFor2008::default()), |
| 99 | + CppCodec::PFor => Box::new(PFor::default()), |
| 100 | + CppCodec::SimdBinaryPacking => Box::new(SimdBinaryPacking::default()), |
| 101 | + CppCodec::SimdFastPFor128 => Box::new(SimdFastPFor128::default()), |
| 102 | + CppCodec::SimdFastPFor256 => Box::new(SimdFastPFor256::default()), |
| 103 | + CppCodec::SimdGroupSimple => Box::new(SimdGroupSimple::default()), |
| 104 | + CppCodec::SimdGroupSimpleRingBuf => Box::new(SimdGroupSimpleRingBuf::default()), |
| 105 | + CppCodec::SimdNewPFor => Box::new(SimdNewPFor::default()), |
| 106 | + CppCodec::SimdOptPFor => Box::new(SimdOptPFor::default()), |
| 107 | + CppCodec::SimdPFor => Box::new(SimdPFor::default()), |
| 108 | + CppCodec::SimdSimplePFor => Box::new(SimdSimplePFor::default()), |
103 | 109 | // CppCodec::Simple16 => Box::new(Simple16Codec::default()), |
104 | 110 | // CppCodec::Simple8b => Box::new(Simple8bCodec::default()), |
105 | 111 | // CppCodec::Simple8bRle => Box::new(Simple8bRleCodec::default()), |
106 | 112 | // CppCodec::Simple9 => Box::new(Simple9Codec::default()), |
107 | 113 | // CppCodec::Simple9Rle => Box::new(Simple9RleCodec::default()), |
108 | 114 | // CppCodec::SimplePFor => Box::new(SimplePForCodec::default()), |
109 | 115 | // CppCodec::Snappy => Box::new(SnappyCodec::default()), |
110 | | - CppCodec::StreamVByte => Box::new(StreamVByteCodec::default()), |
111 | | - CppCodec::VByte => Box::new(VByteCodec::default()), |
112 | | - CppCodec::VarInt => Box::new(VarIntCodec::default()), |
| 116 | + CppCodec::StreamVByte => Box::new(StreamVByte::default()), |
| 117 | + CppCodec::VByte => Box::new(VByte::default()), |
| 118 | + CppCodec::VarInt => Box::new(VarInt::default()), |
113 | 119 | // CppCodec::VarIntG8iu => Box::new(VarIntG8iuCodec::default()), |
114 | | - CppCodec::VarIntGb => Box::new(VarIntGbCodec::default()), |
| 120 | + CppCodec::VarIntGb => Box::new(VarIntGb::default()), |
115 | 121 | // CppCodec::VsEncoding => Box::new(VsEncodingCodec::default()), |
116 | 122 | } |
117 | 123 | } |
|
0 commit comments