Refine the helper function

This commit is contained in:
Max Lv
2019-06-30 22:32:54 +08:00
parent ab9764dbdf
commit f0205e7f13
2 changed files with 8 additions and 7 deletions
+7
View File
@@ -551,3 +551,10 @@ get_default_conf(void)
return "config.json";
#endif
}
uint16_t load16_be(const void *s)
{
const uint8_t *in = (const uint8_t *)s;
return ((uint16_t)in[0] << 8)
| ((uint16_t)in[1]);
}
+1 -7
View File
@@ -249,12 +249,6 @@ void *ss_realloc(void *ptr, size_t new_size);
int ss_is_ipv6addr(const char *addr);
char *get_default_conf(void);
inline uint16_t load16_be(const void *s)
{
const uint8_t *in = (const uint8_t *)s;
return ((uint16_t)in[0] << 8)
| ((uint16_t)in[1]);
}
uint16_t load16_be(const void *s);
#endif // _UTILS_H