From 628cde0575a1e3819e73fa631d6532f9f5409e14 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Thu, 11 Mar 2021 17:18:31 -0500 Subject: fix stricter gcc warnings by changing the type for the loop variable to match the type of the loop limit Signed-off-by: Thomas E. Dickey --- src/file.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/file.c b/src/file.c index c1a5c6a..275ce9b 100644 --- a/src/file.c +++ b/src/file.c @@ -233,7 +233,7 @@ _XcursorReadFileHeader (XcursorFile *file) { XcursorFileHeader head, *fileHeader; XcursorUInt skip; - int n; + XcursorUInt n; if (!file) return NULL; @@ -286,7 +286,7 @@ _XcursorFileHeaderLength (XcursorFileHeader *fileHeader) static XcursorBool _XcursorWriteFileHeader (XcursorFile *file, XcursorFileHeader *fileHeader) { - int toc; + XcursorUInt toc; if (!file || !fileHeader) return XcursorFalse; @@ -375,7 +375,7 @@ _XcursorFindBestSize (XcursorFileHeader *fileHeader, XcursorDim size, int *nsizesp) { - int n; + XcursorUInt n; int nsizes = 0; XcursorDim bestSize = 0; XcursorDim thisSize; @@ -405,7 +405,7 @@ _XcursorFindImageToc (XcursorFileHeader *fileHeader, XcursorDim size, int count) { - int toc; + XcursorUInt toc; XcursorDim thisSize; if (!fileHeader) @@ -424,7 +424,7 @@ _XcursorFindImageToc (XcursorFileHeader *fileHeader, } if (toc == fileHeader->ntoc) return -1; - return toc; + return (int) toc; } static XcursorImage * @@ -701,8 +701,8 @@ XcursorXcFileLoadAllImages (XcursorFile *file) XcursorImage *image; XcursorImages *images; int nimage; - int n; - int toc; + XcursorUInt n; + XcursorUInt toc; if (!file) return NULL; @@ -729,7 +729,7 @@ XcursorXcFileLoadAllImages (XcursorFile *file) { switch (fileHeader->tocs[toc].type) { case XCURSOR_IMAGE_TYPE: - image = _XcursorReadImage (file, fileHeader, toc); + image = _XcursorReadImage (file, fileHeader, (int) toc); if (image) { images->images[images->nimage] = image; @@ -759,7 +759,7 @@ XcursorXcFileLoad (XcursorFile *file, XcursorImage *image; XcursorComment *comment; XcursorComments *comments; - int toc; + XcursorUInt toc; if (!file) return 0; @@ -792,7 +792,7 @@ XcursorXcFileLoad (XcursorFile *file, { switch (fileHeader->tocs[toc].type) { case XCURSOR_COMMENT_TYPE: - comment = _XcursorReadComment (file, fileHeader, toc); + comment = _XcursorReadComment (file, fileHeader, (int) toc); if (comment) { comments->comments[comments->ncomment] = comment; @@ -800,7 +800,7 @@ XcursorXcFileLoad (XcursorFile *file, } break; case XCURSOR_IMAGE_TYPE: - image = _XcursorReadImage (file, fileHeader, toc); + image = _XcursorReadImage (file, fileHeader, (int) toc); if (image) { images->images[images->nimage] = image; -- cgit v1.2.1