corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [09/10] incubator-corinthia git commit: DFUnzip: Fix warning about unsigned char * cast
Date Fri, 02 Jan 2015 13:50:18 GMT
DFUnzip: Fix warning about unsigned char * cast

The DFextZipReadCurrentFile function expected a char * parameter, but we
were passing in an unsigned char *, resulting in a compiler warning.

This commit changes DFextZipReadCurrentFile to instead take a void *
parameter, and similarly DFextZipWriteCurrentFile to take a const void *
parameter. This allows any pointer types to be used with the functions.


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/f27803f4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/f27803f4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/f27803f4

Branch: refs/heads/stable
Commit: f27803f4c0f0336c5f5df5fb7bd5d396bc74de65
Parents: 69a8028
Author: Peter Kelly <peter@uxproductivity.com>
Authored: Fri Jan 2 20:39:12 2015 +0700
Committer: Peter Kelly <peter@uxproductivity.com>
Committed: Fri Jan 2 20:39:12 2015 +0700

----------------------------------------------------------------------
 DocFormats/platform/headers/DFPlatform.h | 4 ++--
 DocFormats/platform/src/Wrapper.c        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f27803f4/DocFormats/platform/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/platform/headers/DFPlatform.h b/DocFormats/platform/headers/DFPlatform.h
index 1e83b2c..6f16983 100755
--- a/DocFormats/platform/headers/DFPlatform.h
+++ b/DocFormats/platform/headers/DFPlatform.h
@@ -49,6 +49,6 @@ int             DFextZipOpenNextFile(DFextZipHandleP zipHandle, char *entryName,
 int             DFextZipAppendNewFile(DFextZipHandleP zipHandle, const char *entryName);
 int             DFextZipCloseFile(DFextZipHandleP zipHandle);
 
-int DFextZipReadCurrentFile(DFextZipHandleP zipHandle, char *buf, const int maxLen);
-int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, char *buf, const int len);
+int DFextZipReadCurrentFile(DFextZipHandleP zipHandle, void *buf, const int maxLen);
+int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, const void *buf, const int len);
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f27803f4/DocFormats/platform/src/Wrapper.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/src/Wrapper.c b/DocFormats/platform/src/Wrapper.c
index 26dc413..14ed093 100644
--- a/DocFormats/platform/src/Wrapper.c
+++ b/DocFormats/platform/src/Wrapper.c
@@ -133,14 +133,14 @@ int DFextZipCloseFile(DFextZipHandleP zipHandle)
 
  
 
-int DFextZipReadCurrentFile(DFextZipHandleP zipHandle, char *buf, const int maxLen)
+int DFextZipReadCurrentFile(DFextZipHandleP zipHandle, void *buf, const int maxLen)
 {
     return unzReadCurrentFile(zipHandle->handle, buf, maxLen);
 }
 
 
 
-int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, char *buf, const int len)
+int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, const void *buf, const int len)
 {
     return (zipWriteInFileInZip(zipHandle->handle, buf, len) == ZIP_OK) ? 1 : -1;
 }


Mime
View raw message