X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fnetwork_buffer.c;h=44d93e07606921e476f8e2ecc6b9078ecc56470b;hb=e8f074fabeb5cba5f682e69fa673a7de7b11a2ab;hp=2332e3ec4dc65c23dc734bf6a93c47da8bda9ddf;hpb=4e89060ceb1a14ec7f9abfe9caa6b0da7e76bd5c;p=collectd.git diff --git a/src/libcollectdclient/network_buffer.c b/src/libcollectdclient/network_buffer.c index 2332e3ec..44d93e07 100644 --- a/src/libcollectdclient/network_buffer.c +++ b/src/libcollectdclient/network_buffer.c @@ -24,6 +24,10 @@ * Florian octo Forster **/ +#ifdef WIN32 +#include "gnulib_config.h" +#endif + #include "config.h" #include /* htons */ @@ -130,33 +134,33 @@ static bool have_gcrypt(void) /* {{{ */ if (!need_init) return result; - need_init = 0; + need_init = false; #if HAVE_GCRYPT_H #if GCRYPT_VERSION_NUMBER < 0x010600 if (gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread)) - return 0; + return false; #endif if (!gcry_check_version(GCRYPT_VERSION)) - return 0; + return false; if (!gcry_control(GCRYCTL_INIT_SECMEM, 32768, 0)) - return 0; + return false; gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); - result = 1; - return 1; + result = true; + return true; #else - return 0; + return false; #endif } /* }}} bool have_gcrypt */ #ifndef HAVE_HTONLL static uint64_t htonll(uint64_t val) /* {{{ */ { - static int config = 0; + static int config; uint32_t hi; uint32_t lo; @@ -186,7 +190,7 @@ static uint64_t htonll(uint64_t val) /* {{{ */ static double htond(double val) /* {{{ */ { - static int config = 0; + static int config; union { uint8_t byte[8];