Make av_pix_fmt_descriptors table static on next major bump.
Making the table public is dangerous, since the caller has no way to
know how large it actually is. It also prevents adding new fields to
AVPixFmtDescriptor without a major bump.
The current API where the plain size is exposed is not of much
use - in most cases it is allocated dynamically anyway.
If allocated e.g. on the stack via an uint8_t array, there's no
guarantee that the struct's members are aligned properly (unless
the array is overallocated and the opaque pointer within it
manually aligned to some unspecified alignment).
Signed-off-by: Martin Storsjö <martin@martin.st>
- make tables static const
- remove useless use of compound literal
- break long lines
- fix a comma/semicolon typo
Signed-off-by: Mans Rullgard <mans@mansr.com>
The const qualifier is still removed although it happens inside
the strtol() function so no warning is generated.
Fixes:
libavutil/parseutils.c:110:11: warning: assignment discards qualifiers from pointer target type
Signed-off-by: Mans Rullgard <mans@mansr.com>
An alpha specifier outside the valid range results in a conversion from
double to long with undefined result. Range-checking the double and
only converting it after it passes avoids this.
Fixes fate-parseutils errors on some systems.
Signed-off-by: Mans Rullgard <mans@mansr.com>
ff_get_cpu_flags_x86() requires cpuid(), which is conditionally defined
elsewhere in the file. Surrounding the function body with ifdefs allows
building even when cpuid is not defined. An empty cpuflags mask is
returned in this case.
Now that there is CPU detection in YASM, there will always be one of
inline or external assembly enabled, which obviates the need to fall
back on CPU detection through compiler intrinsics.
There are cases where strncpy() does exactly what is required.
A blanket ban forces more convoluted solutions to be used in those
cases and has been a cause of bugs.
Signed-off-by: Mans Rullgard <mans@mansr.com>
All our ARM asm preserves alignment so setting this attribute
in a common location is simpler. This removes numerous warnings
when linking with armcc.
Signed-off-by: Mans Rullgard <mans@mansr.com>
LDR with register offset and PC as base register is not available in
the Thumb instruction set so the addition must be done separately.
Signed-off-by: Mans Rullgard <mans@mansr.com>
When building Thumb2 code, the end of a function, where the PIC
offsets are placed, need not be aligned. Although the values
are only accessed with instructions allowing unaligned addresses,
keeping them aligned is preferable.
Signed-off-by: Mans Rullgard <mans@mansr.com>