From 41c8c9a5da5cc3a2474b9e4a06736e533e6eb00e Mon Sep 17 00:00:00 2001 From: Florian Kriener Date: Fri, 18 Mar 2016 11:39:46 +0100 Subject: Fix type issues with int32 and timespec * Change in to int32 for consitency * Use the standard "timespec" struct for VS2015 and above --- source/dng_image.cpp | 24 ++++++++++++------------ source/dng_pthread.h | 11 ++++++++--- 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 . Define +// "dng_timespec" as "timespec" otherwise. +#if _MSC_VER >= 1900 +#include +#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 -- cgit v1.2.3