From 4d69b6f525a4f02a24141e61f16e90455f3f0a30 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 Sep 2022 16:29:06 +1000 Subject: Cleanup: use u-prefixed integer types (for brevity) --- source/blender/imbuf/intern/cineon/cineon_dpx.c | 25 ++--- source/blender/imbuf/intern/cineon/cineonlib.c | 14 +-- source/blender/imbuf/intern/cineon/cineonlib.h | 30 +++--- source/blender/imbuf/intern/cineon/dpxlib.c | 10 +- source/blender/imbuf/intern/cineon/logImageCore.c | 119 +++++++++++----------- source/blender/imbuf/intern/cineon/logmemfile.c | 30 +++--- 6 files changed, 108 insertions(+), 120 deletions(-) (limited to 'source/blender/imbuf/intern/cineon') diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c index 1a99d2a34d9..3bff8184b19 100644 --- a/source/blender/imbuf/intern/cineon/cineon_dpx.c +++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c @@ -21,11 +21,8 @@ #include "MEM_guardedalloc.h" -static struct ImBuf *imb_load_dpx_cineon(const unsigned char *mem, - size_t size, - int use_cineon, - int flags, - char colorspace[IM_MAX_SPACE]) +static struct ImBuf *imb_load_dpx_cineon( + const uchar *mem, size_t size, int use_cineon, int flags, char colorspace[IM_MAX_SPACE]) { ImBuf *ibuf; LogImageFile *image; @@ -74,7 +71,7 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filepath, int use_cineon LogImageFile *logImage; float *fbuf; float *fbuf_ptr; - unsigned char *rect_ptr; + uchar *rect_ptr; int x, y, depth, bitspersample, rvalue; if (flags & IB_mem) { @@ -153,7 +150,7 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filepath, int use_cineon for (y = 0; y < ibuf->y; y++) { for (x = 0; x < ibuf->x; x++) { fbuf_ptr = fbuf + 4 * ((ibuf->y - y - 1) * ibuf->x + x); - rect_ptr = (unsigned char *)ibuf->rect + 4 * (y * ibuf->x + x); + rect_ptr = (uchar *)ibuf->rect + 4 * (y * ibuf->x + x); fbuf_ptr[0] = (float)rect_ptr[0] / 255.0f; fbuf_ptr[1] = (float)rect_ptr[1] / 255.0f; fbuf_ptr[2] = (float)rect_ptr[2] / 255.0f; @@ -173,15 +170,12 @@ bool imb_save_cineon(struct ImBuf *buf, const char *filepath, int flags) return imb_save_dpx_cineon(buf, filepath, 1, flags); } -bool imb_is_a_cineon(const unsigned char *buf, size_t size) +bool imb_is_a_cineon(const uchar *buf, size_t size) { return logImageIsCineon(buf, size); } -ImBuf *imb_load_cineon(const unsigned char *mem, - size_t size, - int flags, - char colorspace[IM_MAX_SPACE]) +ImBuf *imb_load_cineon(const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) { if (!imb_is_a_cineon(mem, size)) { return NULL; @@ -194,15 +188,12 @@ bool imb_save_dpx(struct ImBuf *buf, const char *filepath, int flags) return imb_save_dpx_cineon(buf, filepath, 0, flags); } -bool imb_is_a_dpx(const unsigned char *buf, size_t size) +bool imb_is_a_dpx(const uchar *buf, size_t size) { return logImageIsDpx(buf, size); } -ImBuf *imb_load_dpx(const unsigned char *mem, - size_t size, - int flags, - char colorspace[IM_MAX_SPACE]) +ImBuf *imb_load_dpx(const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) { if (!imb_is_a_dpx(mem, size)) { return NULL; diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index fa05f155b30..6417d92644f 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -121,13 +121,13 @@ static void fillCineonMainHeader(LogImageFile *cineon, /* we leave it blank */ } -LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize) +LogImageFile *cineonOpen(const uchar *byteStuff, int fromMemory, size_t bufferSize) { CineonMainHeader header; LogImageFile *cineon = (LogImageFile *)MEM_mallocN(sizeof(LogImageFile), __func__); const char *filepath = (const char *)byteStuff; int i; - unsigned int dataOffset; + uint dataOffset; if (cineon == NULL) { if (verbose) { @@ -158,8 +158,8 @@ LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t cineon->memBufferSize = 0; } else { - cineon->memBuffer = (unsigned char *)byteStuff; - cineon->memCursor = (unsigned char *)byteStuff; + cineon->memBuffer = (uchar *)byteStuff; + cineon->memCursor = (uchar *)byteStuff; cineon->memBufferSize = bufferSize; } @@ -187,7 +187,7 @@ LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t else { if (verbose) { printf("Cineon: Bad magic number %lu in \"%s\".\n", - (unsigned long)header.fileHeader.magic_num, + (ulong)header.fileHeader.magic_num, byteStuff); } logImageClose(cineon); @@ -296,7 +296,7 @@ LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t } if (cineon->element[i].refHighData == CINEON_UNDEFINED_U32) { - cineon->element[i].refHighData = (unsigned int)cineon->element[i].maxValue; + cineon->element[i].refHighData = (uint)cineon->element[i].maxValue; } if (cineon->element[i].refLowQuantity == CINEON_UNDEFINED_R32 || @@ -353,7 +353,7 @@ LogImageFile *cineonCreate( { CineonMainHeader header; const char *shortFilename = NULL; - /* unsigned char pad[6044]; */ + /* uchar pad[6044]; */ LogImageFile *cineon = (LogImageFile *)MEM_mallocN(sizeof(LogImageFile), __func__); if (cineon == NULL) { diff --git a/source/blender/imbuf/intern/cineon/cineonlib.h b/source/blender/imbuf/intern/cineon/cineonlib.h index 13d40461728..ac0cc15590d 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.h +++ b/source/blender/imbuf/intern/cineon/cineonlib.h @@ -38,10 +38,10 @@ typedef struct { } CineonFileHeader; typedef struct { - unsigned char descriptor1; - unsigned char descriptor2; - unsigned char bits_per_sample; - unsigned char filler; + uchar descriptor1; + uchar descriptor2; + uchar bits_per_sample; + uchar filler; unsigned int pixels_per_line; unsigned int lines_per_image; unsigned int ref_low_data; @@ -51,8 +51,8 @@ typedef struct { } CineonElementHeader; typedef struct { - unsigned char orientation; - unsigned char elements_per_image; + uchar orientation; + uchar elements_per_image; unsigned short filler; CineonElementHeader element[8]; float white_point_x; @@ -65,10 +65,10 @@ typedef struct { float blue_primary_y; char label[200]; char reserved[28]; - unsigned char interleave; - unsigned char packing; - unsigned char data_sign; - unsigned char sense; + uchar interleave; + uchar packing; + uchar data_sign; + uchar sense; unsigned int line_padding; unsigned int element_padding; char reserved2[20]; @@ -90,10 +90,10 @@ typedef struct { } CineonOriginationHeader; typedef struct { - unsigned char film_code; - unsigned char film_type; - unsigned char edge_code_perforation_offset; - unsigned char filler; + uchar film_code; + uchar film_type; + uchar edge_code_perforation_offset; + uchar filler; unsigned int prefix; unsigned int count; char format[32]; @@ -112,7 +112,7 @@ typedef struct { } CineonMainHeader; void cineonSetVerbose(int); -LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize); +LogImageFile *cineonOpen(const uchar *byteStuff, int fromMemory, size_t bufferSize); LogImageFile *cineonCreate( const char *filepath, int width, int height, int bitsPerSample, const char *creator); diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index 4c780032f0b..494bf37cfe7 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -119,7 +119,7 @@ static void fillDpxMainHeader(LogImageFile *dpx, header->televisionHeader.integration_times = swap_float(DPX_UNDEFINED_R32, dpx->isMSB); } -LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t bufferSize) +LogImageFile *dpxOpen(const uchar *byteStuff, int fromMemory, size_t bufferSize) { DpxMainHeader header; LogImageFile *dpx = (LogImageFile *)MEM_mallocN(sizeof(LogImageFile), __func__); @@ -155,8 +155,8 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf dpx->memBufferSize = 0; } else { - dpx->memBuffer = (unsigned char *)byteStuff; - dpx->memCursor = (unsigned char *)byteStuff; + dpx->memBuffer = (uchar *)byteStuff; + dpx->memCursor = (uchar *)byteStuff; dpx->memBufferSize = bufferSize; } @@ -320,7 +320,7 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf } if (dpx->element[i].refHighData == DPX_UNDEFINED_U32) { - dpx->element[i].refHighData = (unsigned int)dpx->element[i].maxValue; + dpx->element[i].refHighData = (uint)dpx->element[i].maxValue; } if (IS_DPX_UNDEFINED_R32(dpx->element[i].refLowQuantity)) { @@ -418,7 +418,7 @@ LogImageFile *dpxCreate(const char *filepath, { DpxMainHeader header; const char *shortFilename = NULL; - unsigned char pad[6044]; + uchar pad[6044]; LogImageFile *dpx = (LogImageFile *)MEM_mallocN(sizeof(LogImageFile), __func__); if (dpx == NULL) { diff --git a/source/blender/imbuf/intern/cineon/logImageCore.c b/source/blender/imbuf/intern/cineon/logImageCore.c index e693aa6f891..69ec3c4bee8 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.c +++ b/source/blender/imbuf/intern/cineon/logImageCore.c @@ -81,29 +81,29 @@ void logImageSetVerbose(int verbosity) * IO stuff */ -int logImageIsDpx(const void *buffer, const unsigned int size) +int logImageIsDpx(const void *buffer, const uint size) { - unsigned int magicNum; + uint magicNum; if (size < sizeof(magicNum)) { return 0; } - magicNum = *(unsigned int *)buffer; + magicNum = *(uint *)buffer; return (magicNum == DPX_FILE_MAGIC || magicNum == swap_uint(DPX_FILE_MAGIC, 1)); } -int logImageIsCineon(const void *buffer, const unsigned int size) +int logImageIsCineon(const void *buffer, const uint size) { - unsigned int magicNum; + uint magicNum; if (size < sizeof(magicNum)) { return 0; } - magicNum = *(unsigned int *)buffer; + magicNum = *(uint *)buffer; return (magicNum == CINEON_FILE_MAGIC || magicNum == swap_uint(CINEON_FILE_MAGIC, 1)); } LogImageFile *logImageOpenFromFile(const char *filepath, int cineon) { - unsigned int magicNum; + uint magicNum; FILE *f = BLI_fopen(filepath, "rb"); (void)cineon; @@ -120,16 +120,16 @@ LogImageFile *logImageOpenFromFile(const char *filepath, int cineon) fclose(f); if (logImageIsDpx(&magicNum, sizeof(magicNum))) { - return dpxOpen((const unsigned char *)filepath, 0, 0); + return dpxOpen((const uchar *)filepath, 0, 0); } if (logImageIsCineon(&magicNum, sizeof(magicNum))) { - return cineonOpen((const unsigned char *)filepath, 0, 0); + return cineonOpen((const uchar *)filepath, 0, 0); } return NULL; } -LogImageFile *logImageOpenFromMemory(const unsigned char *buffer, unsigned int size) +LogImageFile *logImageOpenFromMemory(const uchar *buffer, uint size) { if (logImageIsDpx(buffer, size)) { return dpxOpen(buffer, 1, size); @@ -276,9 +276,9 @@ int logImageSetDataRGBA(LogImageFile *logImage, float *data, int dataIsLinearRGB static int logImageSetData8(LogImageFile *logImage, LogImageElement logElement, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned char *row; + uchar *row; - row = (unsigned char *)MEM_mallocN(rowLength, __func__); + row = (uchar *)MEM_mallocN(rowLength, __func__); if (row == NULL) { if (verbose) { printf("DPX/Cineon: Cannot allocate row.\n"); @@ -289,7 +289,7 @@ static int logImageSetData8(LogImageFile *logImage, LogImageElement logElement, for (size_t y = 0; y < logImage->height; y++) { for (size_t x = 0; x < logImage->width * logImage->depth; x++) { - row[x] = (unsigned char)float_uint(data[y * logImage->width * logImage->depth + x], 255); + row[x] = (uchar)float_uint(data[y * logImage->width * logImage->depth + x], 255); } if (logimage_fwrite(row, rowLength, 1, logImage) == 0) { @@ -307,10 +307,10 @@ static int logImageSetData8(LogImageFile *logImage, LogImageElement logElement, static int logImageSetData10(LogImageFile *logImage, LogImageElement logElement, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned int pixel, index; - unsigned int *row; + uint pixel, index; + uint *row; - row = (unsigned int *)MEM_mallocN(rowLength, __func__); + row = (uint *)MEM_mallocN(rowLength, __func__); if (row == NULL) { if (verbose) { printf("DPX/Cineon: Cannot allocate row.\n"); @@ -324,8 +324,7 @@ static int logImageSetData10(LogImageFile *logImage, LogImageElement logElement, pixel = 0; for (size_t x = 0; x < logImage->width * logImage->depth; x++) { - pixel |= (unsigned int)float_uint(data[y * logImage->width * logImage->depth + x], 1023) - << offset; + pixel |= (uint)float_uint(data[y * logImage->width * logImage->depth + x], 1023) << offset; offset -= 10; if (offset < 0) { row[index] = swap_uint(pixel, logImage->isMSB); @@ -353,9 +352,9 @@ static int logImageSetData10(LogImageFile *logImage, LogImageElement logElement, static int logImageSetData12(LogImageFile *logImage, LogImageElement logElement, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned short *row; + ushort *row; - row = (unsigned short *)MEM_mallocN(rowLength, __func__); + row = (ushort *)MEM_mallocN(rowLength, __func__); if (row == NULL) { if (verbose) { printf("DPX/Cineon: Cannot allocate row.\n"); @@ -366,7 +365,7 @@ static int logImageSetData12(LogImageFile *logImage, LogImageElement logElement, for (size_t y = 0; y < logImage->height; y++) { for (size_t x = 0; x < logImage->width * logImage->depth; x++) { row[x] = swap_ushort( - ((unsigned short)float_uint(data[y * logImage->width * logImage->depth + x], 4095)) << 4, + ((ushort)float_uint(data[y * logImage->width * logImage->depth + x], 4095)) << 4, logImage->isMSB); } @@ -385,9 +384,9 @@ static int logImageSetData12(LogImageFile *logImage, LogImageElement logElement, static int logImageSetData16(LogImageFile *logImage, LogImageElement logElement, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned short *row; + ushort *row; - row = (unsigned short *)MEM_mallocN(rowLength, __func__); + row = (ushort *)MEM_mallocN(rowLength, __func__); if (row == NULL) { if (verbose) { printf("DPX/Cineon: Cannot allocate row.\n"); @@ -398,7 +397,7 @@ static int logImageSetData16(LogImageFile *logImage, LogImageElement logElement, for (size_t y = 0; y < logImage->height; y++) { for (size_t x = 0; x < logImage->width * logImage->depth; x++) { row[x] = swap_ushort( - (unsigned short)float_uint(data[y * logImage->width * logImage->depth + x], 65535), + (ushort)float_uint(data[y * logImage->width * logImage->depth + x], 65535), logImage->isMSB); } @@ -425,11 +424,11 @@ int logImageGetDataRGBA(LogImageFile *logImage, float *data, int dataIsLinearRGB float *elementData[8]; float *elementData_ptr[8]; float *mergedData; - unsigned int sampleIndex; + uint sampleIndex; LogImageElement mergedElement; /* Determine the depth of the picture and if there's a separate alpha element. - * If the element is supported, load it into an unsigned ints array. */ + * If the element is supported, load it into an uints array. */ memset(&elementData, 0, 8 * sizeof(float *)); hasAlpha = 0; @@ -695,7 +694,7 @@ static int logImageElementGetData(LogImageFile *logImage, LogImageElement logEle static int logImageElementGetData1(LogImageFile *logImage, LogImageElement logElement, float *data) { - unsigned int pixel; + uint pixel; /* seek at the right place */ if (logimage_fseek(logImage, logElement.dataOffset, SEEK_SET) != 0) { @@ -727,7 +726,7 @@ static int logImageElementGetData1(LogImageFile *logImage, LogImageElement logEl static int logImageElementGetData8(LogImageFile *logImage, LogImageElement logElement, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned char pixel; + uchar pixel; /* extract required pixels */ for (size_t y = 0; y < logImage->height; y++) { @@ -756,7 +755,7 @@ static int logImageElementGetData10(LogImageFile *logImage, LogImageElement logElement, float *data) { - unsigned int pixel; + uint pixel; /* seek to data */ if (logimage_fseek(logImage, logElement.dataOffset, SEEK_SET) != 0) { @@ -829,15 +828,14 @@ static int logImageElementGetData10Packed(LogImageFile *logImage, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned int pixel, oldPixel; + uint pixel, oldPixel; /* converting bytes to pixels */ for (size_t y = 0; y < logImage->height; y++) { /* seek to data */ if (logimage_fseek(logImage, y * rowLength + logElement.dataOffset, SEEK_SET) != 0) { if (verbose) { - printf("DPX/Cineon: Couldn't seek at %u\n", - (unsigned int)(y * rowLength + logElement.dataOffset)); + printf("DPX/Cineon: Couldn't seek at %u\n", (uint)(y * rowLength + logElement.dataOffset)); } return 1; } @@ -884,9 +882,9 @@ static int logImageElementGetData12(LogImageFile *logImage, LogImageElement logElement, float *data) { - unsigned int sampleIndex; - unsigned int numSamples = logImage->width * logImage->height * logElement.depth; - unsigned short pixel; + uint sampleIndex; + uint numSamples = logImage->width * logImage->height * logElement.depth; + ushort pixel; /* seek to data */ if (logimage_fseek(logImage, logElement.dataOffset, SEEK_SET) != 0) { @@ -923,15 +921,14 @@ static int logImageElementGetData12Packed(LogImageFile *logImage, float *data) { size_t rowLength = getRowLength(logImage->width, logElement); - unsigned int pixel, oldPixel; + uint pixel, oldPixel; /* converting bytes to pixels */ for (size_t y = 0; y < logImage->height; y++) { /* seek to data */ if (logimage_fseek(logImage, y * rowLength + logElement.dataOffset, SEEK_SET) != 0) { if (verbose) { - printf("DPX/Cineon: Couldn't seek at %u\n", - (unsigned int)(y * rowLength + logElement.dataOffset)); + printf("DPX/Cineon: Couldn't seek at %u\n", (uint)(y * rowLength + logElement.dataOffset)); } return 1; } @@ -978,9 +975,9 @@ static int logImageElementGetData16(LogImageFile *logImage, LogImageElement logElement, float *data) { - unsigned int numSamples = logImage->width * logImage->height * logElement.depth; - unsigned int sampleIndex; - unsigned short pixel; + uint numSamples = logImage->width * logImage->height * logElement.depth; + uint sampleIndex; + ushort pixel; /* seek to data */ if (logimage_fseek(logImage, logElement.dataOffset, SEEK_SET) != 0) { @@ -1076,8 +1073,8 @@ static float *getLinToLogLut(LogImageFile *logImage, LogImageElement logElement) { float *lut; float gain, negativeFilmGamma, offset, step; - unsigned int lutsize = (unsigned int)(logElement.maxValue + 1); - unsigned int i; + uint lutsize = (uint)(logElement.maxValue + 1); + uint i; lut = MEM_mallocN(sizeof(float) * lutsize, "getLinToLogLut"); @@ -1104,8 +1101,8 @@ static float *getLogToLinLut(LogImageFile *logImage, LogImageElement logElement) float *lut; float breakPoint, gain, kneeGain, kneeOffset, negativeFilmGamma, offset, step, softClip; /* float filmGamma; unused */ - unsigned int lutsize = (unsigned int)(logElement.maxValue + 1); - unsigned int i; + uint lutsize = (uint)(logElement.maxValue + 1); + uint i; lut = MEM_mallocN(sizeof(float) * lutsize, "getLogToLinLut"); @@ -1154,8 +1151,8 @@ static float *getLogToLinLut(LogImageFile *logImage, LogImageElement logElement) static float *getLinToSrgbLut(LogImageElement logElement) { float col, *lut; - unsigned int lutsize = (unsigned int)(logElement.maxValue + 1); - unsigned int i; + uint lutsize = (uint)(logElement.maxValue + 1); + uint i; lut = MEM_mallocN(sizeof(float) * lutsize, "getLogToLinLut"); @@ -1175,8 +1172,8 @@ static float *getLinToSrgbLut(LogImageElement logElement) static float *getSrgbToLinLut(LogImageElement logElement) { float col, *lut; - unsigned int lutsize = (unsigned int)(logElement.maxValue + 1); - unsigned int i; + uint lutsize = (uint)(logElement.maxValue + 1); + uint i; lut = MEM_mallocN(sizeof(float) * lutsize, "getLogToLinLut"); @@ -1199,7 +1196,7 @@ static int convertRGBA_RGB(float *src, LogImageElement logElement, int elementIsSource) { - unsigned int i; + uint i; float *src_ptr = src; float *dst_ptr = dst; @@ -1254,7 +1251,7 @@ static int convertRGB_RGBA(float *src, LogImageElement logElement, int elementIsSource) { - unsigned int i; + uint i; float *src_ptr = src; float *dst_ptr = dst; @@ -1309,7 +1306,7 @@ static int convertRGBA_RGBA(float *src, LogImageElement logElement, int elementIsSource) { - unsigned int i; + uint i; float *src_ptr = src; float *dst_ptr = dst; @@ -1354,7 +1351,7 @@ static int convertABGR_RGBA(float *src, LogImageElement logElement, int elementIsSource) { - unsigned int i; + uint i; float *src_ptr = src; float *dst_ptr = dst; @@ -1407,7 +1404,7 @@ static int convertCbYCr_RGBA(float *src, LogImageFile *logImage, LogImageElement logElement) { - unsigned int i; + uint i; float conversionMatrix[9], refLowData, y, cb, cr; float *src_ptr = src; float *dst_ptr = dst; @@ -1439,7 +1436,7 @@ static int convertCbYCrA_RGBA(float *src, LogImageFile *logImage, LogImageElement logElement) { - unsigned int i; + uint i; float conversionMatrix[9], refLowData, y, cb, cr, a; float *src_ptr = src; float *dst_ptr = dst; @@ -1472,7 +1469,7 @@ static int convertCbYCrY_RGBA(float *src, LogImageFile *logImage, LogImageElement logElement) { - unsigned int i; + uint i; float conversionMatrix[9], refLowData, y1, y2, cb, cr; float *src_ptr = src; float *dst_ptr = dst; @@ -1524,7 +1521,7 @@ static int convertCbYACrYA_RGBA(float *src, LogImageFile *logImage, LogImageElement logElement) { - unsigned int i; + uint i; float conversionMatrix[9], refLowData, y1, y2, cb, cr, a1, a2; float *src_ptr = src; float *dst_ptr = dst; @@ -1578,7 +1575,7 @@ static int convertLuminance_RGBA(float *src, LogImageFile *logImage, LogImageElement logElement) { - unsigned int i; + uint i; float conversionMatrix[9], value, refLowData; float *src_ptr = src; float *dst_ptr = dst; @@ -1604,7 +1601,7 @@ static int convertYA_RGBA(float *src, LogImageFile *logImage, LogImageElement logElement) { - unsigned int i; + uint i; float conversionMatrix[9], value, refLowData; float *src_ptr = src; float *dst_ptr = dst; @@ -1629,7 +1626,7 @@ static int convertLogElementToRGBA( float *src, float *dst, LogImageFile *logImage, LogImageElement logElement, int dstIsLinearRGB) { int rvalue; - unsigned int i; + uint i; float *src_ptr; float *dst_ptr; @@ -1698,7 +1695,7 @@ static int convertLogElementToRGBA( static int convertRGBAToLogElement( float *src, float *dst, LogImageFile *logImage, LogImageElement logElement, int srcIsLinearRGB) { - unsigned int i; + uint i; int rvalue; float *srgbSrc; float *srgbSrc_ptr; diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c index f5bd87f96d1..6c24d67b33f 100644 --- a/source/blender/imbuf/intern/cineon/logmemfile.c +++ b/source/blender/imbuf/intern/cineon/logmemfile.c @@ -44,7 +44,7 @@ int logimage_fseek(LogImageFile *logFile, intptr_t offset, int origin) return 0; } -int logimage_fwrite(void *buffer, size_t size, unsigned int count, LogImageFile *logFile) +int logimage_fwrite(void *buffer, size_t size, uint count, LogImageFile *logFile) { if (logFile->file) { return fwrite(buffer, size, count, logFile->file); @@ -54,13 +54,13 @@ int logimage_fwrite(void *buffer, size_t size, unsigned int count, LogImageFile return count; } -int logimage_fread(void *buffer, size_t size, unsigned int count, LogImageFile *logFile) +int logimage_fread(void *buffer, size_t size, uint count, LogImageFile *logFile) { if (logFile->file) { return fread(buffer, size, count, logFile->file); } /* we're reading from memory */ - unsigned char *buf = (unsigned char *)buffer; + uchar *buf = (uchar *)buffer; uintptr_t pos = (uintptr_t)logFile->memCursor - (uintptr_t)logFile->memBuffer; size_t total_size = size * count; if (pos + total_size > logFile->memBufferSize) { @@ -77,38 +77,38 @@ int logimage_fread(void *buffer, size_t size, unsigned int count, LogImageFile * return count; } -int logimage_read_uchar(unsigned char *x, LogImageFile *logFile) +int logimage_read_uchar(uchar *x, LogImageFile *logFile) { uintptr_t pos = (uintptr_t)logFile->memCursor - (uintptr_t)logFile->memBuffer; - if (pos + sizeof(unsigned char) > logFile->memBufferSize) { + if (pos + sizeof(uchar) > logFile->memBufferSize) { return 1; } - *x = *(unsigned char *)logFile->memCursor; - logFile->memCursor += sizeof(unsigned char); + *x = *(uchar *)logFile->memCursor; + logFile->memCursor += sizeof(uchar); return 0; } -int logimage_read_ushort(unsigned short *x, LogImageFile *logFile) +int logimage_read_ushort(ushort *x, LogImageFile *logFile) { uintptr_t pos = (uintptr_t)logFile->memCursor - (uintptr_t)logFile->memBuffer; - if (pos + sizeof(unsigned short) > logFile->memBufferSize) { + if (pos + sizeof(ushort) > logFile->memBufferSize) { return 1; } - *x = *(unsigned short *)logFile->memCursor; - logFile->memCursor += sizeof(unsigned short); + *x = *(ushort *)logFile->memCursor; + logFile->memCursor += sizeof(ushort); return 0; } -int logimage_read_uint(unsigned int *x, LogImageFile *logFile) +int logimage_read_uint(uint *x, LogImageFile *logFile) { uintptr_t pos = (uintptr_t)logFile->memCursor - (uintptr_t)logFile->memBuffer; - if (pos + sizeof(unsigned int) > logFile->memBufferSize) { + if (pos + sizeof(uint) > logFile->memBufferSize) { return 1; } - *x = *(unsigned int *)logFile->memCursor; - logFile->memCursor += sizeof(unsigned int); + *x = *(uint *)logFile->memCursor; + logFile->memCursor += sizeof(uint); return 0; } -- cgit v1.2.3