Module: kamailio
Branch: master
Commit: 7a33987ab4e74266cd0ccecbe14f7196f97a0f05
URL: 
https://github.com/kamailio/kamailio/commit/7a33987ab4e74266cd0ccecbe14f7196f97a0f05

Author: Victor Seva <[email protected]>
Committer: Victor Seva <[email protected]>
Date: 2015-06-03T09:35:51+02:00

tls: fix gcc warnings:

tls_domain.c:507:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_domain.c:537:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_domain.c:544:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_domain.c:576:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_domain.c:1096:5: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_domain.c:1104:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_domain.c:1111:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_server.c:222:3: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_server.c:565:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_server.c:843:5: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_server.c:877:5: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_server.c:1231:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
tls_server.c:1265:4: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]

---

Modified: modules/tls/tls_util.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/7a33987ab4e74266cd0ccecbe14f7196f97a0f05.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7a33987ab4e74266cd0ccecbe14f7196f97a0f05.patch

---

diff --git a/modules/tls/tls_util.h b/modules/tls/tls_util.h
index efbd842..6fe91a2 100644
--- a/modules/tls/tls_util.h
+++ b/modules/tls/tls_util.h
@@ -31,26 +31,29 @@
 #include "../../str.h"
 #include "tls_domain.h"
 
+static inline int tls_err_ret(char *s, tls_domains_cfg_t **tls_domains_cfg) {
+       long err;
+       int ret = 0;
+       if ((*tls_domains_cfg)->srv_default->ctx &&
+               (*tls_domains_cfg)->srv_default->ctx[0])
+       {
+               while((err = ERR_get_error())) {
+                       ret = 1;
+                       ERR("%s%s\n", s ? s : "", ERR_error_string(err, 0));
+               }
+       }
+       return ret;
+}
 
-#define TLS_ERR_RET(r, s)                               \
-do {                                                    \
-       long err;                                       \
-        (r) = 0;                                        \
-       if ((*tls_domains_cfg)->srv_default->ctx &&         \
-           (*tls_domains_cfg)->srv_default->ctx[0]) {      \
-               while((err = ERR_get_error())) {        \
-                       (r) = 1;                        \
-                       ERR("%s%s\n", ((s)) ? (s) : "", \
-                           ERR_error_string(err, 0));  \
-               }                                       \
-       }                                               \
+#define TLS_ERR_RET(r, s) \
+do { \
+       (r) = tls_err_ret((s), tls_domains_cfg); \
 } while(0)
 
 
-#define TLS_ERR(s)           \
-do {                         \
-       int ret;             \
-       TLS_ERR_RET(ret, s); \
+#define TLS_ERR(s) \
+do { \
+       tls_err_ret((s), tls_domains_cfg); \
 } while(0)
 
 


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to