Skip to content

Commit 88e9cf2

Browse files
committed
main: make multichar cmdline opt values constexpr
this will eg. allow the compiler to detect unused vars + removed the unused MAX_CAPTURE_COUNT (detected when made constexpr as the opt vals)
1 parent 72b4964 commit 88e9cf2

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

src/main.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,19 @@
131131
static constexpr const char *DEFAULT_VIDEO_COMPRESSION = "none";
132132
static constexpr const char *DEFAULT_AUDIO_CODEC = "PCM";
133133

134-
#define OPT_AUDIO_CAPTURE_CHANNELS (('a' << 8) | 'c')
135-
#define OPT_AUDIO_DELAY (('A' << 8) | 'D')
136-
#define OPT_AUDIO_HOST (('A' << 8) | 'H')
137-
#define OPT_AUDIO_PROTOCOL (('A' << 8) | 'P')
138-
#define OPT_AUDIO_SCALE (('a' << 8) | 's')
139-
#define OPT_ECHO_CANCELLATION (('E' << 8) | 'C')
140-
#define OPT_MCAST_IF (('M' << 8) | 'I')
141-
#define OPT_PIX_FMTS (('P' << 8) | 'F')
142-
#define OPT_PIXFMT_CONV_POLICY (('P' << 8) | 'C')
143-
#define OPT_RTSP_SERVER (('R' << 8) | 'S')
144-
#define OPT_VIDEO_CODECS (('V' << 8) | 'C')
145-
#define OPT_VIDEO_PROTOCOL (('V' << 8) | 'P')
146-
#define OPT_WINDOW_TITLE (('W' << 8) | 'T')
147-
148-
#define MAX_CAPTURE_COUNT 17
134+
constexpr int OPT_AUDIO_CAPTURE_CHANNELS = ('a' << 8) | 'c';
135+
constexpr int OPT_AUDIO_DELAY = ('A' << 8) | 'D';
136+
constexpr int OPT_AUDIO_HOST = ('A' << 8) | 'H';
137+
constexpr int OPT_AUDIO_PROTOCOL = ('A' << 8) | 'P';
138+
constexpr int OPT_AUDIO_SCALE = ('a' << 8) | 's';
139+
constexpr int OPT_ECHO_CANCELLATION = ('E' << 8) | 'C';
140+
constexpr int OPT_MCAST_IF = ('M' << 8) | 'I';
141+
constexpr int OPT_PIX_FMTS = ('P' << 8) | 'F';
142+
constexpr int OPT_PIXFMT_CONV_POLICY = ('P' << 8) | 'C';
143+
constexpr int OPT_RTSP_SERVER = ('R' << 8) | 'S';
144+
constexpr int OPT_VIDEO_CODECS = ('V' << 8) | 'C';
145+
constexpr int OPT_VIDEO_PROTOCOL = ('V' << 8) | 'P';
146+
constexpr int OPT_WINDOW_TITLE = ('W' << 8) | 'T';
149147

150148
using namespace std;
151149
using namespace std::chrono;

0 commit comments

Comments
 (0)