mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
misc: Use simpler macros for htonll and ntohll
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
17
src/misc.c
17
src/misc.c
@@ -290,23 +290,6 @@ int ssh_is_ipaddr(const char *str) {
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifndef HAVE_NTOHLL
|
||||
uint64_t ntohll(uint64_t a) {
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
return a;
|
||||
#else /* WORDS_BIGENDIAN */
|
||||
return (((uint64_t)(a) << 56) | \
|
||||
(((uint64_t)(a) << 40) & 0xff000000000000ULL) | \
|
||||
(((uint64_t)(a) << 24) & 0xff0000000000ULL) | \
|
||||
(((uint64_t)(a) << 8) & 0xff00000000ULL) | \
|
||||
(((uint64_t)(a) >> 8) & 0xff000000ULL) | \
|
||||
(((uint64_t)(a) >> 24) & 0xff0000ULL) | \
|
||||
(((uint64_t)(a) >> 40) & 0xff00ULL) | \
|
||||
((uint64_t)(a) >> 56));
|
||||
#endif /* WORDS_BIGENDIAN */
|
||||
}
|
||||
#endif /* HAVE_NTOHLL */
|
||||
|
||||
char *ssh_lowercase(const char* str) {
|
||||
char *new, *p;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user