From de292aa1dd1942e151ff034fcb88504a86742f97 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sun, 3 Aug 2014 14:02:04 -0400 Subject: resolve-host: make arg_type an int We are using it also to store _DNS_TYPE_INVALID, so it should be signed. --- src/resolve/dns-type.c | 8 +++----- src/resolve/dns-type.h | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src/resolve') diff --git a/src/resolve/dns-type.c b/src/resolve/dns-type.c index 271a7e176b..a3e740896f 100644 --- a/src/resolve/dns-type.c +++ b/src/resolve/dns-type.c @@ -32,16 +32,14 @@ lookup_dns_type (register const char *str, register unsigned int len); #include "dns_type-from-name.h" #include "dns_type-to-name.h" -int dns_type_from_string(const char *s, uint16_t *type) { +int dns_type_from_string(const char *s) { const struct dns_type_name *sc; assert(s); - assert(type); sc = lookup_dns_type(s, strlen(s)); if (!sc) - return -EINVAL; + return _DNS_TYPE_INVALID; - *type = sc->id; - return 0; + return sc->id; } diff --git a/src/resolve/dns-type.h b/src/resolve/dns-type.h index 66063153a0..86951d233a 100644 --- a/src/resolve/dns-type.h +++ b/src/resolve/dns-type.h @@ -21,12 +21,10 @@ #pragma once -#include - #include "macro.h" -const char *dns_type_to_string(uint16_t type); -int dns_type_from_string(const char *s, uint16_t *type); +const char *dns_type_to_string(int type); +int dns_type_from_string(const char *s); /* DNS record types, taken from * http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml. -- cgit v1.2.3-54-g00ecf