Rename all protos to end with 'Proto' to avoid name conflicts.

This commit is contained in:
David Given
2021-05-13 18:05:08 +02:00
parent 639588fa68
commit 5a186b6960
37 changed files with 162 additions and 165 deletions

View File

@@ -16,13 +16,13 @@
class Sector;
class SectorSet;
class Fluxmap;
class BrotherInput;
class BrotherOutput;
class BrotherInputProto;
class BrotherOutputProto;
class BrotherDecoder : public AbstractDecoder
{
public:
BrotherDecoder(const BrotherInput& config) {}
BrotherDecoder(const BrotherInputProto& config) {}
virtual ~BrotherDecoder() {}
RecordType advanceToNextRecord();
@@ -33,14 +33,14 @@ public:
class BrotherEncoder : public AbstractEncoder
{
public:
BrotherEncoder(const BrotherOutput& config):
BrotherEncoder(const BrotherOutputProto& config):
_config(config)
{}
virtual ~BrotherEncoder() {}
private:
const BrotherOutput& _config;
const BrotherOutputProto& _config;
public:
std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors);

View File

@@ -1,13 +1,13 @@
syntax = "proto2";
message BrotherInput {}
message BrotherInputProto {}
enum BrotherFormat {
BROTHER240 = 0;
BROTHER120 = 1;
};
message BrotherOutput {
message BrotherOutputProto {
optional double clock_rate_us = 1 [default = 3.83];
optional double post_index_gap_ms = 2 [default = 1.0];
optional double sector_spacing_ms = 3 [default = 16.2];

View File

@@ -4,8 +4,8 @@
#include "decoders/decoders.h"
#include "encoders/encoders.h"
class IBMInput;
class IBMOutput;
class IBMInputProto;
class IBMOutputProto;
/* IBM format (i.e. ordinary PC floppies). */
@@ -35,7 +35,7 @@ struct IbmIdam
class IbmDecoder : public AbstractDecoder
{
public:
IbmDecoder(const IBMInput& config):
IbmDecoder(const IBMInputProto& config):
_config(config)
{}
@@ -46,7 +46,7 @@ public:
std::set<unsigned> requiredSectors(Track& track) const;
private:
const IBMInput& _config;
const IBMInputProto& _config;
unsigned _currentSectorSize;
unsigned _currentHeaderLength;
};
@@ -54,7 +54,7 @@ private:
class IbmEncoder : public AbstractEncoder
{
public:
IbmEncoder(const IBMOutput& config):
IbmEncoder(const IBMOutputProto& config):
_config(config)
{}
@@ -70,7 +70,7 @@ private:
void writeSync();
private:
const IBMOutput& _config;
const IBMOutputProto& _config;
std::vector<bool> _bits;
unsigned _cursor;
bool _lastBit;

View File

@@ -2,13 +2,13 @@ syntax = "proto2";
import "lib/common.proto";
message IBMInput {
message IBMInputProto {
optional int32 sector_base = 1 [default=0];
optional bool ignore_side_byte = 2 [default=false];
optional Range required_sectors = 3;
optional RangeProto required_sectors = 3;
}
message IBMOutput {
message IBMOutputProto {
optional double track_length_ms = 1;
optional int32 sector_size = 2 [default=512];
optional bool emit_iam = 3 [default=true];

View File

@@ -2,9 +2,7 @@ syntax = "proto2";
import "google/protobuf/descriptor.proto";
message None {}
message Range {
message RangeProto {
optional int32 start = 1;
optional int32 step = 2 [default = 1];
optional int32 end = 3;

View File

@@ -6,56 +6,56 @@ import "lib/imagereader/img.proto";
import "lib/fluxsource/fluxsource.proto";
import "lib/common.proto";
message Config {
message InputFile {
optional string filename = 1;
oneof format {
ImgInputOutput img = 2;
}
message InputFileProto {
optional string filename = 1;
oneof format {
ImgInputOutputProto img = 2;
}
message InputDisk {
oneof source {
string fluxfile = 1;
HardwareInput drive = 2;
TestPatternInput test_pattern = 3;
}
}
message OutputFile {
optional string filename = 1;
oneof format {
ImgInputOutput img = 2;
}
}
message OutputDisk {
oneof dest {
string fluxfile = 1;
int32 drive = 2;
}
}
message Input {
oneof input {
InputFile file = 1;
InputDisk disk = 2;
}
}
message Output {
oneof output {
OutputFile file = 1;
OutputDisk disk = 2;
}
}
optional Input input = 1;
optional Output output = 2;
optional Encoder encoder = 3;
optional Decoder decoder = 4;
optional Range cylinders = 5;
optional Range heads = 6;
}
message InputDiskProto {
oneof source {
string fluxfile = 1;
HardwareInputProto drive = 2;
TestPatternInputProto test_pattern = 3;
}
}
message OutputFileProto {
optional string filename = 1;
oneof format {
ImgInputOutputProto img = 2;
}
}
message OutputDiskProto {
oneof dest {
string fluxfile = 1;
int32 drive = 2;
}
}
message InputProto {
oneof input {
InputFileProto file = 1;
InputDiskProto disk = 2;
}
}
message OutputProto {
oneof output {
OutputFileProto file = 1;
OutputDiskProto disk = 2;
}
}
message ConfigProto {
optional InputProto input = 1;
optional OutputProto output = 2;
optional EncoderProto encoder = 3;
optional DecoderProto decoder = 4;
optional RangeProto cylinders = 5;
optional RangeProto heads = 6;
}

View File

@@ -15,14 +15,14 @@
#include "fmt/format.h"
#include <numeric>
std::unique_ptr<AbstractDecoder> AbstractDecoder::create(const Decoder& config)
std::unique_ptr<AbstractDecoder> AbstractDecoder::create(const DecoderProto& config)
{
switch (config.format_case())
{
case Decoder::kIbm:
case DecoderProto::kIbm:
return std::unique_ptr<AbstractDecoder>(new IbmDecoder(config.ibm()));
case Decoder::kBrother:
case DecoderProto::kBrother:
return std::unique_ptr<AbstractDecoder>(new BrotherDecoder(config.brother()));
default:

View File

@@ -12,7 +12,7 @@ class FluxmapReader;
class RawRecord;
class RawBits;
class Track;
class Decoder;
class DecoderProto;
typedef std::vector<std::unique_ptr<RawRecord>> RawRecordVector;
typedef std::vector<std::unique_ptr<Sector>> SectorVector;
@@ -32,7 +32,7 @@ class AbstractDecoder
public:
virtual ~AbstractDecoder() {}
static std::unique_ptr<AbstractDecoder> create(const Decoder& config);
static std::unique_ptr<AbstractDecoder> create(const DecoderProto& config);
public:
enum RecordType

View File

@@ -3,15 +3,15 @@ syntax = "proto2";
import "arch/brother/brother.proto";
import "arch/ibm/ibm.proto";
message Decoder {
message DecoderProto {
optional double pulse_debounce_threshold = 1 [default = 0.30];
optional double bit_error_threshold = 2 [default = 0.40];
optional double clock_interval_bias = 3 [default = -0.02];
optional double minimum_clock_us = 4 [default = 0.75];
oneof format {
IBMInput ibm = 5;
BrotherInput brother = 6;
IBMInputProto ibm = 5;
BrotherInputProto brother = 6;
}
}

View File

@@ -7,14 +7,14 @@
#include "lib/encoders/encoders.pb.h"
#include "protocol.h"
std::unique_ptr<AbstractEncoder> AbstractEncoder::create(const Encoder& config)
std::unique_ptr<AbstractEncoder> AbstractEncoder::create(const EncoderProto& config)
{
switch (config.format_case())
{
case Encoder::kIbm:
case EncoderProto::kIbm:
return std::unique_ptr<AbstractEncoder>(new IbmEncoder(config.ibm()));
case Encoder::kBrother:
case EncoderProto::kBrother:
return std::unique_ptr<AbstractEncoder>(new BrotherEncoder(config.brother()));
default:

View File

@@ -3,14 +3,14 @@
class Fluxmap;
class SectorSet;
class Encoder;
class EncoderProto;
class AbstractEncoder
{
public:
virtual ~AbstractEncoder() {}
static std::unique_ptr<AbstractEncoder> create(const Encoder& config);
static std::unique_ptr<AbstractEncoder> create(const EncoderProto& config);
public:
virtual std::unique_ptr<Fluxmap> encode(

View File

@@ -4,9 +4,9 @@ import "arch/brother/brother.proto";
import "arch/ibm/ibm.proto";
//import "lib/common.proto";
message Encoder {
message EncoderProto {
oneof format {
IBMOutput ibm = 3;
BrotherOutput brother = 4;
IBMOutputProto ibm = 3;
BrotherOutputProto brother = 4;
}
}

View File

@@ -4,14 +4,14 @@
#include "fluxsink/fluxsink.h"
#include "lib/config.pb.h"
std::unique_ptr<FluxSink> FluxSink::create(const Config_OutputDisk& config)
std::unique_ptr<FluxSink> FluxSink::create(const OutputDiskProto& config)
{
switch (config.dest_case())
{
case Config_OutputDisk::kFluxfile:
case OutputDiskProto::kFluxfile:
return createSqliteFluxSink(config.fluxfile());
case Config_OutputDisk::kDrive:
case OutputDiskProto::kDrive:
return createHardwareFluxSink(config.drive());
}

View File

@@ -8,7 +8,7 @@ extern FlagGroup hardwareFluxSinkFlags;
extern FlagGroup sqliteFluxSinkFlags;
class Fluxmap;
class Config_OutputDisk;
class OutputDiskProto;
class FluxSink
{
@@ -18,7 +18,7 @@ public:
static std::unique_ptr<FluxSink> createSqliteFluxSink(const std::string& filename);
static std::unique_ptr<FluxSink> createHardwareFluxSink(unsigned drive);
static std::unique_ptr<FluxSink> create(const Config_OutputDisk& config);
static std::unique_ptr<FluxSink> create(const OutputDiskProto& config);
public:
virtual void writeFlux(int track, int side, Fluxmap& fluxmap) = 0;

View File

@@ -11,17 +11,17 @@ static bool ends_with(const std::string& value, const std::string& ending)
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
std::unique_ptr<FluxSource> FluxSource::create(const Config_InputDisk& config)
std::unique_ptr<FluxSource> FluxSource::create(const InputDiskProto& config)
{
switch (config.source_case())
{
case Config_InputDisk::kFluxfile:
case InputDiskProto::kFluxfile:
return createSqliteFluxSource(config.fluxfile());
case Config_InputDisk::kDrive:
case InputDiskProto::kDrive:
return createHardwareFluxSource(config.drive());
case Config_InputDisk::kTestPattern:
case InputDiskProto::kTestPattern:
return createTestPatternFluxSource(config.test_pattern());
}

View File

@@ -7,9 +7,9 @@ extern FlagGroup hardwareFluxSourceFlags;
class Fluxmap;
class FluxSpec;
class Config_InputDisk;
class HardwareInput;
class TestPatternInput;
class InputDiskProto;
class HardwareInputProto;
class TestPatternInputProto;
class FluxSource
{
@@ -18,13 +18,12 @@ public:
private:
static std::unique_ptr<FluxSource> createSqliteFluxSource(const std::string& filename);
static std::unique_ptr<FluxSource> createHardwareFluxSource(const HardwareInput& config);
static std::unique_ptr<FluxSource> createHardwareFluxSource(const HardwareInputProto& config);
static std::unique_ptr<FluxSource> createStreamFluxSource(const std::string& path);
static std::unique_ptr<FluxSource> createTestPatternFluxSource(const TestPatternInput& config);
static std::unique_ptr<FluxSource> createTestPatternFluxSource(const TestPatternInputProto& config);
public:
static std::unique_ptr<FluxSource> create(const FluxSpec& spec);
static std::unique_ptr<FluxSource> create(const Config_InputDisk& spec);
static std::unique_ptr<FluxSource> create(const InputDiskProto& spec);
public:
virtual std::unique_ptr<Fluxmap> readFlux(int track, int side) = 0;

View File

@@ -6,7 +6,7 @@ enum IndexMode {
INDEXMODE_360 = 2;
}
message HardwareInput {
message HardwareInputProto {
optional int32 drive = 1 [default = 0];
optional double revolutions = 2 [default = 1.2];
@@ -16,7 +16,7 @@ message HardwareInput {
optional bool high_density = 6 [default = true];
}
message TestPatternInput {
message TestPatternInputProto {
optional double interval_us = 1 [default = 4.0];
optional double sequence_length_us = 2 [default = 200.0];
}

View File

@@ -15,7 +15,7 @@ FlagGroup hardwareFluxSourceFlags = {
class HardwareFluxSource : public FluxSource
{
public:
HardwareFluxSource(const HardwareInput& config):
HardwareFluxSource(const HardwareInputProto& config):
_config(config)
{
usbSetDrive(_config.drive(), fluxSourceSinkHighDensity, _config.index_mode());
@@ -56,12 +56,12 @@ public:
}
private:
const HardwareInput& _config;
const HardwareInputProto& _config;
nanoseconds_t _oneRevolution;
nanoseconds_t _hardSectorThreshold;
};
std::unique_ptr<FluxSource> FluxSource::createHardwareFluxSource(const HardwareInput& config)
std::unique_ptr<FluxSource> FluxSource::createHardwareFluxSource(const HardwareInputProto& config)
{
return std::unique_ptr<FluxSource>(new HardwareFluxSource(config));
}

View File

@@ -7,7 +7,7 @@
class TestPatternFluxSource : public FluxSource
{
public:
TestPatternFluxSource(const TestPatternInput& config):
TestPatternFluxSource(const TestPatternInputProto& config):
_config(config)
{}
@@ -30,10 +30,10 @@ public:
void recalibrate() {}
private:
const TestPatternInput& _config;
const TestPatternInputProto& _config;
};
std::unique_ptr<FluxSource> FluxSource::createTestPatternFluxSource(const TestPatternInput& config)
std::unique_ptr<FluxSource> FluxSource::createTestPatternFluxSource(const TestPatternInputProto& config)
{
return std::unique_ptr<FluxSource>(new TestPatternFluxSource(config));
}

View File

@@ -13,7 +13,7 @@
class DiskCopyImageReader : public ImageReader
{
public:
DiskCopyImageReader(const Config_InputFile& config):
DiskCopyImageReader(const InputFileProto& config):
ImageReader(config)
{}
@@ -121,7 +121,7 @@ public:
};
std::unique_ptr<ImageReader> ImageReader::createDiskCopyImageReader(
const Config_InputFile& config)
const InputFileProto& config)
{
return std::unique_ptr<ImageReader>(new DiskCopyImageReader(config));
}

View File

@@ -10,7 +10,7 @@
#include <algorithm>
#include <ctype.h>
std::unique_ptr<ImageReader> ImageReader::create(const Config_InputFile& config)
std::unique_ptr<ImageReader> ImageReader::create(const InputFileProto& config)
{
if (config.has_img())
return ImageReader::createImgImageReader(config);
@@ -19,7 +19,7 @@ std::unique_ptr<ImageReader> ImageReader::create(const Config_InputFile& config)
return std::unique_ptr<ImageReader>();
}
ImageReader::ImageReader(const Config_InputFile& config):
ImageReader::ImageReader(const InputFileProto& config):
_config(config)
{}

View File

@@ -3,28 +3,28 @@
class SectorSet;
class ImageSpec;
class Config_InputFile;
class InputFileProto;
class ImageReader
{
public:
ImageReader(const Config_InputFile& config);
ImageReader(const InputFileProto& config);
virtual ~ImageReader() {};
public:
static std::unique_ptr<ImageReader> create(const Config_InputFile& config);
static std::unique_ptr<ImageReader> create(const InputFileProto& config);
public:
static std::unique_ptr<ImageReader> createDiskCopyImageReader(const Config_InputFile& config);
static std::unique_ptr<ImageReader> createImgImageReader(const Config_InputFile& config);
static std::unique_ptr<ImageReader> createJv3ImageReader(const Config_InputFile& config);
static std::unique_ptr<ImageReader> createIMDImageReader(const Config_InputFile& config);
static std::unique_ptr<ImageReader> createDiskCopyImageReader(const InputFileProto& config);
static std::unique_ptr<ImageReader> createImgImageReader(const InputFileProto& config);
static std::unique_ptr<ImageReader> createJv3ImageReader(const InputFileProto& config);
static std::unique_ptr<ImageReader> createIMDImageReader(const InputFileProto& config);
public:
virtual SectorSet readImage() = 0;
protected:
const Config_InputFile& _config;
const InputFileProto& _config;
};
#endif

View File

@@ -85,7 +85,7 @@ static unsigned getSectorSize(uint8_t flags)
class IMDImageReader : public ImageReader
{
public:
IMDImageReader(const Config_InputFile& config):
IMDImageReader(const InputFileProto& config):
ImageReader(config)
{}
@@ -274,7 +274,7 @@ public:
};
std::unique_ptr<ImageReader> ImageReader::createIMDImageReader(
const Config_InputFile& config)
const InputFileProto& config)
{
return std::unique_ptr<ImageReader>(new IMDImageReader(config));
}

View File

@@ -1,7 +1,7 @@
syntax = "proto2";
message ImgInputOutput {
message Format {
message ImgInputOutputProto {
message FormatProto {
optional int32 track = 1;
optional int32 side = 2;
@@ -9,7 +9,7 @@ message ImgInputOutput {
optional int32 sectors = 4;
}
repeated Format format = 4;
repeated FormatProto format = 4;
optional int32 tracks = 5 [default=80];
optional int32 sides = 6 [default=2];
}

View File

@@ -13,7 +13,7 @@
class ImgImageReader : public ImageReader
{
public:
ImgImageReader(const Config_InputFile& config):
ImgImageReader(const InputFileProto& config):
ImageReader(config)
{}
@@ -28,7 +28,7 @@ public:
{
for (int side = 0; side < _config.img().sides(); side++)
{
ImgInputOutput::Format format;
ImgInputOutputProto::FormatProto format;
getTrackFormat(format, track, side);
for (int sectorId = 0; sectorId < format.sectors(); sectorId++)
@@ -58,10 +58,10 @@ public:
}
private:
void getTrackFormat(ImgInputOutput::Format& format, unsigned track, unsigned side)
void getTrackFormat(ImgInputOutputProto::FormatProto& format, unsigned track, unsigned side)
{
format.Clear();
for (const ImgInputOutput::Format& f : _config.img().format())
for (const ImgInputOutputProto::FormatProto& f : _config.img().format())
{
if (f.has_track() && (f.track() != track))
continue;
@@ -74,7 +74,7 @@ private:
};
std::unique_ptr<ImageReader> ImageReader::createImgImageReader(
const Config_InputFile& config)
const InputFileProto& config)
{
return std::unique_ptr<ImageReader>(new ImgImageReader(config));
}

View File

@@ -78,7 +78,7 @@ static unsigned getSectorSize(uint8_t flags)
class Jv3ImageReader : public ImageReader
{
public:
Jv3ImageReader(const Config_InputFile& config):
Jv3ImageReader(const InputFileProto& config):
ImageReader(config)
{}
@@ -133,7 +133,7 @@ public:
}
};
std::unique_ptr<ImageReader> ImageReader::createJv3ImageReader(const Config_InputFile& config)
std::unique_ptr<ImageReader> ImageReader::createJv3ImageReader(const InputFileProto& config)
{
return std::unique_ptr<ImageReader>(new Jv3ImageReader(config));
}

View File

@@ -25,7 +25,7 @@ static int sectors_per_track(int track)
class D64ImageWriter : public ImageWriter
{
public:
D64ImageWriter(const Config_OutputFile& config):
D64ImageWriter(const OutputFileProto& config):
ImageWriter(config)
{}
@@ -56,7 +56,7 @@ public:
}
};
std::unique_ptr<ImageWriter> ImageWriter::createD64ImageWriter(const Config_OutputFile& config)
std::unique_ptr<ImageWriter> ImageWriter::createD64ImageWriter(const OutputFileProto& config)
{
return std::unique_ptr<ImageWriter>(new D64ImageWriter(config));
}

View File

@@ -28,7 +28,7 @@ static void write_and_update_checksum(ByteWriter& bw, uint32_t& checksum, const
class DiskCopyImageWriter : public ImageWriter
{
public:
DiskCopyImageWriter(const Config_OutputFile& config):
DiskCopyImageWriter(const OutputFileProto& config):
ImageWriter(config)
{}
@@ -170,7 +170,7 @@ public:
};
std::unique_ptr<ImageWriter> ImageWriter::createDiskCopyImageWriter(
const Config_OutputFile& config)
const OutputFileProto& config)
{
return std::unique_ptr<ImageWriter>(new DiskCopyImageWriter(config));
}

View File

@@ -23,7 +23,7 @@ std::map<std::string, ImageWriter::Constructor> ImageWriter::formats =
};
#endif
std::unique_ptr<ImageWriter> ImageWriter::create(const Config_OutputFile& config)
std::unique_ptr<ImageWriter> ImageWriter::create(const OutputFileProto& config)
{
if (config.has_img())
return ImageWriter::createImgImageWriter(config);
@@ -37,7 +37,7 @@ std::unique_ptr<ImageWriter> ImageWriter::create(const Config_OutputFile& config
// Error() << "unrecognised output image filename extension";
//}
ImageWriter::ImageWriter(const Config_OutputFile& config):
ImageWriter::ImageWriter(const OutputFileProto& config):
_config(config)
{}

View File

@@ -2,25 +2,25 @@
#define IMAGEWRITER_H
class SectorSet;
class Config_OutputFile;
class OutputFileProto;
class ImageWriter
{
public:
ImageWriter(const Config_OutputFile& config);
ImageWriter(const OutputFileProto& config);
virtual ~ImageWriter() {};
public:
static std::unique_ptr<ImageWriter> create(const Config_OutputFile& config);
static std::unique_ptr<ImageWriter> create(const OutputFileProto& config);
static std::unique_ptr<ImageWriter> createImgImageWriter(
const Config_OutputFile& config);
const OutputFileProto& config);
static std::unique_ptr<ImageWriter> createLDBSImageWriter(
const Config_OutputFile& config);
const OutputFileProto& config);
static std::unique_ptr<ImageWriter> createD64ImageWriter(
const Config_OutputFile& config);
const OutputFileProto& config);
static std::unique_ptr<ImageWriter> createDiskCopyImageWriter(
const Config_OutputFile& config);
const OutputFileProto& config);
public:
void printMap(const SectorSet& sectors);
@@ -28,7 +28,7 @@ public:
virtual void writeImage(const SectorSet& sectors) = 0;
protected:
const Config_OutputFile& _config;
const OutputFileProto& _config;
};
#endif

View File

@@ -13,7 +13,7 @@
class ImgImageWriter : public ImageWriter
{
public:
ImgImageWriter(const Config_OutputFile& config):
ImgImageWriter(const OutputFileProto& config):
ImageWriter(config)
{}
@@ -57,7 +57,7 @@ public:
};
std::unique_ptr<ImageWriter> ImageWriter::createImgImageWriter(
const Config_OutputFile& config)
const OutputFileProto& config)
{
return std::unique_ptr<ImageWriter>(new ImgImageWriter(config));
}

View File

@@ -14,7 +14,7 @@
class LDBSImageWriter : public ImageWriter
{
public:
LDBSImageWriter(const Config_OutputFile& config):
LDBSImageWriter(const OutputFileProto& config):
ImageWriter(config)
{}
@@ -102,7 +102,7 @@ public:
}
};
std::unique_ptr<ImageWriter> ImageWriter::createLDBSImageWriter(const Config_OutputFile& config)
std::unique_ptr<ImageWriter> ImageWriter::createLDBSImageWriter(const OutputFileProto& config)
{
return std::unique_ptr<ImageWriter>(new LDBSImageWriter(config));
}

View File

@@ -2,7 +2,7 @@
#include "proto.h"
#include "fmt/format.h"
Config config;
ConfigProto config;
static double toDouble(const std::string& value)
{
@@ -100,7 +100,7 @@ void setProtoByString(google::protobuf::Message* message, const std::string& pat
}
}
std::set<unsigned> iterate(const Range& range)
std::set<unsigned> iterate(const RangeProto& range)
{
std::set<unsigned> set;
for (unsigned i=range.start(); i<=range.end(); i+=range.step())

View File

@@ -6,9 +6,9 @@
extern void setProtoByString(google::protobuf::Message* message, const std::string& path, const std::string& value);
extern std::set<unsigned> iterate(const Range& range);
extern std::set<unsigned> iterate(const RangeProto& range);
extern Config config;
extern ConfigProto config;
#endif

View File

@@ -308,7 +308,7 @@ for pb in \
brother \
ibm \
; do
buildencodedproto $OBJDIR/proto/libproto.def Config \
buildencodedproto $OBJDIR/proto/libproto.def ConfigProto \
readables_${pb}_pb src/readables/$pb.textpb $OBJDIR/proto/src/readables/$pb.cc
done
@@ -316,7 +316,7 @@ for pb in \
brother240 \
ibm1440 \
; do
buildencodedproto $OBJDIR/proto/libproto.def Config \
buildencodedproto $OBJDIR/proto/libproto.def ConfigProto \
writables_${pb}_pb src/writables/$pb.textpb $OBJDIR/proto/src/writables/$pb.cc
done

View File

@@ -38,7 +38,7 @@ static void test_setting(void)
static void test_config(void)
{
Config config;
ConfigProto config;
const std::string text = R"M(
input {
@@ -78,7 +78,7 @@ static void test_load(void)
static void test_range(void)
{
{
Range r;
RangeProto r;
r.set_start(0);
r.set_end(3);
r.add_also(5);
@@ -87,7 +87,7 @@ static void test_range(void)
}
{
Range r;
RangeProto r;
r.set_start(1);
r.set_end(1);
r.add_also(5);

View File

@@ -1,7 +1,7 @@
syntax = "proto2";
message TestProto {
message SubMessage {
message SubMessageProto {
optional string s = 1;
}
@@ -10,12 +10,12 @@ message TestProto {
optional uint64 u64 = 3;
optional uint32 u32 = 4;
optional double d = 5;
optional SubMessage m = 6;
repeated SubMessage r = 7;
optional SubMessageProto m = 6;
repeated SubMessageProto r = 7;
oneof alt {
SubMessage firstoption = 8;
SubMessage secondoption = 9;
SubMessageProto firstoption = 8;
SubMessageProto secondoption = 9;
}
}