[sr-dev] git:master: core: use const in some ip_addr functions

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Aug 26 22:01:27 CEST 2010


Module: sip-router
Branch: master
Commit: e18010e954268a69ccbf72025eaf5f52865d88d3
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e18010e954268a69ccbf72025eaf5f52865d88d3

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Thu Aug 26 21:42:54 2010 +0200

core: use const in some ip_addr functions

Fixes various warnings (gcc-4.2) in other parts of the code.

---

 ip_addr.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ip_addr.h b/ip_addr.h
index 50fbf58..d751781 100644
--- a/ip_addr.h
+++ b/ip_addr.h
@@ -365,7 +365,8 @@ static inline void sockaddr2ip_addr(struct ip_addr* ip, struct sockaddr* sa)
 
 
 /* compare 2 sockaddr_unions */
-static inline int su_cmp(union sockaddr_union* s1, union sockaddr_union* s2)
+static inline int su_cmp(const union sockaddr_union* s1,
+						 const union sockaddr_union* s2)
 {
 	if (s1->s.sa_family!=s2->s.sa_family) return 0;
 	switch(s1->s.sa_family){
@@ -387,7 +388,7 @@ static inline int su_cmp(union sockaddr_union* s1, union sockaddr_union* s2)
 
 
 /* gets the port number (host byte order) */
-static inline unsigned short su_getport(union sockaddr_union* su)
+static inline unsigned short su_getport(const union sockaddr_union* su)
 {
 	switch(su->s.sa_family){
 		case AF_INET:




More information about the sr-dev mailing list