Skip to content

Commit

Permalink
tidy: Initialize enum values in a consistent manner.
Browse files Browse the repository at this point in the history
If more than one value is in an enum is assigned a value, then all
values in the enum should be assigned a value.

All changes made by clang-tidy.  White space cleanup and decimal to
hex conversions by hand.

https://clang.llvm.org/extra/clang-tidy/checks/readability/enum-initial-value.html
  • Loading branch information
linuxdude42 committed Aug 13, 2024
1 parent d33c215 commit 14c3136
Show file tree
Hide file tree
Showing 16 changed files with 346 additions and 346 deletions.
2 changes: 1 addition & 1 deletion mythplugins/mythnetvision/mythnetvision/nettree.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

enum DialogType : std::uint8_t
{ DLG_DEFAULT = 0, DLG_GALLERY = 0x1, DLG_TREE = 0x2,
DLG_BROWSER = 0x4, dtLast };
DLG_BROWSER = 0x4, dtLast = 0x5 };

enum TreeNodeType : std::int8_t {
kSubFolder = -1,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythpower.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MBASE_PUBLIC MythPower : public QObject, public ReferenceCounter
BatteryLow = 10,
BatteryFull = 100,
UnknownPower = 101,
Unset
Unset = 102,
};

enum Feature : std::uint8_t
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/captions/cc708decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ enum C0 : std::uint8_t

enum C1 : std::uint8_t
{
CW0=0x80, CW1, CW2, CW3, CW4, CW5, CW6, CW7,
CLW, DSW, HDW, TGW, DLW, DLY, DLC, RST,
SPA=0x90, SPC, SPL, SWA=0x97,
DF0, DF1, DF2, DF3, DF4, DF5, DF6, DF7,
CW0=0x80, CW1=0x81, CW2=0x82, CW3=0x83, CW4=0x84, CW5=0x85, CW6=0x86, CW7=0x87,
CLW=0x88, DSW=0x89, HDW=0x8A, TGW=0x8B, DLW=0x8C, DLY=0x8D, DLC=0x8E, RST=0x8F,
SPA=0x90, SPC=0x91, SPL=0x92, SWA=0x97,
DF0=0x98, DF1=0x99, DF2=0x9A, DF3=0x9B, DF4=0x9C, DF5=0x9D, DF6=0x9E, DF7=0x9F,
};

using cc_table = std::array<const uint16_t, 0x60>;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/captions/cc708window.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ class MTV_PUBLIC CC708Window
bool m_visible {false};
public:
enum : std::uint8_t {
kAnchorUpperLeft = 0, kAnchorUpperCenter, kAnchorUpperRight,
kAnchorCenterLeft = 3, kAnchorCenter, kAnchorCenterRight,
kAnchorLowerLeft = 6, kAnchorLowerCenter, kAnchorLowerRight,
kAnchorUpperLeft = 0, kAnchorUpperCenter = 1, kAnchorUpperRight = 2,
kAnchorCenterLeft = 3, kAnchorCenter = 4, kAnchorCenterRight = 5,
kAnchorLowerLeft = 6, kAnchorLowerCenter = 7, kAnchorLowerRight = 8,
};
uint m_anchor_point {0};
uint m_relative_pos {0};
Expand Down
18 changes: 9 additions & 9 deletions mythtv/libs/libmythtv/channelscan/channelimporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,18 @@ class MTV_PUBLIC ChannelImporter : public QObject

kChannelTypeNonConflictingFirst = kChannelTypeFirst,
kATSCNonConflicting = kChannelTypeFirst,
kDVBNonConflicting,
kSCTENonConflicting,
kMPEGNonConflicting,
kNTSCNonConflicting,
kDVBNonConflicting = 1,
kSCTENonConflicting = 2,
kMPEGNonConflicting = 3,
kNTSCNonConflicting = 4,
kChannelTypeNonConflictingLast = kNTSCNonConflicting,

kChannelTypeConflictingFirst,
kChannelTypeConflictingFirst = 5,
kATSCConflicting = kChannelTypeConflictingFirst,
kDVBConflicting,
kSCTEConflicting,
kMPEGConflicting,
kNTSCConflicting,
kDVBConflicting = 6,
kSCTEConflicting = 7,
kMPEGConflicting = 8,
kNTSCConflicting = 9,
kChannelTypeConflictingLast = kNTSCConflicting,
kChannelTypeLast = kChannelTypeConflictingLast,
};
Expand Down
26 changes: 13 additions & 13 deletions mythtv/libs/libmythtv/dtvconfparserhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,19 +355,19 @@ class DTVModulation : public DTVParamHelper
public:
enum Types : std::uint16_t
{
kModulationQPSK,
kModulationQAM16,
kModulationQAM32,
kModulationQAM64,
kModulationQAM128,
kModulationQAM256,
kModulationQAMAuto,
kModulation8VSB,
kModulation16VSB,
kModulation8PSK,
kModulation16APSK,
kModulation32APSK,
kModulationDQPSK,
kModulationQPSK = 0x000,
kModulationQAM16 = 0x001,
kModulationQAM32 = 0x002,
kModulationQAM64 = 0x003,
kModulationQAM128 = 0x004,
kModulationQAM256 = 0x005,
kModulationQAMAuto = 0x006,
kModulation8VSB = 0x007,
kModulation16VSB = 0x008,
kModulation8PSK = 0x009,
kModulation16APSK = 0x00A,
kModulation32APSK = 0x00B,
kModulationDQPSK = 0x00C,
kModulationInvalid = 0x100, /* for removed modulations */
kModulationAnalog = 0x200, /* for analog channel scanner */
};
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mheg/mhegic.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MHInteractionChannel : public QObject
// Is a file ready to read?
bool CheckFile(const QString &csPath, const QByteArray &cert = QByteArray());
// Read a file
enum EResult : std::int8_t { kError = -1, kSuccess = 0, kPending };
enum EResult : std::int8_t { kError = -1, kSuccess = 0, kPending = 1 };
EResult GetFile(const QString &csPath, QByteArray &data,
const QByteArray &cert = QByteArray() );

Expand Down
Loading

0 comments on commit 14c3136

Please sign in to comment.