diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-07-27 11:36:55 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-08-02 02:55:42 +0200 |
commit | 1cc2cb9f1b0bfc0f9a15055fae9d8350cc2054d9 (patch) | |
tree | e45863e743a41dd24676b9a06473571ced97cc53 | |
parent | c: specify static array size in function params (diff) | |
download | wireguard-monolithic-historical-1cc2cb9f1b0bfc0f9a15055fae9d8350cc2054d9.tar.xz wireguard-monolithic-historical-1cc2cb9f1b0bfc0f9a15055fae9d8350cc2054d9.zip |
uapi: typeof is not necessary
-rw-r--r-- | src/uapi.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -137,12 +137,12 @@ struct wgdevice { * } * } */ -#define for_each_wgpeer(__dev, __peer, __i) for ((__i) = 0, (__peer) = (typeof(__peer))((uint8_t *)(__dev) + sizeof(struct wgdevice)); \ +#define for_each_wgpeer(__dev, __peer, __i) for ((__i) = 0, (__peer) = (struct wgpeer *)((uint8_t *)(__dev) + sizeof(struct wgdevice)); \ (__i) < (__dev)->num_peers; \ - ++(__i), (__peer) = (typeof(__peer))((uint8_t *)(__peer) + sizeof(struct wgpeer) + (sizeof(struct wgipmask) * (__peer)->num_ipmasks))) + ++(__i), (__peer) = (struct wgpeer *)((uint8_t *)(__peer) + sizeof(struct wgpeer) + (sizeof(struct wgipmask) * (__peer)->num_ipmasks))) -#define for_each_wgipmask(__peer, __ipmask, __i) for ((__i) = 0, (__ipmask) = (typeof(__ipmask))((uint8_t *)(__peer) + sizeof(struct wgpeer)); \ +#define for_each_wgipmask(__peer, __ipmask, __i) for ((__i) = 0, (__ipmask) = (struct wgipmask *)((uint8_t *)(__peer) + sizeof(struct wgpeer)); \ (__i) < (__peer)->num_ipmasks; \ - ++(__i), (__ipmask) = (typeof(__ipmask))((uint8_t *)(__ipmask) + sizeof(struct wgipmask))) + ++(__i), (__ipmask) = (struct wgipmask *)((uint8_t *)(__ipmask) + sizeof(struct wgipmask))) #endif |