From 48d51b66fac883fc8648fb6b9df487382b8addc2 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 4 Mar 2007 20:03:06 +0000 Subject: 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 --- nslcd-common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nslcd-common.h') 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 */ -- cgit v1.2.3