summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kriener <floriank@google.com>2016-04-05 10:31:16 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-05 10:31:16 +0000
commit0b5085d950fa91d122b4e844b5da4e539732e621 (patch)
tree12cc68a2f5ddc84c3d87e2456cd3cba9df7bd98d
parent13a9d4bf04133f2384afb199dba8c7e5a7cb8013 (diff)
parent7ce5984e4865e3c5c8963d9c8b414a4e4b84f264 (diff)
downloaddng_sdk-0b5085d950fa91d122b4e844b5da4e539732e621.tar.gz
Fix type issues with int32 and timespec am: 41c8c9a
am: 7ce5984 * commit '7ce5984e4865e3c5c8963d9c8b414a4e4b84f264': Fix type issues with int32 and timespec Change-Id: I9e5d86915ab398eab8eb2fd8f9cc8a410d26510d
-rw-r--r--source/dng_image.cpp24
-rw-r--r--source/dng_pthread.h11
2 files changed, 20 insertions, 15 deletions
diff --git a/source/dng_image.cpp b/source/dng_image.cpp
index ae99b9e..2026b9a 100644
--- a/source/dng_image.cpp
+++ b/source/dng_image.cpp
@@ -553,8 +553,8 @@ void dng_image::Get (dng_pixel_buffer &buffer,
edgeOption,
dng_rect (fBounds.t,
fBounds.l,
- fBounds.t + (int)repeatV,
- fBounds.l + (int)repeatH),
+ fBounds.t + (int32)repeatV,
+ fBounds.l + (int32)repeatH),
areaTL);
}
@@ -570,7 +570,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
edgeOption,
dng_rect (fBounds.t,
areaTM.l,
- fBounds.t + (int)repeatV,
+ fBounds.t + (int32)repeatV,
areaTM.r),
areaTM);
@@ -586,8 +586,8 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
dng_rect (fBounds.t,
- fBounds.r - (int)repeatH,
- fBounds.t + (int)repeatV,
+ fBounds.r - (int32)repeatH,
+ fBounds.t + (int32)repeatV,
fBounds.r),
areaTR);
@@ -605,7 +605,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
dng_rect (areaLM.t,
fBounds.l,
areaLM.b,
- fBounds.l + (int)repeatH),
+ fBounds.l + (int32)repeatH),
areaLM);
}
@@ -620,7 +620,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
dng_rect (areaRM.t,
- fBounds.r - (int)repeatH,
+ fBounds.r - (int32)repeatH,
areaRM.b,
fBounds.r),
areaRM);
@@ -636,10 +636,10 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
- dng_rect (fBounds.b - (int)repeatV,
+ dng_rect (fBounds.b - (int32)repeatV,
fBounds.l,
fBounds.b,
- fBounds.l + (int)repeatH),
+ fBounds.l + (int32)repeatH),
areaBL);
}
@@ -653,7 +653,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
- dng_rect (fBounds.b - (int)repeatV,
+ dng_rect (fBounds.b - (int32)repeatV,
areaBM.l,
fBounds.b,
areaBM.r),
@@ -670,8 +670,8 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
- dng_rect (fBounds.b - (int)repeatV,
- fBounds.r - (int)repeatH,
+ dng_rect (fBounds.b - (int32)repeatV,
+ fBounds.r - (int32)repeatH,
fBounds.b,
fBounds.r),
areaBR);
diff --git a/source/dng_pthread.h b/source/dng_pthread.h
index 0a28a1b..2095321 100644
--- a/source/dng_pthread.h
+++ b/source/dng_pthread.h
@@ -53,6 +53,14 @@
#endif
+// Use the standard "timespec" struct for VS2015 and above from <time.h>. Define
+// "dng_timespec" as "timespec" otherwise.
+#if _MSC_VER >= 1900
+#include <time.h>
+#else
+#define timespec dng_timespec
+#endif
+
#ifdef __cplusplus
extern "C"
{
@@ -67,7 +75,6 @@ struct dng_timespec {
long tv_nsec;
};
-
typedef unsigned long dng_pthread_t;
typedef struct dng_pthread_mutex_impl *dng_pthread_mutex_t;
@@ -179,8 +186,6 @@ void dng_pthread_terminate();
#undef PTHREAD_ONCE_INIT
#define PTHREAD_ONCE_INIT DNG_PTHREAD_ONCE_INIT
-#define timespec dng_timespec
-
/* If it is defined on Windows, it probably has the wrong value... */
#if defined(WIN32) || !defined(ETIMEDOUT)
#undef ETIMEDOUT