diff --git a/magick/distribute-cache.c b/magick/distribute-cache.c index da134b4281..4b064295a3 100755 --- a/magick/distribute-cache.c +++ b/magick/distribute-cache.c @@ -427,13 +427,13 @@ MagickPrivate DistributeCacheInfo *DestroyDistributeCacheInfo( static MagickBooleanType DestroyDistributeCache(SplayTreeInfo *registry, const size_t session_key) { - const size_t - *key = (const size_t *) NULL; + MagickAddressType + key = (MagickAddressType) session_key; /* Destroy distributed pixel cache. */ - return(DeleteNodeFromSplayTree(registry,key+session_key)); + return(DeleteNodeFromSplayTree(registry,(const void *) key)); } static inline MagickOffsetType dpc_send(int file,const MagickSizeType length, @@ -471,12 +471,12 @@ static inline MagickOffsetType dpc_send(int file,const MagickSizeType length, static MagickBooleanType OpenDistributeCache(SplayTreeInfo *registry,int file, const size_t session_key,ExceptionInfo *exception) { - const size_t - *key = (const size_t *) NULL; - Image *image; + MagickAddressType + key = (MagickAddressType) session_key; + MagickBooleanType status; @@ -517,7 +517,7 @@ static MagickBooleanType OpenDistributeCache(SplayTreeInfo *registry,int file, p+=sizeof(image->rows); if (SyncImagePixelCache(image,exception) == MagickFalse) return(MagickFalse); - status=AddValueToSplayTree(registry,key+session_key,image); + status=AddValueToSplayTree(registry,(const void *) key,image); return(status); } @@ -530,12 +530,12 @@ static MagickBooleanType ReadDistributeCacheIndexes(SplayTreeInfo *registry, const PixelPacket *p; - const size_t - *key = (const size_t *) NULL; - Image *image; + MagickAddressType + key = (MagickAddressType) session_key; + MagickOffsetType count; @@ -552,7 +552,7 @@ static MagickBooleanType ReadDistributeCacheIndexes(SplayTreeInfo *registry, /* Read distributed pixel cache indexes. */ - image=(Image *) GetValueFromSplayTree(registry,key+session_key); + image=(Image *) GetValueFromSplayTree(registry,(const void *) key); if (image == (Image *) NULL) return(MagickFalse); length=sizeof(region.width)+sizeof(region.height)+sizeof(region.x)+ @@ -588,12 +588,12 @@ static MagickBooleanType ReadDistributeCachePixels(SplayTreeInfo *registry, const PixelPacket *p; - const size_t - *key = (const size_t *) NULL; - Image *image; + MagickAddressType + key = (MagickAddressType) session_key; + MagickOffsetType count; @@ -610,7 +610,7 @@ static MagickBooleanType ReadDistributeCachePixels(SplayTreeInfo *registry, /* Read distributed pixel cache pixels. */ - image=(Image *) GetValueFromSplayTree(registry,key+session_key); + image=(Image *) GetValueFromSplayTree(registry,(const void *) key); if (image == (Image *) NULL) return(MagickFalse); length=sizeof(region.width)+sizeof(region.height)+sizeof(region.x)+ @@ -647,15 +647,15 @@ static void *RelinquishImageRegistry(void *image) static MagickBooleanType WriteDistributeCacheIndexes(SplayTreeInfo *registry, int file,const size_t session_key,ExceptionInfo *exception) { - const size_t - *key = (const size_t *) NULL; - Image *image; IndexPacket *indexes; + MagickAddressType + key = (MagickAddressType) session_key; + MagickOffsetType count; @@ -674,7 +674,7 @@ static MagickBooleanType WriteDistributeCacheIndexes(SplayTreeInfo *registry, /* Write distributed pixel cache indexes. */ - image=(Image *) GetValueFromSplayTree(registry,key+session_key); + image=(Image *) GetValueFromSplayTree(registry,(const void *) key); if (image == (Image *) NULL) return(MagickFalse); length=sizeof(region.width)+sizeof(region.height)+sizeof(region.x)+ @@ -707,12 +707,12 @@ static MagickBooleanType WriteDistributeCacheIndexes(SplayTreeInfo *registry, static MagickBooleanType WriteDistributeCachePixels(SplayTreeInfo *registry, int file,const size_t session_key,ExceptionInfo *exception) { - const size_t - *key = (const size_t *) NULL; - Image *image; + MagickAddressType + key = (MagickAddressType) session_key; + MagickOffsetType count; @@ -732,7 +732,7 @@ static MagickBooleanType WriteDistributeCachePixels(SplayTreeInfo *registry, /* Write distributed pixel cache pixels. */ - image=(Image *) GetValueFromSplayTree(registry,key+session_key); + image=(Image *) GetValueFromSplayTree(registry,(const void *) key); if (image == (Image *) NULL) return(MagickFalse); length=sizeof(region.width)+sizeof(region.height)+sizeof(region.x)+ diff --git a/wand/wand.c b/wand/wand.c index a9d50001cb..16bbc365a9 100644 --- a/wand/wand.c +++ b/wand/wand.c @@ -76,14 +76,11 @@ static SemaphoreInfo */ WandExport size_t AcquireWandId(void) { - const size_t - *wand_id = (const size_t *) NULL; - - size_t - id; + MagickAddressType + wand_id; static size_t - isn = 0; + id = 0; if (wand_semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&wand_semaphore); @@ -91,11 +88,12 @@ WandExport size_t AcquireWandId(void) if (wand_ids == (SplayTreeInfo *) NULL) wand_ids=NewSplayTree((int (*)(const void *,const void *)) NULL, (void *(*)(void *)) NULL,(void *(*)(void *)) NULL); - id=isn++; - (void) AddValueToSplayTree(wand_ids,wand_id+id,wand_id+id); + wand_id=id++; + (void) AddValueToSplayTree(wand_ids,(const void *) wand_id,(const void *) + wand_id); instantiate_wand=MagickTrue; UnlockSemaphoreInfo(wand_semaphore); - return(id); + return((size_t) wand_id); } /* @@ -154,11 +152,11 @@ WandExport void DestroyWandIds(void) */ WandExport void RelinquishWandId(const size_t id) { - const size_t - *wand_id = (const size_t *) NULL; + MagickAddressType + wand_id = (MagickAddressType) id; LockSemaphoreInfo(wand_semaphore); if (wand_ids != (SplayTreeInfo *) NULL) - (void) DeleteNodeFromSplayTree(wand_ids,wand_id+id); + (void) DeleteNodeFromSplayTree(wand_ids,(const void *) wand_id); UnlockSemaphoreInfo(wand_semaphore); }