Skip to content

Commit

Permalink
Rename CS8 -> CS8_ to avoid conflicts with macros in termios.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mutability committed Jun 23, 2019
1 parent f8e3ff1 commit 8cbd2f6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions convert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SampleConverter::Pointer SampleConverter::Create(SampleFormat format) {
switch (format) {
case SampleFormat::CU8:
return Pointer(new CU8Converter());
case SampleFormat::CS8:
case SampleFormat::CS8_:
return Pointer(new CS8Converter());
case SampleFormat::CS16H:
return Pointer(new CS16HConverter());
Expand Down Expand Up @@ -109,7 +109,7 @@ void CU8Converter::ConvertMagSq(Bytes::const_iterator begin, Bytes::const_iterat
}
}

CS8Converter::CS8Converter() : SampleConverter(SampleFormat::CS8) {
CS8Converter::CS8Converter() : SampleConverter(SampleFormat::CS8_) {
cs8_alias u;

int i, q;
Expand Down
8 changes: 4 additions & 4 deletions convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@

namespace flightaware::uat {
// Describes a sample data layout:
// CU8 - interleaved I/Q data, 8 bit unsigned integers
// CS8 - interleaved I/Q data, 8 bit signed integers
// CU8 - interleaved I/Q data, 8 bit unsigned integers
// CS8_ - interleaved I/Q data, 8 bit signed integers
// CS16H - interleaved I/Q data, 16 bit signed integers, host byte order
// CF32H - interleaved I/Q data, 32 bit signed floats, host byte order
enum class SampleFormat { CU8, CS8, CS16H, CF32H, UNKNOWN };
enum class SampleFormat { CU8, CS8_, CS16H, CF32H, UNKNOWN };

// Return the number of bytes for 1 sample in the given format
inline static unsigned BytesPerSample(SampleFormat f) {
switch (f) {
case SampleFormat::CU8:
return 2;
case SampleFormat::CS8:
case SampleFormat::CS8_:
return 2;
case SampleFormat::CS16H:
return 4;
Expand Down
2 changes: 1 addition & 1 deletion dump978_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace flightaware::uat {
// clang-format off
static std::map<std::string, SampleFormat> formats = {
{"CU8", SampleFormat::CU8},
{"CS8", SampleFormat::CS8},
{"CS8", SampleFormat::CS8_},
{"CS16H", SampleFormat::CS16H},
{"CF32H", SampleFormat::CF32H}
};
Expand Down
4 changes: 2 additions & 2 deletions soapy_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static std::string FormatToSoapy(SampleFormat format) {
// clang-format off
static const std::map<SampleFormat,std::string> lookup = {
{ SampleFormat::CU8, SOAPY_SDR_CU8 },
{ SampleFormat::CS8, SOAPY_SDR_CS8 },
{ SampleFormat::CS8_, SOAPY_SDR_CS8 },
{ SampleFormat::CS16H, SOAPY_SDR_CS16 },
{ SampleFormat::CF32H, SOAPY_SDR_CF32 }
};
Expand All @@ -69,7 +69,7 @@ static SampleFormat SoapyToFormat(std::string format) {
// clang-format off
static const std::map<std::string,SampleFormat> lookup = {
{ SOAPY_SDR_CU8, SampleFormat::CU8 },
{ SOAPY_SDR_CS8, SampleFormat::CS8 },
{ SOAPY_SDR_CS8, SampleFormat::CS8_ },
{ SOAPY_SDR_CS16, SampleFormat::CS16H },
{ SOAPY_SDR_CF32, SampleFormat::CF32H }
};
Expand Down

0 comments on commit 8cbd2f6

Please sign in to comment.