summaryrefslogtreecommitdiff
path: root/toxcore/util.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-02-24 20:32:38 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-02-24 20:35:57 +0000
commitafc80922e720f5d2a93bdfb3745da058e5ddf81b (patch)
tree69c00a0d1d6e6217e443dfc8e344af78e6cc8dd0 /toxcore/util.c
parent25debce85074f6f0883905fa496829125ddad713 (diff)
Some minor cleanups suggested by cppcheck.
DETECTED=cppcheck
Diffstat (limited to 'toxcore/util.c')
-rw-r--r--toxcore/util.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toxcore/util.c b/toxcore/util.c
index e19808a2..b7a8fda6 100644
--- a/toxcore/util.c
+++ b/toxcore/util.c
@@ -130,7 +130,6 @@ int load_state(load_state_callback_func load_state_callback, Logger *log, void *
130 } 130 }
131 131
132 132
133 uint16_t type;
134 uint32_t length_sub, cookie_type; 133 uint32_t length_sub, cookie_type;
135 uint32_t size_head = sizeof(uint32_t) * 2; 134 uint32_t size_head = sizeof(uint32_t) * 2;
136 135
@@ -152,9 +151,8 @@ int load_state(load_state_callback_func load_state_callback, Logger *log, void *
152 return -1; 151 return -1;
153 } 152 }
154 153
155 type = lendian_to_host16(cookie_type & 0xFFFF); 154 const uint16_t type = lendian_to_host16(cookie_type & 0xFFFF);
156 155 const int ret = load_state_callback(outer, data, length_sub, type);
157 int ret = load_state_callback(outer, data, length_sub, type);
158 156
159 if (ret == -1) { 157 if (ret == -1) {
160 return -1; 158 return -1;