Skip to content

Commit bb4541a

Browse files
author
Cristy
committed
eliminate compiler warning
1 parent 8d46da6 commit bb4541a

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

magick/cache.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -845,11 +845,9 @@ static MagickBooleanType ClonePixelCacheOnDisk(
845845
static inline int GetCacheNumberThreads(const CacheInfo *source,
846846
const CacheInfo *destination,const size_t chunk,const int factor)
847847
{
848-
int
849-
max_threads = GetMagickResourceLimit(ThreadResource),
850-
number_threads = 1;
851-
852848
size_t
849+
max_threads = (size_t) GetMagickResourceLimit(ThreadResource),
850+
number_threads = 1,
853851
workload_factor = 64UL << factor;
854852

855853
/*
@@ -864,7 +862,7 @@ static inline int GetCacheNumberThreads(const CacheInfo *source,
864862
if (((source->type != MemoryCache) && (source->type != MapCache)) ||
865863
((destination->type != MemoryCache) && (destination->type != MapCache)))
866864
number_threads=MagickMin(number_threads,4);
867-
return(number_threads);
865+
return((int) number_threads);
868866
}
869867

870868
static MagickBooleanType ClonePixelCacheRepository(

magick/thread-private.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ static inline int GetMagickNumberThreads(const Image *source,
5454
destination_type = (CacheType) GetImagePixelCacheType(destination),
5555
source_type = (CacheType) GetImagePixelCacheType(source);
5656

57-
int
58-
max_threads = GetMagickResourceLimit(ThreadResource),
59-
number_threads = 1;
60-
6157
size_t
58+
max_threads = (size_t) GetMagickResourceLimit(ThreadResource),
59+
number_threads = 1,
6260
workload_factor = 64UL << factor;
6361

6462
/*
@@ -73,7 +71,7 @@ static inline int GetMagickNumberThreads(const Image *source,
7371
if (((source_type != MemoryCache) && (source_type != MapCache)) ||
7472
((destination_type != MemoryCache) && (destination_type != MapCache)))
7573
number_threads=MagickMin(number_threads,4);
76-
return(number_threads);
74+
return((int) number_threads);
7775
}
7876

7977
static inline MagickThreadType GetMagickThreadId(void)

0 commit comments

Comments
 (0)