mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
WRaster: Avoid types deprecated with libtiff 4.3
This patch is fixing compiler warnings like: load_tiff.c:42:9: warning: 'uint16' is deprecated [-Wdeprecated-declarations] load_tiff.c:43:9: warning: 'uint32' is deprecated [-Wdeprecated-declarations] As starting from libtiff 4.3, released in April 2021, types were moved from uint16 to uint16_t and uint32 to uint32_t respectively. See https://libtiff.gitlab.io/libtiff/releases/v4.3.0.html
This commit is contained in:
committed by
Carlos R. Mafra
parent
d7d38aa443
commit
532acdc443
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <tiff.h>
|
||||
#include <tiffio.h>
|
||||
#include <tiffvers.h>
|
||||
|
||||
#include "wraster.h"
|
||||
#include "imgformat.h"
|
||||
@@ -38,14 +39,19 @@ RImage *RLoadTIFF(const char *file, int index)
|
||||
{
|
||||
RImage *image = NULL;
|
||||
TIFF *tif;
|
||||
int i;
|
||||
int i, ch;
|
||||
unsigned char *r, *g, *b, *a;
|
||||
uint16 alpha, amode;
|
||||
#if TIFFLIB_VERSION < 20210416
|
||||
uint16 alpha, amode, extrasamples;
|
||||
uint16 *sampleinfo;
|
||||
uint32 width, height;
|
||||
uint32 *data, *ptr;
|
||||
uint16 extrasamples;
|
||||
uint16 *sampleinfo;
|
||||
int ch;
|
||||
#else
|
||||
uint16_t alpha, amode, extrasamples;;
|
||||
uint16_t *sampleinfo;
|
||||
uint32_t width, height;
|
||||
uint32_t *data, *ptr;
|
||||
#endif
|
||||
|
||||
tif = TIFFOpen(file, "r");
|
||||
if (!tif)
|
||||
@@ -79,7 +85,11 @@ RImage *RLoadTIFF(const char *file, int index)
|
||||
}
|
||||
|
||||
/* read data */
|
||||
#if TIFFLIB_VERSION < 20210416
|
||||
ptr = data = (uint32 *) _TIFFmalloc(width * height * sizeof(uint32));
|
||||
#else
|
||||
ptr = data = (uint32_t *) _TIFFmalloc(width * height * sizeof(uint32_t));
|
||||
#endif
|
||||
|
||||
if (!data) {
|
||||
RErrorCode = RERR_NOMEMORY;
|
||||
|
||||
Reference in New Issue
Block a user