Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2085b0f7 authored by Myles Watson's avatar Myles Watson
Browse files

PDL: Remove extra semicolons

Test: bluetooth_packet_parser_test
Change-Id: I42de064a0bc5aa2e0953d28b0ecbf500544d7c96
parent 67a4fd55
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include "fields/enum_field.h"
#include "util.h"

EnumDef::EnumDef(std::string name, int size) : TypeDef(name, size){};
EnumDef::EnumDef(std::string name, int size) : TypeDef(name, size) {}

void EnumDef::AddEntry(std::string name, uint32_t value) {
  if (value > util::GetMaxValueForBits(size_)) {
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@

#include "util.h"

EnumGen::EnumGen(EnumDef e) : e_(e){};
EnumGen::EnumGen(EnumDef e) : e_(e) {}

void EnumGen::GenDefinition(std::ostream& stream) {
  stream << "enum class ";
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@
#include "fields/all_fields.h"
#include "util.h"

PacketDef::PacketDef(std::string name, FieldList fields) : ParentDef(name, fields, nullptr){};
PacketDef::PacketDef(std::string name, FieldList fields, PacketDef* parent) : ParentDef(name, fields, parent){};
PacketDef::PacketDef(std::string name, FieldList fields) : ParentDef(name, fields, nullptr) {}
PacketDef::PacketDef(std::string name, FieldList fields, PacketDef* parent) : ParentDef(name, fields, parent) {}

PacketField* PacketDef::GetNewField(const std::string&, ParseLocation) const {
  return nullptr;  // Packets can't be fields
+2 −2
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@
#include "fields/all_fields.h"
#include "util.h"

ParentDef::ParentDef(std::string name, FieldList fields) : TypeDef(name), fields_(fields), parent_(nullptr){};
ParentDef::ParentDef(std::string name, FieldList fields) : ParentDef(name, fields, nullptr) {}
ParentDef::ParentDef(std::string name, FieldList fields, ParentDef* parent)
    : TypeDef(name), fields_(fields), parent_(parent){};
    : TypeDef(name), fields_(fields), parent_(parent) {}

void ParentDef::AddParentConstraint(std::string field_name, std::variant<int64_t, std::string> value) {
  // NOTE: This could end up being very slow if there are a lot of constraints.
+2 −7
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@
#include "fields/all_fields.h"
#include "util.h"

StructDef::StructDef(std::string name, FieldList fields) : ParentDef(name, fields, nullptr){};
StructDef::StructDef(std::string name, FieldList fields, StructDef* parent) : ParentDef(name, fields, parent){};
StructDef::StructDef(std::string name, FieldList fields) : StructDef(name, fields, nullptr) {}
StructDef::StructDef(std::string name, FieldList fields, StructDef* parent) : ParentDef(name, fields, parent) {}

PacketField* StructDef::GetNewField(const std::string& name, ParseLocation loc) const {
  Size total_size = GetSize(false);
@@ -81,11 +81,6 @@ void StructDef::GenDefinition(std::ostream& s) const {

  GenConstructor(s);

  std::set<std::string> fixed_types = {
      FixedScalarField::kFieldType,
      FixedEnumField::kFieldType,
  };

  s << " public:\n";
  s << "  virtual ~" << name_ << "() override = default;\n";