summaryrefslogtreecommitdiff
path: root/graphics/gimp-rawphoto/patches/patch-ab
blob: 4e63e809a8f6645efb2894917eddd090d0efe921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$NetBSD: patch-ab,v 1.1 2005/03/16 11:45:24 rillig Exp $

gcc-2.95.3 does not like code intermixed with declarations.

--- rawphoto.c.orig	Fri Oct 22 09:28:08 2004
+++ rawphoto.c	Wed Mar 16 10:43:15 2005
@@ -552,11 +552,12 @@ expose_histogram_event( GtkWidget *widge
 
 void plotHistogram( void )
 {
-	gint w,h;
+	gint w, h, max_val, bottom, top, middle, r, g, b;
 	guint32 i,j;
 
 	GdkGC *gc;
 	GdkColor color;
+	GdkRectangle update_rect;
 
 	gc = gdk_gc_new (histoPixmap);
 	color.red = color.green = color.blue = 32768;
@@ -566,7 +567,7 @@ void plotHistogram( void )
 	h = histo->allocation.height;
 
 	/* Find biggest bin for normalizing */
-	gint max_val = 0;
+	max_val = 0;
 	for ( i=0 ; i < 3; i++ )
 		for ( j=0 ; j < RGBHISTLEN; j++ )
 			max_val = MAX(histogramRGB[i][j], max_val);
@@ -589,8 +590,6 @@ void plotHistogram( void )
 	printf("Max value: %d\n", max_val);
 
 	/* Draw histogram bars */
-	gint bottom, top, middle;
-	gint r,g,b;
 	for ( i=0 ; i < RGBHISTLEN; i++ ) {
 		r = histogramRGB[0][i];
 		g = histogramRGB[1][i];
@@ -648,7 +647,6 @@ void plotHistogram( void )
 	for(i=w/5; i<(w-w/5); i+=(w/5)) DRAW_BAR(0,max_val);
 	
 	/* Notify GTK that the widget needs to be redrawn (via an expose) */
-	GdkRectangle update_rect;
 	update_rect.x = 0;
 	update_rect.y = 0;
 	update_rect.width = HISTOGRAM_WIDTH;