diff options
Diffstat (limited to 'lib/erl_interface')
-rw-r--r-- | lib/erl_interface/src/connect/ei_resolve.c | 9 | ||||
-rw-r--r-- | lib/erl_interface/src/encode/encode_ulonglong.c | 2 | ||||
-rw-r--r-- | lib/erl_interface/src/legacy/erl_marshal.c | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c index 2545c5f3de..74dcba61a7 100644 --- a/lib/erl_interface/src/connect/ei_resolve.c +++ b/lib/erl_interface/src/connect/ei_resolve.c @@ -173,6 +173,8 @@ static int verify_dns_configuration(void) #endif +#if defined(VXWORKS) || _REENTRANT + /* * Copy the contents of one struct hostent to another, i.e. don't just * copy the pointers, copy all the data and create new pointers, etc. @@ -226,7 +228,7 @@ static int copy_hostent(struct hostent *dest, const struct hostent *src, char *b while(*(src_aliases)) { if (buflen < sizeof(*pptr)) return -1; - *pptr = src_aliases; + *pptr = (char *)src_aliases; advance_buf(buffer,buflen,sizeof(*pptr)); src_aliases++; pptr++; @@ -357,6 +359,10 @@ static struct hostent *my_gethostbyname_r(const char *name, return rval; } +#endif /* defined(VXWORKS) || _REENTRANT */ + +#if defined(VXWORKS) || EI_THREADS != false + static struct hostent *my_gethostbyaddr_r(const char *addr, int length, int type, @@ -418,6 +424,7 @@ static struct hostent *my_gethostbyaddr_r(const char *addr, return rval; } +#endif /* defined(VXWORKS) || EI_THREADS != false */ #endif /* !HAVE_GETHOSTBYNAME_R */ diff --git a/lib/erl_interface/src/encode/encode_ulonglong.c b/lib/erl_interface/src/encode/encode_ulonglong.c index 0f21af2a91..2f136abf96 100644 --- a/lib/erl_interface/src/encode/encode_ulonglong.c +++ b/lib/erl_interface/src/encode/encode_ulonglong.c @@ -52,7 +52,7 @@ int ei_encode_ulonglong(char *buf, int *index, EI_ULONGLONG p) char *s = buf + *index; char *s0 = s; - if ((p < 256) && (p >= 0)) { + if (p < 256) { if (!buf) s += 2; else { put8(s,ERL_SMALL_INTEGER_EXT); diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c index e207b5f0f1..9558dc134b 100644 --- a/lib/erl_interface/src/legacy/erl_marshal.c +++ b/lib/erl_interface/src/legacy/erl_marshal.c @@ -290,7 +290,7 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist) return 0; } /* SMALL_INTEGER */ - if ((ul < 256) && (ul >= 0)) { + if (ul < 256) { *(*ext)++ = ERL_SMALL_INTEGER_EXT; *(*ext)++ = ul & 0xff; return 0; |