diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-10 17:53:50 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-10 17:53:50 +0100 |
commit | 07c15041f3a502e22d1c239bca77c85c6b2bb39c (patch) | |
tree | 4b70fee15cca0ce89faedfbd0270eecbb25c12bc /src/nat | |
parent | 70007393fe832a3da849cf697797da96845e2698 (diff) | |
download | gnunet-07c15041f3a502e22d1c239bca77c85c6b2bb39c.tar.gz gnunet-07c15041f3a502e22d1c239bca77c85c6b2bb39c.zip |
disambiguate enum type of value
Diffstat (limited to 'src/nat')
-rw-r--r-- | src/nat/nat_stun.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nat/nat_stun.h b/src/nat/nat_stun.h index 3e4228875..8d1c2720f 100644 --- a/src/nat/nat_stun.h +++ b/src/nat/nat_stun.h | |||
@@ -70,7 +70,7 @@ struct stun_addr | |||
70 | * Port number. | 70 | * Port number. |
71 | */ | 71 | */ |
72 | uint16_t port; | 72 | uint16_t port; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * IPv4 address. Should this be "struct in_addr"? | 75 | * IPv4 address. Should this be "struct in_addr"? |
76 | */ | 76 | */ |
@@ -79,7 +79,7 @@ struct stun_addr | |||
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * STUN message classes | 82 | * STUN message classes |
83 | */ | 83 | */ |
84 | enum StunClasses { | 84 | enum StunClasses { |
85 | INVALID_CLASS = 0, | 85 | INVALID_CLASS = 0, |
@@ -186,18 +186,19 @@ stun_msg2str (int msg) | |||
186 | static char result[64]; | 186 | static char result[64]; |
187 | const char *msg_class = NULL; | 187 | const char *msg_class = NULL; |
188 | const char *method = NULL; | 188 | const char *method = NULL; |
189 | int value; | 189 | enum StunClasses cvalue; |
190 | enum StunMethods mvalue; | ||
190 | 191 | ||
191 | value = decode_class (msg); | 192 | cvalue = decode_class (msg); |
192 | for (unsigned int i = 0; classes[i].name; i++) | 193 | for (unsigned int i = 0; classes[i].name; i++) |
193 | if (classes[i].value == value) | 194 | if (classes[i].value == cvalue) |
194 | { | 195 | { |
195 | msg_class = classes[i].name; | 196 | msg_class = classes[i].name; |
196 | break; | 197 | break; |
197 | } | 198 | } |
198 | value = decode_method (msg); | 199 | mvalue = decode_method (msg); |
199 | for (unsigned int i = 0; methods[i].name; i++) | 200 | for (unsigned int i = 0; methods[i].name; i++) |
200 | if (methods[i].value == value) | 201 | if (methods[i].value == mvalue) |
201 | { | 202 | { |
202 | method = methods[i].name; | 203 | method = methods[i].name; |
203 | break; | 204 | break; |