diff options
author | Henrik Nord <[email protected]> | 2013-12-02 15:49:58 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2013-12-02 15:50:01 +0100 |
commit | 87054d91f9cb191274a56ac80a8ab29c4cb3a0ef (patch) | |
tree | 4e2e9dc83a55f5a0621d4790c181d56ca35a9bc5 | |
parent | 3e7d99747edeb7b22f8c6cea937cdd830613dcad (diff) | |
parent | 80f95d2ab4352eef90ae2546a8e42f4ed82cd738 (diff) | |
download | otp-87054d91f9cb191274a56ac80a8ab29c4cb3a0ef.tar.gz otp-87054d91f9cb191274a56ac80a8ab29c4cb3a0ef.tar.bz2 otp-87054d91f9cb191274a56ac80a8ab29c4cb3a0ef.zip |
Merge branch 'nox/fix-clang-warnings' into maint
* nox/fix-clang-warnings:
Silence warnings about socklen_t pointers sign in erl_memory
Compile in_heapfrag() only in debug mode
Silence two warnings about tests being always true
Conditionally compile my_gethostbyname_r and my_gethostbyaddr_r
Silence a mismatching type pointer warning in ei_resolve
Silence warnings about different buffer types in erl_memory
erts: Remove unused file winsock_func.h
Silence warnings about unused return values in ic
Silence a warning in erl_poll about an empty loop body
Fix erts_check_off_heap2 assertion
Properly mark erl_assert_error as non-returning
Remove uninitialized use of new_crr in erl_alloc_util
OTP-11517
-rw-r--r-- | erts/emulator/beam/erl_alloc_util.c | 1 | ||||
-rw-r--r-- | erts/emulator/beam/erl_gc.c | 2 | ||||
-rw-r--r-- | erts/emulator/beam/erl_message.c | 2 | ||||
-rw-r--r-- | erts/emulator/beam/sys.h | 38 | ||||
-rw-r--r-- | erts/emulator/drivers/win32/winsock_func.h | 102 | ||||
-rw-r--r-- | erts/emulator/sys/common/erl_poll.c | 3 | ||||
-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 | ||||
-rw-r--r-- | lib/ic/c_src/oe_ei_code_erlang_binary.c | 2 | ||||
-rw-r--r-- | lib/ic/c_src/oe_ei_encode_atom.c | 2 | ||||
-rw-r--r-- | lib/ic/c_src/oe_ei_encode_port.c | 2 | ||||
-rw-r--r-- | lib/ic/c_src/oe_ei_encode_ref.c | 2 | ||||
-rw-r--r-- | lib/ic/c_src/oe_ei_encode_string.c | 2 | ||||
-rw-r--r-- | lib/ic/c_src/oe_ei_encode_term.c | 2 | ||||
-rw-r--r-- | lib/tools/c_src/erl_memory.c | 73 |
16 files changed, 78 insertions, 168 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c index 3914537d0d..c6cea0185f 100644 --- a/erts/emulator/beam/erl_alloc_util.c +++ b/erts/emulator/beam/erl_alloc_util.c @@ -3570,7 +3570,6 @@ resize_carrier(Allctr_t *allctr, Block_t *old_blk, Uint umem_sz, UWord flags) /* Old carrier unchanged; restore... */ STAT_SYS_ALLOC_SBC_ALLOC(allctr, old_crr_sz, old_blk_sz); } - DEBUG_SAVE_ALIGNMENT(new_crr); return new_blk; } #endif diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index 8ba94d89e9..e89725c190 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -2770,7 +2770,7 @@ erts_check_off_heap2(Process *p, Eterm *htop) refc = erts_refc_read(&u.ext->node->refc, 1); break; default: - ASSERT(!!"erts_check_off_heap2: Invalid thing_word"); + ASSERT(!"erts_check_off_heap2: Invalid thing_word"); } ERTS_CHK_OFFHEAP_ASSERT(refc >= 1); #ifdef ERTS_OFFHEAP_DEBUG_CHK_CIRCULAR_LIST diff --git a/erts/emulator/beam/erl_message.c b/erts/emulator/beam/erl_message.c index 325d77e911..6a9030fd99 100644 --- a/erts/emulator/beam/erl_message.c +++ b/erts/emulator/beam/erl_message.c @@ -46,10 +46,12 @@ ERTS_SCHED_PREF_QUICK_ALLOC_IMPL(message, +#ifdef DEBUG static ERTS_INLINE int in_heapfrag(const Eterm* ptr, const ErlHeapFragment *bp) { return ((unsigned)(ptr - bp->mem) < bp->used_size); } +#endif void diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index d22f125945..31252ed78f 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -149,9 +149,28 @@ typedef ERTS_SYS_FD_TYPE ErtsSysFdType; # define ERTS_EXIT_AFTER_DUMP exit #endif +/* In VC++, noreturn is a declspec that has to be before the types, + * but in GNUC it is an att ribute to be placed between return type + * and function name, hence __decl_noreturn <types> __noreturn <function name> + */ +#if __GNUC__ +# define __decl_noreturn +# define __noreturn __attribute__((noreturn)) +#else +# if defined(__WIN32__) && defined(_MSC_VER) +# define __noreturn +# define __decl_noreturn __declspec(noreturn) +# else +# define __noreturn +# define __decl_noreturn +# endif +#endif + #define ERTS_ASSERT(e) \ ((void) ((e) ? 1 : (erl_assert_error(#e, __func__, __FILE__, __LINE__), 0))) -void erl_assert_error(const char* expr, const char *func, const char* file, int line); + +__decl_noreturn void __noreturn erl_assert_error(const char* expr, const char *func, + const char* file, int line); #ifdef DEBUG # define ASSERT(e) ERTS_ASSERT(e) @@ -192,23 +211,6 @@ void erl_assert_error(const char* expr, const char *func, const char* file, int # define erts_align_attribute(SZ) #endif -/* In VC++, noreturn is a declspec that has to be before the types, - * but in GNUC it is an att ribute to be placed between return type - * and function name, hence __decl_noreturn <types> __noreturn <function name> - */ -#if __GNUC__ -# define __decl_noreturn -# define __noreturn __attribute__((noreturn)) -#else -# if defined(__WIN32__) && defined(_MSC_VER) -# define __noreturn -# define __decl_noreturn __declspec(noreturn) -# else -# define __noreturn -# define __decl_noreturn -# endif -#endif - /* ** Data types: ** diff --git a/erts/emulator/drivers/win32/winsock_func.h b/erts/emulator/drivers/win32/winsock_func.h deleted file mode 100644 index 9d2c099c4d..0000000000 --- a/erts/emulator/drivers/win32/winsock_func.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * %CopyrightBegin% - * - * Copyright Ericsson AB 1997-2009. All Rights Reserved. - * - * The contents of this file are subject to the Erlang Public License, - * Version 1.1, (the "License"); you may not use this file except in - * compliance with the License. You should have received a copy of the - * Erlang Public License along with this software. If not, it can be - * retrieved online at http://www.erlang.org/. - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. - * - * %CopyrightEnd% - */ - -typedef struct _WinSockFuncs { - int (WSAAPI *WSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData); - int (WSAAPI *WSACleanup)(void); - int (WSAAPI *WSAGetLastError)(void); - DWORD (WSAAPI *WSAWaitForMultipleEvents) (DWORD cEvents, - const WSAEVENT FAR * lphEvents, - BOOL fWaitAll, - DWORD dwTimeout, - BOOL fAlertable); - WSAEVENT (WSAAPI *WSACreateEvent)(void); - BOOL (WSAAPI *WSACloseEvent)(WSAEVENT hEvent); - - BOOL (WSAAPI *WSASetEvent)(WSAEVENT hEvent); - BOOL (WSAAPI *WSAResetEvent)(WSAEVENT hEvent); - int (WSAAPI *WSAEventSelect)(SOCKET s, WSAEVENT hEventObject, - long lNetworkEvents); - int (WSAAPI *WSAEnumNetworkEvents)(SOCKET s, - WSAEVENT hEventObject, - LPWSANETWORKEVENTS lpNetworkEvents); - int (WSAAPI *WSAIoctl)(SOCKET s, - DWORD dwIoControlCode, - LPVOID lpvInBuffer, - DWORD cbInBuffer, - LPVOID lpvOUTBuffer, - DWORD cbOUTBuffer, - LPDWORD lpcbBytesReturned, - LPWSAOVERLAPPED lpOverlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionROUTINE - ); - SOCKET (WSAAPI *accept)(SOCKET s, struct sockaddr FAR *addr, - int FAR *addrlen); - int (WSAAPI *bind)(SOCKET s, const struct sockaddr FAR *addr, - int namelen); - int (WSAAPI *closesocket)(SOCKET s); - int (WSAAPI *connect)(SOCKET s, const struct sockaddr FAR *name, - int namelen); - int (WSAAPI *ioctlsocket)(SOCKET s, long cmd, u_long FAR *argp); - int (WSAAPI *getsockopt)(SOCKET s, int level, int optname, - char FAR * optval, int FAR *optlen); - u_long (WSAAPI *htonl)(u_long hostlong); - u_short (WSAAPI *htons)(u_short hostshort); - unsigned long (WSAAPI *inet_addr)(const char FAR * cp); - char FAR * (WSAAPI *inet_ntoa)(struct in_addr in); - int (WSAAPI *listen)(SOCKET s, int backlog); - u_short (WSAAPI *ntohs)(u_short netshort); - int (WSAAPI *recv)(SOCKET s, char FAR * buf, int len, int flags); - int (WSAAPI *send)(SOCKET s, const char FAR * buf, int len, int flags); - int (WSAAPI *setsockopt)(SOCKET s, int level, int optname, - const char FAR * optval, int optlen); - int (WSAAPI *shutdown)(SOCKET s, int how); - SOCKET (WSAAPI *socket)(int af, int type, int protocol); - struct hostent FAR * (WSAAPI *gethostbyname)(const char FAR * name); - struct hostent FAR * (WSAAPI *gethostbyaddr)(const char FAR *addr, - int addrlen, int addrtype); - int (WSAAPI *gethostname)(char FAR * name, int namelen); - struct servent FAR * (WSAAPI *getservbyname)(const char FAR * name, - const char FAR * proto); - struct servent FAR * (WSAAPI *getservbyport)(int port, - const char FAR * proto); - int (WSAAPI *getsockname)(SOCKET sock, struct sockaddr FAR *name, - int FAR *namelen); - - /* - * New, added for inet_drv. - */ - - int (WSAAPI *getpeername)(SOCKET s, struct sockaddr FAR * name, - int FAR * namelen); - u_long (WSAAPI *ntohl)(u_long netlong); - int (WSAAPI *WSASend)(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, - LPDWORD lpNumberOfBytesSent, DWORD dwFlags, - LPWSAOVERLAPPED lpOverlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); - int (WSAAPI *sendto)(SOCKET s, const char FAR * buf, int len, - int flags, const struct sockaddr FAR * to, int tolen); - int (WSAAPI *recvfrom)(SOCKET s, char FAR * buf, int len, int flags, - struct sockaddr FAR * from, int FAR * fromlen); -} WinSockFuncs; - - -extern WinSockFuncs winSock; - -extern int tcp_lookup_functions(void); diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c index 7676d8872a..0a58a625b2 100644 --- a/erts/emulator/sys/common/erl_poll.c +++ b/erts/emulator/sys/common/erl_poll.c @@ -2510,7 +2510,8 @@ ERTS_POLL_EXPORT(erts_poll_destroy_pollset)(ErtsPollSet ps) pollsets = pollsets->next; else { ErtsPollSet prev_ps; - for (prev_ps = pollsets; ps != prev_ps->next; prev_ps = prev_ps->next); + for (prev_ps = pollsets; ps != prev_ps->next; prev_ps = prev_ps->next) + ; ASSERT(ps == prev_ps->next); prev_ps->next = ps->next; } 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; diff --git a/lib/ic/c_src/oe_ei_code_erlang_binary.c b/lib/ic/c_src/oe_ei_code_erlang_binary.c index f790f8bd69..a484dadbe0 100644 --- a/lib/ic/c_src/oe_ei_code_erlang_binary.c +++ b/lib/ic/c_src/oe_ei_code_erlang_binary.c @@ -24,7 +24,7 @@ int oe_encode_erlang_binary(CORBA_Environment *ev, erlang_binary *binary) { int size = ev->_iout; - (int) ei_encode_binary(0, &size, binary->_buffer, binary->_length); + ei_encode_binary(0, &size, binary->_buffer, binary->_length); if (size >= ev->_outbufsz) { char *buf = ev->_outbuf; diff --git a/lib/ic/c_src/oe_ei_encode_atom.c b/lib/ic/c_src/oe_ei_encode_atom.c index d16df25859..c643cf4fee 100644 --- a/lib/ic/c_src/oe_ei_encode_atom.c +++ b/lib/ic/c_src/oe_ei_encode_atom.c @@ -23,7 +23,7 @@ int oe_ei_encode_atom(CORBA_Environment *ev, const char *p) { int size = ev->_iout; - (int) ei_encode_atom(0,&size,p); + ei_encode_atom(0,&size,p); if (size >= ev->_outbufsz) { char *buf = ev->_outbuf; diff --git a/lib/ic/c_src/oe_ei_encode_port.c b/lib/ic/c_src/oe_ei_encode_port.c index 981f82c08d..4be1523df1 100644 --- a/lib/ic/c_src/oe_ei_encode_port.c +++ b/lib/ic/c_src/oe_ei_encode_port.c @@ -23,7 +23,7 @@ int oe_ei_encode_port(CORBA_Environment *ev, const erlang_port *p) { int size = ev->_iout; - (int) ei_encode_port(NULL, &size, p); + ei_encode_port(NULL, &size, p); if (size >= ev->_outbufsz) { char *buf = ev->_outbuf; diff --git a/lib/ic/c_src/oe_ei_encode_ref.c b/lib/ic/c_src/oe_ei_encode_ref.c index d321469b45..71dc5e5a70 100644 --- a/lib/ic/c_src/oe_ei_encode_ref.c +++ b/lib/ic/c_src/oe_ei_encode_ref.c @@ -23,7 +23,7 @@ int oe_ei_encode_ref(CORBA_Environment *ev, const erlang_ref *p) { int size = ev->_iout; - (int) ei_encode_ref(NULL, &size, p); + ei_encode_ref(NULL, &size, p); if (size >= ev->_outbufsz) { char *buf = ev->_outbuf; diff --git a/lib/ic/c_src/oe_ei_encode_string.c b/lib/ic/c_src/oe_ei_encode_string.c index 48de73b5a8..a52a2e639d 100644 --- a/lib/ic/c_src/oe_ei_encode_string.c +++ b/lib/ic/c_src/oe_ei_encode_string.c @@ -23,7 +23,7 @@ int oe_ei_encode_string(CORBA_Environment *ev, const char *p) { int size = ev->_iout; - (int) ei_encode_string(0,&size,p); + ei_encode_string(0,&size,p); if (size >= ev->_outbufsz) { char *buf = ev->_outbuf; diff --git a/lib/ic/c_src/oe_ei_encode_term.c b/lib/ic/c_src/oe_ei_encode_term.c index 48de152ac6..b1f1375638 100644 --- a/lib/ic/c_src/oe_ei_encode_term.c +++ b/lib/ic/c_src/oe_ei_encode_term.c @@ -23,7 +23,7 @@ int oe_ei_encode_term(CORBA_Environment *ev, void *t) { int size = ev->_iout; - (int) ei_encode_term(NULL, &size, t); + ei_encode_term(NULL, &size, t); if (size >= ev->_outbufsz) { char *buf = ev->_outbuf; diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c index 86e84723b1..c4e126a7b1 100644 --- a/lib/tools/c_src/erl_memory.c +++ b/lib/tools/c_src/erl_memory.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2003-2012. All Rights Reserved. + * Copyright Ericsson AB 2003-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -30,6 +30,7 @@ # undef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # include <windows.h> +typedef int socklen_t; #else # if defined(__linux__) && defined(__GNUC__) # define _GNU_SOURCE 1 @@ -149,11 +150,11 @@ typedef struct { typedef struct em_buffer_ { struct em_buffer_ *next; int write; - usgnd_int_8 *data; - usgnd_int_8 *data_end; - usgnd_int_8 *end; + char *data; + char *data_end; + char *end; size_t size; - usgnd_int_8 start[EM_DEFAULT_BUF_SZ]; + char start[EM_DEFAULT_BUF_SZ]; } em_buffer; typedef struct { @@ -173,7 +174,7 @@ typedef struct { } em_buf_queue; typedef struct { - usgnd_int_8 *ptr; + char *ptr; size_t size; } em_area; @@ -460,7 +461,7 @@ enqueue(em_state *state, em_buf_queue *queue, size_t min_size) bsize = min_size; buf = (em_buffer *) (*state->alloc)(sizeof(em_buffer) - + (sizeof(usgnd_int_8) + + (sizeof(char) * (bsize-EM_DEFAULT_BUF_SZ))); if (buf) { buf->size = bsize; @@ -595,12 +596,12 @@ get_next_write_area(em_area *area, em_state *state, em_buf_queue *queue, \* */ static INLINE size_t -write_str(usgnd_int_8 **dstpp, char *srcp) +write_str(char **dstpp, char *srcp) { size_t i = 0; if (dstpp) while (srcp[i]) - *((*dstpp)++) = (usgnd_int_8) srcp[i++]; + *((*dstpp)++) = srcp[i++]; else while (srcp[i]) i++; return i; @@ -608,7 +609,7 @@ write_str(usgnd_int_8 **dstpp, char *srcp) static size_t -write_strings(usgnd_int_8 **ptr, +write_strings(char **ptr, char **strings, char *first_line_prefix, char *line_prefix, @@ -640,10 +641,10 @@ write_strings(usgnd_int_8 **ptr, } static size_t -write_title(usgnd_int_8 **bufp, size_t *overflow, size_t width, char *str) +write_title(char **bufp, size_t *overflow, size_t width, char *str) { size_t i, sz, ws; - usgnd_int_8 *p, *endp; + char *p, *endp; /* * Writes at least one '|' character at the beginning. @@ -689,16 +690,16 @@ write_title(usgnd_int_8 **bufp, size_t *overflow, size_t width, char *str) *(p++) = '|'; while (ws > 1) { ws--; - *(p++) = (usgnd_int_8) ' '; + *(p++) = ' '; } i = 0; while (str[i] && (overflow || p < endp)) - *(p++) = (usgnd_int_8) str[i++]; + *(p++) = str[i++]; while (ws) { ws--; - *(p++) = (usgnd_int_8) ' '; + *(p++) = ' '; } ASSERT(overflow || p == endp); @@ -708,7 +709,7 @@ write_title(usgnd_int_8 **bufp, size_t *overflow, size_t width, char *str) } static size_t -write_obj_sub_titles(em_state *state, usgnd_int_8 **bufp, size_t *overflow) +write_obj_sub_titles(em_state *state, char **bufp, size_t *overflow) { size_t field_width = state->output.field_width; size_t size = write_title(bufp, overflow, field_width, "size"); @@ -733,12 +734,12 @@ write_obj_sub_titles(em_state *state, usgnd_int_8 **bufp, size_t *overflow) } static size_t -write_header(em_state *state, usgnd_int_8 *ptr, int trunc) +write_header(em_state *state, char *ptr, int trunc) { #define MIN_LTEXT_SZ 18 #define HEADER_EOL_STR "|\n" - usgnd_int_8 *p; - usgnd_int_8 **pp; + char *p; + char **pp; int i; size_t overflow; size_t *ofp; @@ -855,7 +856,7 @@ write_header(em_state *state, usgnd_int_8 *ptr, int trunc) } static INLINE void -write_mem_info(em_state *state, usgnd_int_8 **p, em_mem_info *mi) +write_mem_info(em_state *state, char **p, em_mem_info *mi) { int fw = state->output.field_width - 1; *p += sprintf(*p, "%*" USGND_INT_MAX_FSTR " ", fw, mi->size); @@ -894,7 +895,7 @@ write_mem_info(em_state *state, usgnd_int_8 **p, em_mem_info *mi) } static INLINE void -write_max_ever_mem_info(em_state *state, usgnd_int_8 **p, em_mem_info *mi) +write_max_ever_mem_info(em_state *state, char **p, em_mem_info *mi) { int fw = state->output.field_width - 1; *p += sprintf(*p, "%*" USGND_INT_MAX_FSTR " ", fw, mi->max_ever_size); @@ -913,13 +914,13 @@ static void print_string(em_state *state, char *str) { em_area area = {NULL, 0}; - usgnd_int_8 *p; + char *p; /* Get area */ get_next_write_area(&area,state,&state->output.queue,write_str(NULL,str)); - p = (usgnd_int_8 *) area.ptr; + p = area.ptr; area.size = write_str(&p, str); /* Leave area */ @@ -938,7 +939,7 @@ print_emu_arg(em_state *state) struct hostent *hp; struct in_addr iaddr; usgnd_int_16 port; - int saddr_size = sizeof(saddr); + socklen_t saddr_size = sizeof(saddr); size_t size; char *format = "> Emulator command line argument: +Mit %s\n"; @@ -996,7 +997,7 @@ print_emu_arg(em_state *state) } static size_t -write_allocator_info(em_state *state, usgnd_int_8 *ptr) +write_allocator_info(em_state *state, char *ptr) { usgnd_int_32 aix, i, j; char *header = "> Allocator information:\n"; @@ -1008,8 +1009,8 @@ write_allocator_info(em_state *state, usgnd_int_8 *ptr) char **strings; size_t strings_size; size_t max_line_size = 80; - usgnd_int_8 *p = ptr; - usgnd_int_8 **pp = ptr ? &p : NULL; + char *p = ptr; + char **pp = ptr ? &p : NULL; strings_size = state->trace_info.max_block_type_ix + 1; if (strings_size < state->trace_info.max_allocator_ix + 1) @@ -1140,7 +1141,7 @@ static void print_main_footer(em_state *state) { em_area area = {NULL, 0}; - usgnd_int_8 *p; + char *p; int i; char *stop_str = "> Trace stopped\n"; @@ -1248,7 +1249,7 @@ print_main_footer(em_state *state) static void print_info(em_state *state, usgnd_int_32 secs, char *extra) { - usgnd_int_8 *p; + char *p; int i; size_t size; em_area area = {NULL, 0}; @@ -1913,7 +1914,7 @@ error_msg(int res, char *msg) #if EMEM_d_SWITCH static size_t -write_output_filename(usgnd_int_8 *ptr, +write_output_filename(char *ptr, char *dirname, char *nodename, char *hostname, @@ -1921,8 +1922,8 @@ write_output_filename(usgnd_int_8 *ptr, char *pid) { size_t sz = 0; - usgnd_int_8 *p = ptr; - usgnd_int_8 **pp = ptr ? &p : NULL; + char *p = ptr; + char **pp = ptr ? &p : NULL; sz += write_str(pp, dirname); if (pp) *((*pp)++) = DIR_SEP_CHAR; sz++; @@ -2246,7 +2247,7 @@ process_trace(em_state *state) if (!area.size) return EM_TRUNCATED_TRACE_ERROR; res = emtp_parse(state->trace_state, - &area.ptr, &area.size, + (usgnd_int_8 **)&area.ptr, &area.size, NULL, 0, NULL); if (res == EMTP_HEADER_PARSED) break; @@ -2277,7 +2278,7 @@ process_trace(em_state *state) while (area.size) { ops_len = EM_NO_OF_OPS; res = emtp_parse(state->trace_state, - &area.ptr, &area.size, + (usgnd_int_8 **)&area.ptr, &area.size, ops, sizeof(emtp_operation), &ops_len); if (res < 0) return res; @@ -2555,7 +2556,7 @@ init_connection(em_state *state) SOCKET lsock; SOCKET sock = INVALID_SOCKET; struct sockaddr_in my_addr; - int oth_addr_len; + socklen_t oth_addr_len; struct sockaddr_in oth_addr; #ifdef __WIN32__ WORD wVersionRequested = MAKEWORD(2,0); @@ -2738,7 +2739,7 @@ output_thread_func(void *arg) error_msg(EIO, "Output queue"); } if (fwrite((void *) area.ptr, - sizeof(usgnd_int_8), + sizeof(char), area.size, state->output.stream) != area.size) { disconnect_queue_reader(&state->output.queue); |