X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fhelper%2Freplacements.h;h=84530d3f78f7acb8385fe6a0c3d36d56c63269e1;hb=9c05c92c1437dc243b52d9281ab77e8ac223816f;hp=18a2c3ea87b01579c5acf019faa1e2fe3baef07f;hpb=14f3548ff2c4f9d208e2bac129a5ab1bd9a09f19;p=openocd diff --git a/src/helper/replacements.h b/src/helper/replacements.h index 18a2c3ea..84530d3f 100644 --- a/src/helper/replacements.h +++ b/src/helper/replacements.h @@ -28,10 +28,10 @@ /* MIN,MAX macros */ #ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MIN(a,b) (((a) < (b))?(a):(b)) #endif #ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MAX(a,b) (((a) > (b))?(a):(b)) #endif /* for systems that do not support ENOTSUP @@ -161,7 +161,7 @@ int win_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct time #endif /* _WIN32 */ /* generic socket functions for Windows and Posix */ -static __inline int write_socket( int handle, const void *buffer, unsigned int count ) +static __inline int write_socket(int handle, const void *buffer, unsigned int count) { #ifdef _WIN32 return send(handle, buffer, count, 0); @@ -170,7 +170,7 @@ static __inline int write_socket( int handle, const void *buffer, unsigned int c #endif } -static __inline int read_socket( int handle, void *buffer, unsigned int count ) +static __inline int read_socket(int handle, void *buffer, unsigned int count) { #ifdef _WIN32 return recv(handle, buffer, count, 0); @@ -192,7 +192,7 @@ static __inline void socket_nonblock(int fd) { #ifdef _WIN32 unsigned long nonblock = 1; - ioctlsocket(fd, FIONBIO, &nonblock ); + ioctlsocket(fd, FIONBIO, &nonblock); #else int oldopts = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, oldopts | O_NONBLOCK);