libusb_cpu_to_le16: macro->static inline function
authorHans Ulrich Niedermann <hun@n-dimensional.de>
Fri, 29 Jan 2010 11:08:52 +0000 (12:08 +0100)
committerDaniel Drake <dan@reactivated.net>
Thu, 13 May 2010 22:01:01 +0000 (19:01 -0300)
commit7ba92cff94bbba19284749c614c26141d3023f37
treedc7c69dbe0ba9fc27d83e0ea4fc3d35ab6b2fc8b
parent3473ac6c6fab32202d02d87679ebdb24e7d2df98
libusb_cpu_to_le16: macro->static inline function

The libusb_cpu_to_le16 macro was a ({ ... }) expression, which
generates the following compiler warning every time it is used,
(and that is several times for every #include <libusb.h>):

libusb.h:880: warning: ISO C forbids braced-groups within expressions

With this patch, #include <libusb.h> stops generating compiler
warnings on gcc 4.4.

As libusb.h heavily relies on the use of static inline functions
those can be relied on to work properly, and there should not be
any significant difference in the code the compiler generates.
libusb/libusb.h