Skip to content

Commit

Permalink
iio.h: Fix invalid number of attributes in C11 generic macros
Browse files Browse the repository at this point in the history
The C11 generic macros iio_attr_read() / iio_attr_write() were passing
too many arguments to the underlying functions.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Nov 29, 2023
1 parent 7d97827 commit f924bb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ iio_attr_read_raw(const struct iio_attr *attr, char *dst, size_t len);
_Generic((ptr), \
bool *: iio_attr_read_bool, \
long long *: iio_attr_read_longlong, \
double *: iio_attr_read_double)(chn, attr, ptr)
double *: iio_attr_read_double)(attr, ptr)

/** @brief Set the value of the given attribute
* @param attr A pointer to an iio_attr structure
Expand All @@ -375,7 +375,7 @@ iio_attr_write_raw(const struct iio_attr *attr, const void *src, size_t len);
char *: iio_attr_write_string, \
bool: iio_attr_write_bool, \
long long: iio_attr_write_longlong, \
double: iio_attr_write_double)(dev, attr, val)
double: iio_attr_write_double)(attr, val)

/** @brief Retrieve the name of an attribute
* @param attr A pointer to an iio_attr structure
Expand Down

0 comments on commit f924bb4

Please sign in to comment.