This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/5] resolv: don't pass struct ns_mst by value


Fixes LGTM warning: "This parameter of type ns_msg is 80 bytes -
consider passing a const pointer/reference instead."

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
---
 resolv/arpa/nameser.h | 2 +-
 resolv/ns_parse.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index a99d5ec508..7d2f717848 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -390,7 +390,7 @@ typedef enum __ns_cert_types {
 } while (0)
 
 __BEGIN_DECLS
-int		ns_msg_getflag (ns_msg, int) __THROW;
+int		ns_msg_getflag (const ns_msg*, int) __THROW;
 unsigned int	ns_get16 (const unsigned char *) __THROW;
 unsigned long	ns_get32 (const unsigned char *) __THROW;
 void		ns_put16 (unsigned int, unsigned char *) __THROW;
diff --git a/resolv/ns_parse.c b/resolv/ns_parse.c
index 863b20a9f7..5211bcdd49 100644
--- a/resolv/ns_parse.c
+++ b/resolv/ns_parse.c
@@ -57,8 +57,8 @@ const struct _ns_flagdata _ns_flagdata[16] = {
 };
 
 #undef ns_msg_getflag
-int ns_msg_getflag(ns_msg handle, int flag) {
-	return(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift);
+int ns_msg_getflag(const ns_msg *handle, int flag) {
+	return(((handle)->_flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift);
 }
 
 int
-- 
2.21.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]