changeset 95167:cf2e8e539693

(x_set_frame_alpha): Move declarations before statements.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 21 May 2008 06:32:45 +0000
parents faf8a1255ff9
children a031e38a88d4
files src/ChangeLog src/xterm.c
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed May 21 04:08:45 2008 +0000
+++ b/src/ChangeLog	Wed May 21 06:32:45 2008 +0000
@@ -1,3 +1,8 @@
+2008-05-21  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* xterm.c (x_set_frame_alpha): Move declarations before
+	statements.
+
 2008-05-21  Seiji Zenitani  <zenitani@mac.com>
 	    Ryo Yoshitake  <ryo@shiftmode.net>
 
--- a/src/xterm.c	Wed May 21 04:08:45 2008 +0000
+++ b/src/xterm.c	Wed May 21 06:32:45 2008 +0000
@@ -467,13 +467,15 @@
   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   Display *dpy = FRAME_X_DISPLAY (f);
   Window win = FRAME_OUTER_WINDOW (f);
+  double alpha = 1.0;
+  double alpha_min = 1.0;
+  unsigned int opac;
+  
   if (FRAME_X_DISPLAY_INFO (f)->root_window != FRAME_X_OUTPUT (f)->parent_desc)
     /* Since the WM decoration lies under the FRAME_OUTER_WINDOW,
        we must treat the former instead of the latter. */
     win = FRAME_X_OUTPUT(f)->parent_desc;
 
-  double alpha = 1.0, alpha_min = 1.0;
-
   if (dpyinfo->x_highlight_frame == f)
     alpha = f->alpha[0];
   else
@@ -489,7 +491,7 @@
   else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0)
     alpha = alpha_min;
 
-  unsigned int opac = (unsigned int)(alpha * OPAQUE);
+  opac = (unsigned int)(alpha * OPAQUE);
 
   /* return unless necessary */
   {
@@ -508,9 +510,7 @@
 	  return;
 	}
       else
-       {
-	  XFree ((void *) data);
-       }
+	XFree ((void *) data);
   }
 
   XChangeProperty (dpy, win, XInternAtom (dpy, OPACITY, False),