diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-10-16 22:53:56 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-10-16 22:53:56 (GMT) |
commit | 84bf19bec42e2c53114727df2e239aa3fecb1071 (patch) | |
tree | a16377205eda598abfc6d37b2a68113dd8060816 /src | |
parent | 775bd09974b4681672bce3c1a10948bad5d482da (diff) | |
download | hdf5-84bf19bec42e2c53114727df2e239aa3fecb1071.zip hdf5-84bf19bec42e2c53114727df2e239aa3fecb1071.tar.gz hdf5-84bf19bec42e2c53114727df2e239aa3fecb1071.tar.bz2 |
[svn-r12767] Description:
Code cleanup to improve formatting & reduce compiler warnings.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDstream.c | 10 | ||||
-rw-r--r-- | src/H5Ocont.c | 14 | ||||
-rw-r--r-- | src/H5S.c | 2 | ||||
-rw-r--r-- | src/H5T.c | 4 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/H5FDstream.c b/src/H5FDstream.c index 7c53b0a..70ce836 100644 --- a/src/H5FDstream.c +++ b/src/H5FDstream.c @@ -486,18 +486,18 @@ H5FD_stream_open_socket (const char *filename, int o_flags, fprintf (stderr, "Stream VFD: connecting to host '%s' port %d\n", hostname, fapl->port); #endif - if (connect (sock, (struct sockaddr *) &server, sizeof (server)) < 0) + if (connect (sock, (struct sockaddr *) &server, (socklen_t)sizeof (server)) < 0) HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to connect") } else { server.sin_addr.s_addr = INADDR_ANY; - if (H5FD_STREAM_IOCTL_SOCKET (sock, FIONBIO, &on) < 0) { + if (H5FD_STREAM_IOCTL_SOCKET (sock, (int)FIONBIO, &on) < 0) { HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set non-blocking mode for socket") } else if (setsockopt (sock, IPPROTO_TCP, TCP_NODELAY, (const char *) &on, - sizeof(on)) < 0) { + (socklen_t)sizeof(on)) < 0) { HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set socket option TCP_NODELAY") } else if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, - sizeof(on)) < 0) { + (socklen_t)sizeof(on)) < 0) { HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,H5FD_STREAM_INVALID_SOCKET,"unable to set socket option SO_REUSEADDR") } else { /* Try to bind the socket to the given port. @@ -775,7 +775,7 @@ H5FD_stream_flush (H5FD_t *_stream, hid_t UNUSED dxpl_id, unsigned UNUSED closin fromlen = sizeof (from); while (! H5FD_STREAM_ERROR_CHECK (sock = accept (stream->socket, &from, &fromlen))) { - if (H5FD_STREAM_IOCTL_SOCKET (sock, FIONBIO, &on) < 0) { + if (H5FD_STREAM_IOCTL_SOCKET (sock, (int)FIONBIO, &on) < 0) { H5FD_STREAM_CLOSE_SOCKET (sock); continue; /* continue the loop for other clients to connect */ } diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 13a9d47..4d84b1c 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -135,19 +135,21 @@ H5O_cont_encode(H5F_t *f, uint8_t *p, const void *_mesg) { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_encode); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_encode) /* check args */ - assert(f); - assert(p); - assert(cont); + HDassert(f); + HDassert(p); + HDassert(cont); + HDassert(H5F_addr_defined(cont->addr)); + HDassert(cont->size > 0); /* encode */ H5F_addr_encode(f, &p, cont->addr); H5F_ENCODE_LENGTH(f, p, cont->size); - FUNC_LEAVE_NOAPI(SUCCEED); -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_cont_encode() */ /*------------------------------------------------------------------------- @@ -1720,7 +1720,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) FUNC_ENTER_NOAPI(H5S_encode, FAIL) /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc(0))) + if(NULL == (f = H5F_fake_alloc((size_t)0))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") /* Find out the size of buffer needed for extent */ @@ -2854,7 +2854,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) FUNC_ENTER_NOAPI(H5T_encode, FAIL) /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc(0))) + if(NULL == (f = H5F_fake_alloc((size_t)0))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") /* Find out the size of buffer needed */ @@ -2910,7 +2910,7 @@ H5T_decode(const unsigned char *buf) FUNC_ENTER_NOAPI(H5T_decode, NULL) /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc(0))) + if(NULL == (f = H5F_fake_alloc((size_t)0))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") /* Decode the type of the information */ |