diff options
-rw-r--r-- | include/afb/c++/binding-wrap.hpp | 3 | ||||
-rw-r--r-- | src/afb-hook.c | 2 | ||||
-rw-r--r-- | src/wrap-json.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/include/afb/c++/binding-wrap.hpp b/include/afb/c++/binding-wrap.hpp index f94d1bc5..b798cf11 100644 --- a/include/afb/c++/binding-wrap.hpp +++ b/include/afb/c++/binding-wrap.hpp @@ -300,6 +300,7 @@ public: friend class req; afb_req_t req_; contextclass(afb_req_t r) : req_(r) {} + static void default_destroyer(T*t) { delete t; } public: inline operator T *() const { return get(); } @@ -312,7 +313,7 @@ public: nullptr)); } - inline void set(T *value, void (*destroyer)(T*) = [](T*t){delete t;}) const { + inline void set(T *value, void (*destroyer)(T*) = default_destroyer) const { afb_req_context(req_, 1, nullptr, reinterpret_cast<void(*)(void*)>(destroyer), diff --git a/src/afb-hook.c b/src/afb-hook.c index d2ea0b66..9bd480b6 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -201,7 +201,7 @@ static void _hook_(const char *fmt1, const char *fmt2, va_list arg2, ...) iov[4].iov_base = (void*)&chars[9]; iov[4].iov_len = 1; - (void)writev(2, iov, 5); + (void)!writev(2, iov, 5); free(mem1); free(mem2); diff --git a/src/wrap-json.c b/src/wrap-json.c index 6fce73b2..3a764828 100644 --- a/src/wrap-json.c +++ b/src/wrap-json.c @@ -200,7 +200,7 @@ static int decode_base64( size_t *decodedlen, int url) { - uint16_t u16; + uint16_t u16 = 0; uint8_t u8, *result; size_t in, out, iin; char c; |