From 9eff442169b0344a1eeb49a4cf433c04dda9cf2b Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Fri, 22 Apr 2016 15:44:01 +0200 Subject: [PATCH] Squelch conversion warnings with explicit casts --- src/cfg.c | 2 +- src/cfg_private.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index a199a07..48f8253 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -341,7 +341,7 @@ cfg_set_server_port(const char *port_str, const char **errstrp) return (-1); } - port = strtonum(port_str, 1, UINT16_MAX, &errstr); + port = (unsigned int)strtonum(port_str, 1, UINT16_MAX, &errstr); if (errstr) { if (errstrp) *errstrp = errstr; diff --git a/src/cfg_private.h b/src/cfg_private.h index 2baf657..fe6ca97 100644 --- a/src/cfg_private.h +++ b/src/cfg_private.h @@ -141,7 +141,7 @@ struct cfg { return (-1); \ } \ \ - num = strtonum((s), 0, UINT_MAX, &errstr); \ + num = (unsigned int)strtonum((s), 0, UINT_MAX, &errstr); \ if (errstr) { \ if ((e)) \ *(e) = errstr; \ @@ -160,7 +160,7 @@ struct cfg { return (-1); \ } \ \ - num = strtonum((s), INT_MIN, INT_MAX, &errstr); \ + num = (int)strtonum((s), INT_MIN, INT_MAX, &errstr); \ if (errstr) { \ if ((e)) \ *(e) = errstr; \