Files
ports/multimedia/libv4l/files/patch-utils_ir-ctl_bpf__encoder.c
Hans Petter Selasky 6dd2426803 Upgrade v4l_compat, libv4l and v4l-utils to v1.18.0.
The most important change is that up-to-date V4L header files are now
sourced from the webcamd distribution tarball.

Refer to the ChangeLog file in the v4l-utils tarball for a comprehensive
list of changes.

PR:		245501
Approved by:	pi (implicit)
2020-04-17 08:34:50 +00:00

51 lines
1.1 KiB
C

--- utils/ir-ctl/bpf_encoder.c.orig 2020-04-09 16:29:54 UTC
+++ utils/ir-ctl/bpf_encoder.c
@@ -84,21 +84,23 @@ static void encode_manchester(struct keymap *map, uint
{
int len = 0, bits, i;
- void advance_space(unsigned length)
- {
- if (len % 2)
- buf[len] += length;
- else
- buf[++len] = length;
- }
+#define advance_space(__length) \
+ do { \
+ const unsigned length = (__length); \
+ if (len % 2) \
+ buf[len] += length; \
+ else \
+ buf[++len] = length; \
+ } while (0)
- void advance_pulse(unsigned length)
- {
- if (len % 2)
- buf[++len] = length;
- else
- buf[len] += length;
- }
+#define advance_pulse(__length) \
+ do { \
+ const unsigned length = (__length); \
+ if (len % 2) \
+ buf[++len] = length; \
+ else \
+ buf[len] += length; \
+ } while (0)
bits = keymap_param(map, "bits", 14);
@@ -111,7 +113,8 @@ static void encode_manchester(struct keymap *map, uint
advance_pulse(keymap_param(map, "zero_pulse", 888));
}
}
-
+#undef advance_space
+#undef advance_pulse
/* drop any trailing pulse */
*length = (len % 2) ? len : len + 1;
}