summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2021-03-11 17:18:31 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2021-03-11 20:25:15 -0500
commit628cde0575a1e3819e73fa631d6532f9f5409e14 (patch)
tree100e1825dd836ddb5d9b4bb6d56f182b8aaa9224
parentce907e36e0869a4fcf89e2aeaa4d9d0cb52d7644 (diff)
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 <dickey@invisible-island.net>
-rw-r--r--src/file.c22
1 files 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;