Files
libgphoto2/camlibs
Hans Ulrich Niedermann b6fae4fcce ptp2/ptp.c: Rewrite PTP_CNT_INIT to build with pure C99
This rewrites the variadic macro PTP_CNT_INIT() and the ptp_init_container()
function such that they compile with the strictest compiler available:

    clang -std=c99 -pedantic -Wall -Wextra -Weverything

This is achieved by moving the code argument to be the first of the
variable arguments, and adapting the parameter counting and argument
handling inside ptp_init_container() accordingly.

As the code in ptp_init_container() which handles the va_args and puts
them into PTPContainer Param<N> fields relies on a particular memory
layout of the PTPContainer struct, this adds compile time assertions
which check the memory layout is the one the code expects.

Closes: https://github.com/gphoto/libgphoto2/pull/740
2021-11-12 00:54:39 +01:00
..
2005-04-14 21:30:58 +00:00