[riot-notifications] [RIOT-OS/RIOT] nanocoap: change method flag type to uint32_t (#10214)

Marian Buschsieweke notifications at github.com
Wed Feb 27 19:26:35 CET 2019

maribu commented on this pull request.

> @@ -250,7 +250,7 @@ typedef ssize_t (*coap_handler_t)(coap_pkt_t *pkt, uint8_t *buf, size_t len, voi
 typedef struct {
     const char *path;               /**< URI path of resource               */
-    unsigned methods;               /**< OR'ed methods this resource allows */
+    uint32_t methods;               /**< OR'ed methods this resource allows */

> I didn't say `enum`. From my experience, using `enum`s for flags lead to insufferable pain.

Why not using an anonymous `enum` instead of `#define`s for the values? The bitmask can still be stored in `uint8_t`. I made good experience with this approach ;-)

+1 for using a `typedef` to allow future changes

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190227/923cb2e4/attachment.html>

More information about the notifications mailing list