History

fftools/cmdutils: change option flags to (1 << N) style

It is easier to read.

Anton Khirnov committed 2 years ago

Commit ca6f0191 parent 7a7550e1 file · +25 −22Browse files

Unified · Split

fftools/cmdutils.h+25−22
@@ -106,28 +106,31 @@ typedef struct SpecifierOpt { · 105 unmodified lines
106106 typedef struct OptionDef {
107107 const char *name;
108108 int flags;
109−#define HAS_ARG 0x0001
110−#define OPT_BOOL 0x0002
111−#define OPT_EXPERT 0x0004
112−#define OPT_STRING 0x0008
113−#define OPT_VIDEO 0x0010
114−#define OPT_AUDIO 0x0020
115−#define OPT_INT 0x0080
116−#define OPT_FLOAT 0x0100
117−#define OPT_SUBTITLE 0x0200
118−#define OPT_INT64 0x0400
119−#define OPT_EXIT 0x0800
120−#define OPT_DATA 0x1000
121−#define OPT_PERFILE 0x2000 /* the option is per-file (currently ffmpeg-only).
122− implied by OPT_OFFSET or OPT_SPEC */
123−#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */
124−#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt.
125− Implies OPT_OFFSET. Next element after the offset is
126− an int containing element count in the array. */
127−#define OPT_TIME 0x10000
128−#define OPT_DOUBLE 0x20000
129−#define OPT_INPUT 0x40000
130−#define OPT_OUTPUT 0x80000
109+#define HAS_ARG (1 << 0)
110+#define OPT_BOOL (1 << 1)
111+#define OPT_EXPERT (1 << 2)
112+#define OPT_STRING (1 << 3)
113+#define OPT_VIDEO (1 << 4)
114+#define OPT_AUDIO (1 << 5)
115+#define OPT_INT (1 << 6)
116+#define OPT_FLOAT (1 << 7)
117+#define OPT_SUBTITLE (1 << 8)
118+#define OPT_INT64 (1 << 9)
119+#define OPT_EXIT (1 << 10)
120+#define OPT_DATA (1 << 11)
121+/* The option is per-file (currently ffmpeg-only).
122+ implied by OPT_OFFSET or OPT_SPEC */
123+#define OPT_PERFILE (1 << 12)
124+/* Option is specified as an offset in a passed optctx */
125+#define OPT_OFFSET (1 << 13)
126+/* Option is to be stored in an array of SpecifierOpt. Implies OPT_OFFSET.
127+ Next element after the offset is an int containing element count in the
128+ array. */
129+#define OPT_SPEC (1 << 14)
130+#define OPT_TIME (1 << 15)
131+#define OPT_DOUBLE (1 << 16)
132+#define OPT_INPUT (1 << 17)
133+#define OPT_OUTPUT (1 << 18)
131134 union {
132135 void *dst_ptr;
133136 int (*func_arg)(void *, const char *, const char *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t