pkgsrc/graphics/gimp-rawphoto/patches/patch-ab

46 lines
1.3 KiB
Text

$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;