aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Presler <noahp@google.com>2015-08-12 11:59:07 -0700
committerNoah Presler <noahp@google.com>2015-08-12 11:59:07 -0700
commitf5c7cd2e2c1bb8102632cdbec636a409ea4a64b0 (patch)
tree6c5b0daf433afe18fbaa4f85ffcc3479c87a4f54
parent35d67d271b9a2f241fbaeb3dce9eed6bc71d7308 (diff)
downloadopencv3-f5c7cd2e2c1bb8102632cdbec636a409ea4a64b0.tar.gz
fixing pointer cast issue for more specific fix than -w
Change-Id: I9ebadb54eb3ea4e543544597335ecd579285ea06
-rw-r--r--3rdparty/libtiff/tif_unix.c14
-rw-r--r--Android.mk4
2 files changed, 9 insertions, 9 deletions
diff --git a/3rdparty/libtiff/tif_unix.c b/3rdparty/libtiff/tif_unix.c
index ebde1bc..6d32817 100644
--- a/3rdparty/libtiff/tif_unix.c
+++ b/3rdparty/libtiff/tif_unix.c
@@ -64,7 +64,7 @@ _tiffReadProc(thandle_t fd, void* buf, tmsize_t size)
errno=EINVAL;
return (tmsize_t) -1;
}
- return ((tmsize_t) read((int) fd, buf, size_io));
+ return ((tmsize_t) read((int)(intptr_t) fd, buf, size_io));
}
static tmsize_t
@@ -76,7 +76,7 @@ _tiffWriteProc(thandle_t fd, void* buf, tmsize_t size)
errno=EINVAL;
return (tmsize_t) -1;
}
- return ((tmsize_t) write((int) fd, buf, size_io));
+ return ((tmsize_t) write((int)(intptr_t) fd, buf, size_io));
}
static uint64
@@ -88,20 +88,20 @@ _tiffSeekProc(thandle_t fd, uint64 off, int whence)
errno=EINVAL;
return (uint64) -1; /* this is really gross */
}
- return((uint64)lseek((int)fd,off_io,whence));
+ return((uint64)lseek((int)(intptr_t)fd,off_io,whence));
}
static int
_tiffCloseProc(thandle_t fd)
{
- return(close((int)fd));
+ return(close((int)(intptr_t)fd));
}
static uint64
_tiffSizeProc(thandle_t fd)
{
struct stat sb;
- if (fstat((int)fd,&sb)<0)
+ if (fstat((int)(intptr_t)fd,&sb)<0)
return(0);
else
return((uint64)sb.st_size);
@@ -117,7 +117,7 @@ _tiffMapProc(thandle_t fd, void** pbase, toff_t* psize)
tmsize_t sizem = (tmsize_t)size64;
if ((uint64)sizem==size64) {
*pbase = (void*)
- mmap(0, (size_t)sizem, PROT_READ, MAP_SHARED, (int) fd, 0);
+ mmap(0, (size_t)sizem, PROT_READ, MAP_SHARED, (int)(intptr_t) fd, 0);
if (*pbase != (void*) -1) {
*psize = (tmsize_t)sizem;
return (1);
@@ -156,7 +156,7 @@ TIFFFdOpen(int fd, const char* name, const char* mode)
TIFF* tif;
tif = TIFFClientOpen(name, mode,
- (thandle_t) fd,
+ (thandle_t)(intptr_t) fd,
_tiffReadProc, _tiffWriteProc,
_tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
_tiffMapProc, _tiffUnmapProc);
diff --git a/Android.mk b/Android.mk
index 0e698db..d47596b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -314,7 +314,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_RTTI_FLAG := -frtti
-LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT -w
+LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT -Wno-implicit-function-declaration
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/3rdparty/libjasper \
@@ -441,7 +441,7 @@ LOCAL_RTTI_FLAG := -frtti
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lz
-LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -w
+LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -Wno-implicit-function-declaration
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/3rdparty/libtiff \