]> granicus.if.org Git - imagemagick/commitdiff
Replace CopyMagickMemory() with memcpy() / memmove()
authorCristy <urban-warrior@imagemagick.org>
Sat, 10 Mar 2018 15:42:46 +0000 (10:42 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 10 Mar 2018 15:42:46 +0000 (10:42 -0500)
34 files changed:
MagickCore/cipher.c
MagickCore/draw.c
MagickCore/feature.c
MagickCore/fourier.c
MagickCore/image.c
MagickCore/nt-base.c
MagickCore/paint.c
MagickCore/pixel.c
MagickCore/profile.c
MagickCore/property.c
MagickCore/quantize.c
MagickCore/random.c
MagickCore/signature.c
MagickCore/string.c
MagickCore/widget.c
MagickCore/xml-tree.c
MagickCore/xwindow.c
MagickWand/magick-property.c
coders/icon.c
coders/jpeg.c
coders/mvg.c
coders/palm.c
coders/pcd.c
coders/pcl.c
coders/pcx.c
coders/pdb.c
coders/pict.c
coders/png.c
coders/psd.c
coders/sfw.c
coders/sixel.c
coders/sun.c
coders/svg.c
coders/tiff.c

index 6338b80abaf180084eacf8ab316b37836eb8fd5b..6459e2717a134cc74963076bba54ad599bd2a112 100644 (file)
@@ -638,7 +638,7 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image,
   FinalizeSignature(signature_info);
   (void) memset(input_block,0,sizeof(input_block));
   digest=GetStringInfoDatum(GetSignatureDigest(signature_info));
-  (void) CopyMagickMemory(input_block,digest,MagickMin(AESBlocksize,
+  (void) memcpy(input_block,digest,MagickMin(AESBlocksize,
     GetSignatureDigestsize(signature_info))*sizeof(*input_block));
   signature_info=DestroySignatureInfo(signature_info);
   /*
@@ -671,7 +671,7 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image,
     p=pixels;
     for (x=0; x < (ssize_t) length; x+=AESBlocksize)
     {
-      (void) CopyMagickMemory(output_block,input_block,AESBlocksize*
+      (void) memcpy(output_block,input_block,AESBlocksize*
         sizeof(*output_block));
       IncrementCipherNonce(AESBlocksize,input_block);
       EncipherAESBlock(aes_info,output_block,output_block);
@@ -679,7 +679,7 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image,
         p[i]^=output_block[i];
       p+=AESBlocksize;
     }
-    (void) CopyMagickMemory(output_block,input_block,AESBlocksize*
+    (void) memcpy(output_block,input_block,AESBlocksize*
       sizeof(*output_block));
     EncipherAESBlock(aes_info,output_block,output_block);
     for (i=0; x < (ssize_t) length; x++)
@@ -858,7 +858,7 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image,
   signature=DestroyString(signature);
   (void) memset(input_block,0,sizeof(input_block));
   digest=GetStringInfoDatum(GetSignatureDigest(signature_info));
-  (void) CopyMagickMemory(input_block,digest,MagickMin(AESBlocksize,
+  (void) memcpy(input_block,digest,MagickMin(AESBlocksize,
     GetSignatureDigestsize(signature_info))*sizeof(*input_block));
   signature_info=DestroySignatureInfo(signature_info);
   /*
@@ -891,7 +891,7 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image,
     p=pixels;
     for (x=0; x < (ssize_t) length; x+=AESBlocksize)
     {
-      (void) CopyMagickMemory(output_block,input_block,AESBlocksize*
+      (void) memcpy(output_block,input_block,AESBlocksize*
         sizeof(*output_block));
       IncrementCipherNonce(AESBlocksize,input_block);
       EncipherAESBlock(aes_info,output_block,output_block);
@@ -899,7 +899,7 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image,
         p[i]^=output_block[i];
       p+=AESBlocksize;
     }
-    (void) CopyMagickMemory(output_block,input_block,AESBlocksize*
+    (void) memcpy(output_block,input_block,AESBlocksize*
       sizeof(*output_block));
     EncipherAESBlock(aes_info,output_block,output_block);
     for (i=0; x < (ssize_t) length; x++)
@@ -1030,7 +1030,7 @@ static void SetAESKey(AESInfo *aes_info,const StringInfo *key)
   */
   datum=GetStringInfoDatum(aes_info->key);
   (void) memset(datum,0,GetStringInfoLength(aes_info->key));
-  (void) CopyMagickMemory(datum,GetStringInfoDatum(key),MagickMin(
+  (void) memcpy(datum,GetStringInfoDatum(key),MagickMin(
     GetStringInfoLength(key),GetStringInfoLength(aes_info->key)));
   for (i=0; i < n; i++)
     aes_info->encipher_key[i]=datum[4*i] | (datum[4*i+1] << 8) |
index 3b04aec8b794aef3f2e2a4b66a14d51c7c9c787b..b733a6ebc93a77bd05937f19284605a3f2de2b4d 100644 (file)
@@ -320,8 +320,8 @@ MagickExport DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
       if (clone_info->dash_pattern == (double *) NULL)
         ThrowFatalException(ResourceLimitFatalError,
           "UnableToAllocateDashPattern");
-      (void) CopyMagickMemory(clone_info->dash_pattern,draw_info->dash_pattern,
-        (size_t) (x+1)*sizeof(*clone_info->dash_pattern));
+      (void) memcpy(clone_info->dash_pattern,draw_info->dash_pattern,(size_t)
+        (x+1)*sizeof(*clone_info->dash_pattern));
     }
   clone_info->gradient=draw_info->gradient;
   if (draw_info->gradient.stops != (StopInfo *) NULL)
@@ -335,7 +335,7 @@ MagickExport DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
       if (clone_info->gradient.stops == (StopInfo *) NULL)
         ThrowFatalException(ResourceLimitFatalError,
           "UnableToAllocateDashPattern");
-      (void) CopyMagickMemory(clone_info->gradient.stops,
+      (void) memcpy(clone_info->gradient.stops,
         draw_info->gradient.stops,(size_t) number_stops*
         sizeof(*clone_info->gradient.stops));
     }
@@ -899,7 +899,7 @@ static size_t DestroyEdge(PolygonInfo *polygon_info,
     polygon_info->edges[edge].points);
   polygon_info->number_edges--;
   if (edge < polygon_info->number_edges)
-    (void) CopyMagickMemory(polygon_info->edges+edge,polygon_info->edges+edge+1,
+    (void) memmove(polygon_info->edges+edge,polygon_info->edges+edge+1,
       (size_t) (polygon_info->number_edges-edge)*sizeof(*polygon_info->edges));
   return(polygon_info->number_edges);
 }
@@ -6213,7 +6213,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info,
           polygon_primitive);
       return((PrimitiveInfo *) NULL);
     }
-  (void) CopyMagickMemory(polygon_primitive,primitive_info,(size_t)
+  (void) memcpy(polygon_primitive,primitive_info,(size_t)
     number_vertices*sizeof(*polygon_primitive));
   closed_path=
     (fabs(primitive_info[number_vertices-1].point.x-primitive_info[0].point.x) < DrawEpsilon) &&
index e6fd778ee72598d9df499cc1f777162b8836d365..3e1205e09be5d6ec5f954faf479830d88c2617a4 100644 (file)
@@ -1812,7 +1812,7 @@ static Image *RenderHoughLines(const ImageInfo *image_info,const size_t columns,
         GetBlobSize(image)+1);
       if (draw_info->primitive != (char *) NULL)
         {
-          (void) CopyMagickMemory(draw_info->primitive,GetBlobStreamData(image),
+          (void) memcpy(draw_info->primitive,GetBlobStreamData(image),
             (size_t) GetBlobSize(image));
           draw_info->primitive[GetBlobSize(image)]='\0';
         }
index e2b25192e16b10db4877808329654efd53ee65f0..a5cdac333ed83d89a96b18d917556cd095f03b34 100644 (file)
@@ -428,7 +428,7 @@ static MagickBooleanType RollFourier(const size_t width,const size_t height,
       source_pixels[v*width+u]=roll_pixels[i++];
     }
   }
-  (void) CopyMagickMemory(roll_pixels,source_pixels,height*width*
+  (void) memcpy(roll_pixels,source_pixels,height*width*
     sizeof(*source_pixels));
   source_info=RelinquishVirtualMemory(source_info);
   return(MagickTrue);
@@ -1190,7 +1190,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
   magnitude_view=DestroyCacheView(magnitude_view);
   status=InverseQuadrantSwap(fourier_info->width,fourier_info->height,
     magnitude_pixels,inverse_pixels);
-  (void) CopyMagickMemory(magnitude_pixels,inverse_pixels,fourier_info->height*
+  (void) memcpy(magnitude_pixels,inverse_pixels,fourier_info->height*
     fourier_info->center*sizeof(*magnitude_pixels));
   i=0L;
   phase_view=AcquireVirtualCacheView(phase_image,exception);
@@ -1251,7 +1251,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
   if (status != MagickFalse)
     status=InverseQuadrantSwap(fourier_info->width,fourier_info->height,
       phase_pixels,inverse_pixels);
-  (void) CopyMagickMemory(phase_pixels,inverse_pixels,fourier_info->height*
+  (void) memcpy(phase_pixels,inverse_pixels,fourier_info->height*
     fourier_info->center*sizeof(*phase_pixels));
   inverse_info=RelinquishVirtualMemory(inverse_info);
   /*
index df6bf6697a6477efb86807fdbf7480f794067eac..3d42f675703f781e379c9d4a5ad2a92a5254a726 100644 (file)
@@ -886,7 +886,7 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns,
           clone_image=DestroyImage(clone_image);
           ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
         }
-      (void) CopyMagickMemory(clone_image->colormap,image->colormap,length*
+      (void) memcpy(clone_image->colormap,image->colormap,length*
         sizeof(*clone_image->colormap));
     }
   if ((columns == 0) || (rows == 0))
index ce2592730d4b40623ec16951bff6bccd3edf01fb..ae856000726c5a1b44d5bb634fde022ca55c70b9 100644 (file)
@@ -2194,7 +2194,7 @@ MagickPrivate unsigned char *NTResourceToBlob(const char *id)
     sizeof(*blob));
   if (blob != (unsigned char *) NULL)
     {
-      (void) CopyMagickMemory(blob,value,length);
+      (void) memcpy(blob,value,length);
       blob[length]='\0';
     }
   UnlockResource(global);
index adbf4e5745b50c7d2632b5026eeaece0d16a26eb..9b3e15c25e898516942af8629a5cc354609c82ad 100644 (file)
@@ -605,7 +605,7 @@ MagickExport MagickBooleanType GradientImage(Image *image,
   if (gradient->stops == (StopInfo *) NULL)
     ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
       image->filename);
-  (void) CopyMagickMemory(gradient->stops,stops,(size_t) number_stops*
+  (void) memcpy(gradient->stops,stops,(size_t) number_stops*
     sizeof(*stops));
   /*
     Draw a gradient on the image.
index 7edffd930f24b7e2d8f4dc99951ed73cb97b58dd..8f1d596cc2d645e5e4bbef05d270beaa90d44abe 100644 (file)
@@ -139,7 +139,7 @@ MagickExport PixelChannelMap *ClonePixelChannelMap(PixelChannelMap *channel_map)
   clone_map=AcquirePixelChannelMap();
   if (clone_map == (PixelChannelMap *) NULL)
     return((PixelChannelMap *) NULL);
-  (void) CopyMagickMemory(clone_map,channel_map,MaxPixelChannels*
+  (void) memcpy(clone_map,channel_map,MaxPixelChannels*
     sizeof(*channel_map));
   return(clone_map);
 }
index c4b8cbf179cbc6dd5c76302ed1c848d5a1db0e42..d163b1b9469d111deed9cb5646363b9b9e7c7604 100644 (file)
@@ -1336,7 +1336,7 @@ static inline void WriteResourceLong(unsigned char *p,
   buffer[1]=(unsigned char) (quantum >> 16);
   buffer[2]=(unsigned char) (quantum >> 8);
   buffer[3]=(unsigned char) quantum;
-  (void) CopyMagickMemory(p,buffer,4);
+  (void) memcpy(p,buffer,4);
 }
 
 static void WriteTo8BimProfile(Image *image,const char *name,
@@ -1423,7 +1423,7 @@ static void WriteTo8BimProfile(Image *image,const char *name,
           {
             offset=(q-datum);
             extract_profile=AcquireStringInfo(offset+extent);
-            (void) CopyMagickMemory(extract_profile->datum,datum,offset);
+            (void) memcpy(extract_profile->datum,datum,offset);
           }
         else
           {
@@ -1432,13 +1432,13 @@ static void WriteTo8BimProfile(Image *image,const char *name,
             if ((extract_extent & 0x01) != 0)
               extract_extent++;
             extract_profile=AcquireStringInfo(offset+extract_extent+extent);
-            (void) CopyMagickMemory(extract_profile->datum,datum,offset-4);
+            (void) memcpy(extract_profile->datum,datum,offset-4);
             WriteResourceLong(extract_profile->datum+offset-4,(unsigned int)
               profile->length);
-            (void) CopyMagickMemory(extract_profile->datum+offset,
+            (void) memcpy(extract_profile->datum+offset,
               profile->datum,profile->length);
           }
-        (void) CopyMagickMemory(extract_profile->datum+offset+extract_extent,
+        (void) memcpy(extract_profile->datum+offset+extract_extent,
           p+count,extent);
         (void) AddValueToSplayTree((SplayTreeInfo *) image->profiles,
           ConstantString("8bim"),CloneStringInfo(extract_profile));
@@ -1776,14 +1776,14 @@ static inline void WriteProfileLong(const EndianType endian,
       buffer[1]=(unsigned char) (value >> 8);
       buffer[2]=(unsigned char) (value >> 16);
       buffer[3]=(unsigned char) (value >> 24);
-      (void) CopyMagickMemory(p,buffer,4);
+      (void) memcpy(p,buffer,4);
       return;
     }
   buffer[0]=(unsigned char) (value >> 24);
   buffer[1]=(unsigned char) (value >> 16);
   buffer[2]=(unsigned char) (value >> 8);
   buffer[3]=(unsigned char) value;
-  (void) CopyMagickMemory(p,buffer,4);
+  (void) memcpy(p,buffer,4);
 }
 
 static void WriteProfileShort(const EndianType endian,
@@ -1796,12 +1796,12 @@ static void WriteProfileShort(const EndianType endian,
     {
       buffer[0]=(unsigned char) value;
       buffer[1]=(unsigned char) (value >> 8);
-      (void) CopyMagickMemory(p,buffer,2);
+      (void) memcpy(p,buffer,2);
       return;
     }
   buffer[0]=(unsigned char) (value >> 8);
   buffer[1]=(unsigned char) value;
-  (void) CopyMagickMemory(p,buffer,2);
+  (void) memcpy(p,buffer,2);
 }
 
 static MagickBooleanType Sync8BimProfile(Image *image,StringInfo *profile)
index ea1320a04f04eaa80825ae2172943afd0071f6b7..f2c31d38c16f1dabdb4210288b351f09a2522bf9 100644 (file)
@@ -708,7 +708,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key,
         sizeof(*attribute));
     if (attribute != (char *) NULL)
       {
-        (void) CopyMagickMemory(attribute,(char *) info,(size_t) count);
+        (void) memcpy(attribute,(char *) info,(size_t) count);
         attribute[count]='\0';
         info+=count;
         length-=MagickMin(count,(ssize_t) length);
index 3e3ddb9c32d61af6bfad3ffef9009a229fe231a0..ae13eb497934cd0721b3497a59b4c1365a5ffa71 100644 (file)
@@ -1898,7 +1898,7 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view,
       /*
         Propagate the error as the last entry of the error queue.
       */
-      (void) CopyMagickMemory(p->error,p->error+1,(ErrorQueueLength-1)*
+      (void) memmove(p->error,p->error+1,(ErrorQueueLength-1)*
         sizeof(p->error[0]));
       AssociateAlphaPixelInfo(cube_info,image->colormap+index,&color);
       p->error[ErrorQueueLength-1].red=pixel.red-color.red;
index 68fb6ea6c163ccfccc9238ceb793bb6381deb86b..ef8a9effd7d0c0ce25d7e3a457b14a8defcfd89d 100644 (file)
@@ -221,7 +221,7 @@ MagickExport RandomInfo *AcquireRandomInfo(void)
   if (random_info->secret_key == ~0UL)
     {
       key=GetRandomKey(random_info,sizeof(random_info->secret_key));
-      (void) CopyMagickMemory(random_info->seed,GetStringInfoDatum(key),
+      (void) memcpy(random_info->seed,GetStringInfoDatum(key),
         GetStringInfoLength(key));
       key=DestroyStringInfo(key);
     }
@@ -237,7 +237,7 @@ MagickExport RandomInfo *AcquireRandomInfo(void)
       key=DestroyStringInfo(key);
       FinalizeSignature(signature_info);
       digest=GetSignatureDigest(signature_info);
-      (void) CopyMagickMemory(random_info->seed,GetStringInfoDatum(digest),
+      (void) memcpy(random_info->seed,GetStringInfoDatum(digest),
         MagickMin(GetSignatureDigestsize(signature_info),
         sizeof(*random_info->seed)));
       signature_info=DestroySignatureInfo(signature_info);
@@ -910,7 +910,7 @@ MagickExport void SetRandomKey(RandomInfo *random_info,const size_t length,
     UpdateSignature(signature_info,random_info->nonce);
     FinalizeSignature(signature_info);
     IncrementRandomNonce(random_info->nonce);
-    (void) CopyMagickMemory(p,GetStringInfoDatum(GetSignatureDigest(
+    (void) memcpy(p,GetStringInfoDatum(GetSignatureDigest(
       signature_info)),GetSignatureDigestsize(signature_info));
     p+=GetSignatureDigestsize(signature_info);
     i-=GetSignatureDigestsize(signature_info);
index 0ce2c96464dd3334405a80689cfa3fd5f28d2183..564d02fa92382ebd04bff3bd52c5278d0ea09827 100644 (file)
@@ -808,7 +808,7 @@ MagickPrivate void UpdateSignature(SignatureInfo *signature_info,
       i=GetStringInfoLength(signature_info->message)-signature_info->extent;
       if (i > n)
         i=n;
-      (void) CopyMagickMemory(GetStringInfoDatum(signature_info->message)+
+      (void) memcpy(GetStringInfoDatum(signature_info->message)+
         signature_info->extent,p,i);
       n-=i;
       p+=i;
@@ -824,6 +824,6 @@ MagickPrivate void UpdateSignature(SignatureInfo *signature_info,
     n-=GetStringInfoLength(signature_info->message);
     TransformSignature(signature_info);
   }
-  (void) CopyMagickMemory(GetStringInfoDatum(signature_info->message),p,n);
+  (void) memcpy(GetStringInfoDatum(signature_info->message),p,n);
   signature_info->extent=n;
 }
index 091242a2547f661fa9bf7838cbcee646f9e6b583..6cd3c5991daf6b4105b3c81671913e7e1d2c901c 100644 (file)
@@ -2647,9 +2647,9 @@ MagickExport MagickBooleanType SubstituteString(char **string,
       Replace string.
     */
     if (search_extent != replace_extent)
-      (void) CopyMagickMemory(p+replace_extent,p+search_extent,
+      (void) memmove(p+replace_extent,p+search_extent,
         strlen(p+search_extent)+1);
-    (void) CopyMagickMemory(p,replace,replace_extent);
+    (void) memcpy(p,replace,replace_extent);
     p+=replace_extent-1;
   }
   return(status);
index 514b5cd909be1925d60756c6a9087ee8426f5bf1..c17f39563b98d78054341cc87106291e8a951458 100644 (file)
@@ -1107,7 +1107,7 @@ static void XEditText(Display *display,XWidgetInfo *text_info,
       if (text_info->cursor != text_info->text)
         {
           text_info->cursor--;
-          (void) CopyMagickString(text_info->cursor,text_info->cursor+1,
+          (void) memmove(text_info->cursor,text_info->cursor+1,
             MagickPathExtent);
           text_info->highlight=MagickFalse;
           break;
index 9bc03a084af4debd9320075d2c1a82d661a1e41b..d62ce1f9a31505b3a33dfcb30d17ff2351eefb42 100644 (file)
@@ -1316,7 +1316,7 @@ static char *ConvertUTF16ToUTF8(const char *content,size_t *length)
       /*
         Already UTF-8.
       */
-      (void) CopyMagickMemory(utf8,content,*length*sizeof(*utf8));
+      (void) memcpy(utf8,content,*length*sizeof(*utf8));
       utf8[*length]='\0';
       return(utf8);
     }
@@ -1401,7 +1401,7 @@ static char *ParseEntities(char *xml,char **entities,int state)
     {
       *(xml++)='\n';
       if (*xml == '\n')
-        (void) CopyMagickMemory(xml,xml+1,strlen(xml));
+        (void) memmove(xml,xml+1,strlen(xml));
     }
   for (xml=p; ; )
   {
@@ -1455,7 +1455,7 @@ static char *ParseEntities(char *xml,char **entities,int state)
               xml++;
             }
           }
-        (void) CopyMagickMemory(xml,strchr(xml,';')+1,strlen(strchr(xml,';')));
+        (void) memmove(xml,strchr(xml,';')+1,strlen(strchr(xml,';')));
       }
     else
       if (((*xml == '&') && ((state == '&') || (state == ' ') ||
@@ -1508,7 +1508,7 @@ static char *ParseEntities(char *xml,char **entities,int state)
                     entity=strchr(xml,';');
                   }
                 if (entity != (char *) NULL)
-                  (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
+                  (void) memcpy(xml+length,entity+1,strlen(entity));
                 (void) strncpy(xml,entities[i],length);
               }
         }
@@ -1531,7 +1531,7 @@ static char *ParseEntities(char *xml,char **entities,int state)
 
         i=(ssize_t) strspn(xml,accept);
         if (i != 0)
-          (void) CopyMagickMemory(xml,xml+i,strlen(xml+i)+1);
+          (void) memmove(xml,xml+i,strlen(xml+i)+1);
         while ((*xml != '\0') && (*xml != ' '))
           xml++;
         if (*xml == '\0')
@@ -1709,7 +1709,7 @@ static MagickBooleanType ParseInternalDoctype(XMLTreeRoot *root,char *xml,
   predefined_entitites=(char **) AcquireMagickMemory(sizeof(sentinel));
   if (predefined_entitites == (char **) NULL)
     ThrowFatalException(ResourceLimitError,"MemoryAllocationFailed");
-  (void) CopyMagickMemory(predefined_entitites,sentinel,sizeof(sentinel));
+  (void) memcpy(predefined_entitites,sentinel,sizeof(sentinel));
   for (xml[length]='\0'; xml != (char *) NULL; )
   {
     while ((*xml != '\0') && (*xml != '<') && (*xml != '%'))
@@ -2377,7 +2377,7 @@ MagickExport XMLTreeInfo *NewXMLTreeTag(const char *tag)
   root->entities=(char **) AcquireMagickMemory(sizeof(predefined_entities));
   if (root->entities == (char **) NULL)
     return((XMLTreeInfo *) NULL);
-  (void) CopyMagickMemory(root->entities,predefined_entities,
+  (void) memcpy(root->entities,predefined_entities,
     sizeof(predefined_entities));
   root->root.attributes=sentinel;
   root->attributes=(char ***) root->root.attributes;
@@ -2538,16 +2538,15 @@ MagickPrivate XMLTreeInfo *SetXMLTreeAttribute(XMLTreeInfo *xml_info,
     }
   if (xml_info->attributes[i] != (char *) NULL)
     xml_info->attributes[i]=DestroyString(xml_info->attributes[i]);
-  (void) CopyMagickMemory(xml_info->attributes+i,xml_info->attributes+i+2,
-    (size_t) (j-i)*sizeof(*xml_info->attributes));
+  (void) memmove(xml_info->attributes+i,xml_info->attributes+i+2,(size_t)
+    (j-i)*sizeof(*xml_info->attributes));
   xml_info->attributes=(char **) ResizeQuantumMemory(xml_info->attributes,
     (size_t) (j+2),sizeof(*xml_info->attributes));
   if (xml_info->attributes == (char **) NULL)
     ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");
   j-=2;
-  (void) CopyMagickMemory(xml_info->attributes[j+1]+(i/2),
-    xml_info->attributes[j+1]+(i/2)+1,(size_t) (((j+2)/2)-(i/2))*
-    sizeof(**xml_info->attributes));
+  (void) memmove(xml_info->attributes[j+1]+(i/2),xml_info->attributes[j+1]+
+    (i/2)+1,(size_t) (((j+2)/2)-(i/2))*sizeof(**xml_info->attributes));
   return(xml_info);
 }
 \f
index 5ca73a4445ff608b1bcf3c048e4b8c87de9d7a69..66603ab501094555808baa0da13ceb35848e31c3 100644 (file)
@@ -8418,7 +8418,7 @@ MagickPrivate void XMakeWindow(Display *display,Window parent,char **argv,
         if ((isspace((int) ((unsigned char) *p)) == 0) && (*p != '%'))
           p++;
         else
-          (void) CopyMagickString(p,p+1,MagickPathExtent-(p-geometry));
+          (void) memmove(p,p+1,MagickPathExtent-(p-geometry));
       }
       flags=XWMGeometry(display,window_info->screen,geometry,default_geometry,
         window_info->border_width,size_hints,&size_hints->x,&size_hints->y,
index fa3f795646a2c99d0042b540f2558c00f63a3d4f..c6bbdb21898f33d64c6dfa18a51cb176deffaaba 100644 (file)
@@ -721,7 +721,7 @@ WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
     sizeof(*datum));
   if (datum == (unsigned char *) NULL)
     return((unsigned char *) NULL);
-  (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
+  (void) memcpy(datum,GetStringInfoDatum(profile),
     GetStringInfoLength(profile));
   *length=(size_t) GetStringInfoLength(profile);
   return(datum);
@@ -1811,7 +1811,7 @@ WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
     sizeof(*datum));
   if (datum == (unsigned char *) NULL)
     return((unsigned char *) NULL);
-  (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
+  (void) memcpy(datum,GetStringInfoDatum(profile),
     GetStringInfoLength(profile));
   *length=GetStringInfoLength(profile);
   profile=DestroyStringInfo(profile);
index d73e0825e6ba0969573a1168a9de9ba8fe8a2898..a99c68c4851dba1909f37fa88ff55a5672484d25 100644 (file)
@@ -362,7 +362,7 @@ static Image *ReadICONImage(const ImageInfo *image_info,
         png=(unsigned char *) AcquireQuantumMemory(length+16,sizeof(*png));
         if (png == (unsigned char *) NULL)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
-        (void) CopyMagickMemory(png,"\211PNG\r\n\032\n\000\000\000\015",12);
+        (void) memcpy(png,"\211PNG\r\n\032\n\000\000\000\015",12);
         png[12]=(unsigned char) icon_info.planes;
         png[13]=(unsigned char) (icon_info.planes >> 8);
         png[14]=(unsigned char) icon_info.bits_per_pixel;
index 5eae6837eab8a86e83db8cad0d7143744cc8a77d..18545e418f1a65bfa41526bfa52e5c5dc3e9295d 100644 (file)
@@ -2004,14 +2004,14 @@ static void WriteProfile(j_compress_ptr jpeg_info,Image *image,
 
         tag_length=strlen(ICC_PROFILE);
         p=GetStringInfoDatum(custom_profile);
-        (void) CopyMagickMemory(p,ICC_PROFILE,tag_length);
+        (void) memcpy(p,ICC_PROFILE,tag_length);
         p[tag_length]='\0';
         for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65519L)
         {
           length=MagickMin(GetStringInfoLength(profile)-i,65519L);
           p[12]=(unsigned char) ((i/65519L)+1);
           p[13]=(unsigned char) (GetStringInfoLength(profile)/65519L+1);
-          (void) CopyMagickMemory(p+tag_length+3,GetStringInfoDatum(profile)+i,
+          (void) memcpy(p+tag_length+3,GetStringInfoDatum(profile)+i,
             length);
           jpeg_write_marker(jpeg_info,ICC_MARKER,GetStringInfoDatum(
             custom_profile),(unsigned int) (length+tag_length+3));
@@ -2039,7 +2039,7 @@ static void WriteProfile(j_compress_ptr jpeg_info,Image *image,
             }
           else
             {
-              (void) CopyMagickMemory(p,"Photoshop 3.0 8BIM\04\04\0\0\0\0",24);
+              (void) memcpy(p,"Photoshop 3.0 8BIM\04\04\0\0\0\0",24);
               tag_length=26;
               p[24]=(unsigned char) (length >> 8);
               p[25]=(unsigned char) (length & 0xff);
index 6fa3efac92247bdb7ad7a7c4f92b2fb01db743fc..bbc996876da76f028554c77ce261de2e4d77a91e 100644 (file)
@@ -211,7 +211,7 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
       draw_info->primitive=(char *) AcquireMagickMemory(GetBlobSize(image)+1);
       if (draw_info->primitive != (char *) NULL)
         {
-          CopyMagickMemory(draw_info->primitive,GetBlobStreamData(image),
+          memcpy(draw_info->primitive,GetBlobStreamData(image),
             GetBlobSize(image));
           draw_info->primitive[GetBlobSize(image)]='\0';
         }
index 9aa1a41feefb90c09a001e3cfd8c23a057703890..a36296df45c87fd030a25fc990df6f630ba49875 100644 (file)
@@ -473,7 +473,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info,
                     one_row[i+bit]=last_row[i+bit];
                 }
               }
-              (void) CopyMagickMemory(last_row, one_row, bytes_per_row);
+              (void) memcpy(last_row, one_row, bytes_per_row);
             }
         }
       ptr=one_row;
@@ -975,7 +975,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
               (void) WriteBlobByte(image, byte);
               (void) WriteBlob(image,tptr-tmpbuf,(unsigned char *) tmpbuf);
             }
-            (void) CopyMagickMemory(last_row,one_row,bytes_per_row);
+            (void) memcpy(last_row,one_row,bytes_per_row);
           }
         else
           (void) WriteBlob(image,bytes_per_row,one_row);
index 2f35f0c6545cb2e107e499f2426c2de55caae31b..f2a1e9a33c7d0bbe8a771877c24de0fcf8e45411 100644 (file)
@@ -464,7 +464,7 @@ static void Upsample(const size_t width,const size_t height,
   }
   p=pixels+(2*height-2)*scaled_width;
   q=pixels+(2*height-1)*scaled_width;
-  (void) CopyMagickMemory(q,p,(size_t) (2*width));
+  (void) memcpy(q,p,(size_t) (2*width));
 }
 
 static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception)
index 077aef119c766ab3b787b2b9ee4a8cb4369fd466..e94ae4f312c684c32d175dfadb3edead280e44a6 100644 (file)
@@ -943,7 +943,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
             (double) packets);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,packets,compress_pixels);
-          (void) CopyMagickMemory(previous_pixels,pixels,length*
+          (void) memcpy(previous_pixels,pixels,length*
             sizeof(*pixels));
           break;
         }
index a8bce12458d9bd14b0912e4542ae92696662ff86..0c99a5e6e36d54c0c9d566cd570157162e58e6f9 100644 (file)
@@ -616,7 +616,7 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
             }
             case 8:
             {
-              (void) CopyMagickMemory(r,p,image->columns);
+              (void) memcpy(r,p,image->columns);
               break;
             }
             default:
index effda78fbfa10b43e631d07e30934177720d4695..7e1a80e5ec88271b11fb47e6931532e8e3ecea20 100644 (file)
@@ -708,7 +708,7 @@ static unsigned char *EncodeRLE(unsigned char *destination,
 {
   if (literal > 0)
     *destination++=(unsigned char) (literal-1);
-  (void) CopyMagickMemory(destination,source,literal);
+  (void) memcpy(destination,source,literal);
   destination+=literal;
   if (repeat > 0)
     {
@@ -798,8 +798,8 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image,
   pdb_info.modify_number=0;
   pdb_info.application_info=0;
   pdb_info.sort_info=0;
-  (void) CopyMagickMemory(pdb_info.type,"vIMG",4);
-  (void) CopyMagickMemory(pdb_info.id,"View",4);
+  (void) memcpy(pdb_info.type,"vIMG",4);
+  (void) memcpy(pdb_info.id,"View",4);
   pdb_info.seed=0;
   pdb_info.next_record=0;
   comment=GetImageProperty(image,"comment",exception);
@@ -916,7 +916,7 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image,
               if (0x7f < literal)
                 {
                   q=EncodeRLE(q,buffer,(literal < 0x80 ? literal : 0x80),0);
-                  (void) CopyMagickMemory(buffer,buffer+literal+repeat,0x80);
+                  (void) memmove(buffer,buffer+literal+repeat,0x80);
                   literal-=0x80;
                 }
             }
index 36125ca9cfcbcdc15be3e19119054b58dd4bb312..579477146db5cac74b5f8dd9c60ee4dc4a1b8f93 100644 (file)
@@ -485,7 +485,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image,
               image->filename);
             break;
           }
-        (void) CopyMagickMemory(q,p,(size_t) number_pixels);
+        (void) memcpy(q,p,(size_t) number_pixels);
       }
       scanline=(unsigned char *) RelinquishMagickMemory(scanline);
       return(pixels);
@@ -520,7 +520,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image,
           number_pixels=length*bytes_per_pixel;
           p=ExpandBuffer(scanline+j+1,&number_pixels,bits_per_pixel);
           if ((q-pixels+number_pixels) <= *extent)
-            (void) CopyMagickMemory(q,p,(size_t) number_pixels);
+            (void) memcpy(q,p,(size_t) number_pixels);
           q+=number_pixels;
           j+=(ssize_t) (length*bytes_per_pixel+1);
         }
@@ -532,7 +532,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image,
           for (i=0; i < (ssize_t) length; i++)
           {
             if ((q-pixels+number_pixels) <= *extent)
-              (void) CopyMagickMemory(q,p,(size_t) number_pixels);
+              (void) memcpy(q,p,(size_t) number_pixels);
             q+=number_pixels;
           }
           j+=(ssize_t) bytes_per_pixel+1;
index c5119e233d86707fbacf41b9bafcbf1a60fe3351..2cc4c38eef51c52f6ebe313f3d613e1b18af72c0 100644 (file)
@@ -1284,7 +1284,7 @@ static void PNGShort(png_bytep p,png_uint_16 value)
 
 static void PNGType(png_bytep p,const png_byte *type)
 {
-  (void) CopyMagickMemory(p,type,4*sizeof(png_byte));
+  (void) memcpy(p,type,4*sizeof(png_byte));
 }
 
 static void LogPNGChunk(MagickBooleanType logging, const png_byte *type,
@@ -6948,7 +6948,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,
                   }
 
                 n=GetAuthenticPixels(image,0,0,image->columns,1,exception);
-                (void) CopyMagickMemory(next,n,length);
+                (void) memcpy(next,n,length);
 
                 for (y=0; y < (ssize_t) image->rows; y++)
                 {
@@ -6975,7 +6975,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,
                     {
                       n=GetAuthenticPixels(image,0,y+1,image->columns,1,
                           exception);
-                      (void) CopyMagickMemory(next,n,length);
+                      (void) memcpy(next,n,length);
                     }
 
                   for (i=0; i < m; i++, yy++)
index 58d22ed618fe0d5b0ce0b0427cc2f52c6d2f0f3e..02160b28813d5c7756516eb568aef94357e45be0 100644 (file)
@@ -3081,7 +3081,7 @@ static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile)
         if ((quantum >= 12) && (quantum < (ssize_t) length))
           {
             if ((q+quantum < (datum+length-16)))
-              (void) CopyMagickMemory(q,q+quantum,length-quantum-(q-datum));
+              (void) memmove(q,q+quantum,length-quantum-(q-datum));
             SetStringInfoLength(bim_profile,length-quantum);
           }
         break;
@@ -3136,7 +3136,7 @@ static void RemoveResolutionFromResourceBlock(StringInfo *bim_profile)
     if ((id == 0x000003ed) && (cnt < (ssize_t) (length-12)) &&
         ((ssize_t) length-(cnt+12)-(q-datum)) > 0)
       {
-        (void) CopyMagickMemory(q,q+cnt+12,length-(cnt+12)-(q-datum));
+        (void) memmove(q,q+cnt+12,length-(cnt+12)-(q-datum));
         SetStringInfoLength(bim_profile,length-(cnt+12));
         break;
       }
@@ -3232,7 +3232,7 @@ static const StringInfo *GetAdditionalInformation(const ImageInfo *image_info,
     if (found == MagickFalse)
       {
         if (remaining_length > 0)
-          p=(unsigned char *) CopyMagickMemory(p-12,p+size,remaining_length);
+          p=(unsigned char *) memmove(p-12,p+size,remaining_length);
         continue;
       }
     length+=(size_t) size+12;
index ddd503f111521f8570827b8e038ea9d1256da9b4..f5a7861240b611ed9151757d420a5eda0fa362b2 100644 (file)
@@ -279,7 +279,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception)
     }
   TranslateSFWMarker(header);  /* translate soi and app tags */
   TranslateSFWMarker(header+2);
-  (void) CopyMagickMemory(header+6,"JFIF\0\001\0",7);  /* JFIF magic */
+  (void) memcpy(header+6,"JFIF\0\001\0",7);  /* JFIF magic */
   /*
     Translate remaining markers.
   */
index 417a011c3e551173790ce81da9efd3820cd07b15..b657f2fc9e8473118798dc2aceb27685870969ea 100644 (file)
@@ -373,7 +373,7 @@ MagickBooleanType sixel_decode(Image *image,
                 }
                 (void) memset(dmbuf, background_color_index, (size_t) dmsx * dmsy);
                 for (y = 0; y < imsy; ++y) {
-                    (void) CopyMagickMemory(dmbuf + dmsx * y, imbuf + imsx * y, imsx);
+                    (void) memcpy(dmbuf + dmsx * y, imbuf + imsx * y, imsx);
                 }
                 imbuf = (unsigned char *) RelinquishMagickMemory(imbuf);
                 imsx = dmsx;
@@ -451,7 +451,7 @@ MagickBooleanType sixel_decode(Image *image,
                 }
                 (void) memset(dmbuf, background_color_index, (size_t) dmsx * dmsy);
                 for (y = 0; y < imsy; ++y) {
-                    (void) CopyMagickMemory(dmbuf + dmsx * y, imbuf + imsx * y, imsx);
+                    (void) memcpy(dmbuf + dmsx * y, imbuf + imsx * y, imsx);
                 }
                 imbuf = (unsigned char *) RelinquishMagickMemory(imbuf);
                 imsx = dmsx;
@@ -549,7 +549,7 @@ MagickBooleanType sixel_decode(Image *image,
             return (MagickFalse);
         }
         for (y = 0; y < dmsy; ++y) {
-            (void) CopyMagickMemory(dmbuf + dmsx * y, imbuf + imsx * y, dmsx);
+            (void) memcpy(dmbuf + dmsx * y, imbuf + imsx * y, dmsx);
         }
         imbuf = (unsigned char *) RelinquishMagickMemory(imbuf);
         imsx = dmsx;
@@ -596,7 +596,7 @@ static void sixel_advance(sixel_output_t *context, int nwrite)
 {
     if ((context->pos += nwrite) >= SIXEL_OUTPUT_PACKET_SIZE) {
         WriteBlob(context->image,SIXEL_OUTPUT_PACKET_SIZE,context->buffer);
-        CopyMagickMemory(context->buffer,
+        memcpy(context->buffer,
                context->buffer + SIXEL_OUTPUT_PACKET_SIZE,
                (context->pos -= SIXEL_OUTPUT_PACKET_SIZE));
     }
index 1a557c72de9d2317fb64921f3ca3806be104cea7..c78fbc0ae58f60e0de70af2ee03636af38b21b30 100644 (file)
@@ -498,7 +498,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
             sun_pixels=(unsigned char *) RelinquishMagickMemory(sun_pixels);
             ThrowReaderException(ResourceLimitError,"ImproperImageHeader");
           }
-        (void) CopyMagickMemory(sun_pixels,sun_data,sun_info.length);
+        (void) memcpy(sun_pixels,sun_data,sun_info.length);
       }
     sun_data=(unsigned char *) RelinquishMagickMemory(sun_data);
     /*
index 5f1b61b3ddd34de4883ecbd8d88fa5ea1da0f045..4ae349775eca4637b804a2b84f5324453d57d76f 100644 (file)
@@ -365,7 +365,7 @@ static void StripStyleTokens(char *message)
   q=message+length-1;
   while ((isspace((int) ((unsigned char) *q)) != 0) && (q > p))
     q--;
-  (void) CopyMagickMemory(message,p,(size_t) (q-p+1));
+  (void) memcpy(message,p,(size_t) (q-p+1));
   message[q-p+1]='\0';
   StripString(message);
 }
index e194736d91c3f08bd76128cda6c2a26a86dea3e3..f9796b5f305e5ba0a27908174c0d3321b1e108c5 100644 (file)
@@ -3006,7 +3006,7 @@ static int32 TIFFWritePixels(TIFF *tiff,TIFFInfo *tiff_info,ssize_t row,
     Fill scanlines to tile height.
   */
   i=(ssize_t) (row % tiff_info->tile_geometry.height)*TIFFScanlineSize(tiff);
-  (void) CopyMagickMemory(tiff_info->scanlines+i,(char *) tiff_info->scanline,
+  (void) memcpy(tiff_info->scanlines+i,(char *) tiff_info->scanline,
     (size_t) TIFFScanlineSize(tiff));
   if (((size_t) (row % tiff_info->tile_geometry.height) !=
       (tiff_info->tile_geometry.height-1)) &&