Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd-common.h
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-03-04 21:03:06 +0100
committerArthur de Jong <arthur@arthurdejong.org>2007-03-04 21:03:06 +0100
commit48d51b66fac883fc8648fb6b9df487382b8addc2 (patch)
treee85684c4247e33f12417a95989210df016a35109 /nslcd-common.h
parent03fdef7f5c7667fd92232f6d055f98833bcfef19 (diff)
code improvements by making type casts explicit, flagging ignored return values, renames and flagging of parameters and some miscelanious improvements (thanks to gcc warnings, splint, rats and flawfinder)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@265 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd-common.h')
-rw-r--r--nslcd-common.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/nslcd-common.h b/nslcd-common.h
index 5d0f763..56a1093 100644
--- a/nslcd-common.h
+++ b/nslcd-common.h
@@ -65,7 +65,7 @@ static void debug_dump(const void *ptr,size_t size)
#define WRITE(fp,ptr,size) \
DEBUG_PRINT("WRITE : var="__STRING(ptr)" size=%d",(int)size); \
DEBUG_DUMP(ptr,size); \
- if (fwrite(ptr,size,1,fp)<1) \
+ if (fwrite(ptr,(size_t)size,(size_t)1,fp)<(size_t)1) \
{ \
DEBUG_PRINT("WRITE : var="__STRING(ptr)" error: %s",strerror(errno)); \
ERROR_OUT_WRITEERROR(fp); \
@@ -133,7 +133,7 @@ static void debug_dump(const void *ptr,size_t size)
*/
#define READ(fp,ptr,size) \
- if (fread(ptr,size,1,fp)<1) \
+ if (fread(ptr,(size_t)size,(size_t)1,fp)<(size_t)1) \
{ \
DEBUG_PRINT("READ : var="__STRING(ptr)" error: %s",strerror(errno)); \
ERROR_OUT_READERROR(fp); \
@@ -189,11 +189,11 @@ static void debug_dump(const void *ptr,size_t size)
/* align to the specified type width */ \
BUF_ALIGN(fp,type); \
/* check that we have enough room */ \
- BUF_CHECK(fp,(num)*sizeof(type)); \
+ BUF_CHECK(fp,(size_t)(num)*sizeof(type)); \
/* store the pointer */ \
(ptr)=(type *)BUF_CUR; \
/* reserve the space */ \
- BUF_SKIP((num)*sizeof(type));
+ BUF_SKIP((size_t)(num)*sizeof(type));
/* read string in the buffer (using buffer, buflen and bufptr)
and store the actual location of the string in field */