]> granicus.if.org Git - imagemagick/blobdiff - magick/xwindow.c
(no commit message)
[imagemagick] / magick / xwindow.c
index 15d6230775222d4991591f4a62887d8c7ea9d42d..3f22290eebc73fe42732dd05fa2f670ad1d4ba81 100644 (file)
@@ -17,7 +17,7 @@
 %                                  July 1992                                  %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -1945,18 +1945,18 @@ MagickExport void XDisplayImageInfo(Display *display,
   int
     unique_file;
 
-  ssize_t
-    bytes;
-
   register ssize_t
     i;
 
-  unsigned int
-    levels;
-
   size_t
     number_pixels;
 
+  ssize_t
+    bytes;
+
+  unsigned int
+    levels;
+
   /*
     Write info about the X server to a file.
   */
@@ -2759,7 +2759,10 @@ MagickExport void XFreeResources(Display *display,XVisualInfo *visual_info,
     Free font.
   */
   if (font_info != (XFontStruct *) NULL)
-    (void) XFreeFont(display,font_info);
+    {
+      (void) XFreeFont(display,font_info);
+      font_info=(XFontStruct *) NULL;
+    }
   if (map_info != (XStandardColormap *) NULL)
     {
       /*
@@ -3197,8 +3200,7 @@ MagickExport void XGetPixelPacket(Display *display,
             Initialize pixel array for images of type PseudoClass.
           */
           for (i=0; i < (ssize_t) image->colors; i++)
-            pixel->pixels[i]=
-              XGammaPixel(map_info,image->colormap+i);
+            pixel->pixels[i]=XGammaPixel(map_info,image->colormap+i);
           for (i=0; i < MaxNumberPens; i++)
             pixel->pixels[image->colors+i]=pixel->pen_colors[i].pixel;
           pixel->colors+=MaxNumberPens;
@@ -3437,7 +3439,7 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info,
   XrmDatabase database,const char *client_name,XResourceInfo *resource_info)
 {
   char
-    *cwd,
+    *directory,
     *resource_value;
 
   /*
@@ -3462,7 +3464,8 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info,
     "borderColor",BorderColor);
   resource_value=XGetResourceClass(database,client_name,"borderWidth",
     (char *) "2");
-  resource_info->border_width=(unsigned int) StringToUnsignedLong(resource_value);
+  resource_info->border_width=(unsigned int) StringToUnsignedLong(
+    resource_value);
   resource_value=XGetResourceClass(database,client_name,"colormap",
     (char *) "shared");
   resource_info->colormap=UndefinedColormap;
@@ -3524,9 +3527,10 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info,
     client_name,"geometry",(char *) NULL));
   resource_value=XGetResourceClass(database,client_name,"gravity",
     (char *) "Center");
-  resource_info->gravity=(GravityType) ParseMagickOption(MagickGravityOptions,
+  resource_info->gravity=(GravityType) ParseCommandOption(MagickGravityOptions,
     MagickFalse,resource_value);
-  cwd=getcwd(resource_info->home_directory,MaxTextExtent);
+  directory=getcwd(resource_info->home_directory,MaxTextExtent);
+  (void) directory;
   resource_info->icon_geometry=XGetResourceClass(database,client_name,
     "iconGeometry",(char *) NULL);
   resource_value=XGetResourceClass(database,client_name,"iconic",
@@ -6380,7 +6384,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
         for (x=(int) canvas->columns-1; x >= 0; x--)
         {
           byte>>=1;
-          if (p->opacity > (QuantumRange/2))
+          if (GetOpacityPixelComponent(p) > (QuantumRange/2))
             byte|=0x80;
           bit++;
           if (bit == 8)
@@ -7007,7 +7011,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info,
         for (x=(int) canvas->columns-1; x >= 0; x--)
         {
           byte<<=1;
-          if (p->opacity > (QuantumRange/2))
+          if (GetOpacityPixelComponent(p) > (QuantumRange/2))
             byte|=0x01;
           bit++;
           if (bit == 8)
@@ -7061,9 +7065,6 @@ MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows)
   int
     y;
 
-  ssize_t
-    n;
-
   MagickPixelPacket
     pixel;
 
@@ -7077,6 +7078,9 @@ MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows)
     *p,
     *q;
 
+  ssize_t
+    n;
+
   static unsigned int
     previous_magnify = 0;