From 97346fb11068b0a9f3c034cce58356c05c576133 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 16 Aug 1999 19:33:35 +0000 Subject: [PATCH] Use RINT instead of rint. * app/transform_core.c: Use RINT instead of rint. * plug-ins/common/curve_bend.c * plug-ins/sel2path/spline.c: Workarounds for gccisms, thanks to Hans Breuer. * app/makefile.msc * plug-ins/makefile.msc: Misc fixes. --- ChangeLog | 11 +++++++++++ app/makefile.msc | 4 ---- app/tools/transform_core.c | 12 ++++++------ app/transform_core.c | 12 ++++++------ plug-ins/common/curve_bend.c | 4 ++-- plug-ins/makefile.msc | 4 ++++ plug-ins/sel2path/spline.c | 17 ++++++++++++++++- 7 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78db4153c0..b8bdef5b72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +1999-08-16 Tor Lillqvist + + * app/transform_core.c: Use RINT instead of rint. + + * plug-ins/common/curve_bend.c + * plug-ins/sel2path/spline.c: Workarounds for gccisms, thanks to + Hans Breuer. + + * app/makefile.msc + * plug-ins/makefile.msc: Misc fixes. + Mon Aug 16 03:46:43 1999 Jay Cox (jaycox@earthlink.net) * app/transform_core.c: put the gimp_matrix_is_simple diff --git a/app/makefile.msc b/app/makefile.msc index 5bec46e72c..08a439196b 100644 --- a/app/makefile.msc +++ b/app/makefile.msc @@ -39,7 +39,6 @@ GCG = ..\tools\gcg\gcg -I. -I ..\tools\gcg\gh all : \ ..\config.h \ - ..\libgimp\gimpfeatures.h \ gimpim.lib \ colormap_dialog.c \ gimp.exe @@ -50,9 +49,6 @@ install : gimp.exe ..\config.h : ..\config.h.win32 copy ..\config.h.win32 $@ -..\libgimp\gimpfeatures.h : ..\libgimp\gimpfeatures.h.win32 - copy ..\libgimp\gimpfeatures.h.win32 $@ - gimpim_OBJECTS = \ gimpdrawable.obj\ gimpimage.obj \ diff --git a/app/tools/transform_core.c b/app/tools/transform_core.c index cb021cb13b..bf76c8dbd5 100644 --- a/app/tools/transform_core.c +++ b/app/tools/transform_core.c @@ -1329,7 +1329,7 @@ transform_core_do (GImage *gimage, else { a_recip = 1.0 / a_val; - d[alpha] = rint(a_val); + d[alpha] = RINT(a_val); } /* for colour channels c, @@ -1337,7 +1337,7 @@ transform_core_do (GImage *gimage, */ for (i = -alpha; i < 0; ++i) { start = &data[alpha]; - newval = rint(a_recip * cubic (dy, + newval = RINT(a_recip * cubic (dy, CUBIC_SCALED_ROW (dx, start, bytes, i), CUBIC_SCALED_ROW (dx, start + row, bytes, i), CUBIC_SCALED_ROW (dx, start + row + row, bytes, i), @@ -1401,7 +1401,7 @@ transform_core_do (GImage *gimage, d[alpha] = 255; } else { a_recip = 1.0 / a_val; - d[alpha] = rint(a_val); + d[alpha] = RINT(a_val); } /* for colour channels c, @@ -1409,7 +1409,7 @@ transform_core_do (GImage *gimage, */ for (i = -alpha; i < 0; ++i) { chan = &data[alpha]; - newval = rint(a_recip * + newval = RINT(a_recip * BILINEAR (chan[0] * chan[i], chan[bytes] * chan[bytes+i], chan[row] * chan[row+i], @@ -1438,8 +1438,8 @@ transform_core_do (GImage *gimage, } else /* no interpolation */ { - itx = rint(ttx); - ity = rint(tty); + itx = RINT(ttx); + ity = RINT(tty); if (itx >= x1 && itx < x2 && ity >= y1 && ity < y2 ) diff --git a/app/transform_core.c b/app/transform_core.c index cb021cb13b..bf76c8dbd5 100644 --- a/app/transform_core.c +++ b/app/transform_core.c @@ -1329,7 +1329,7 @@ transform_core_do (GImage *gimage, else { a_recip = 1.0 / a_val; - d[alpha] = rint(a_val); + d[alpha] = RINT(a_val); } /* for colour channels c, @@ -1337,7 +1337,7 @@ transform_core_do (GImage *gimage, */ for (i = -alpha; i < 0; ++i) { start = &data[alpha]; - newval = rint(a_recip * cubic (dy, + newval = RINT(a_recip * cubic (dy, CUBIC_SCALED_ROW (dx, start, bytes, i), CUBIC_SCALED_ROW (dx, start + row, bytes, i), CUBIC_SCALED_ROW (dx, start + row + row, bytes, i), @@ -1401,7 +1401,7 @@ transform_core_do (GImage *gimage, d[alpha] = 255; } else { a_recip = 1.0 / a_val; - d[alpha] = rint(a_val); + d[alpha] = RINT(a_val); } /* for colour channels c, @@ -1409,7 +1409,7 @@ transform_core_do (GImage *gimage, */ for (i = -alpha; i < 0; ++i) { chan = &data[alpha]; - newval = rint(a_recip * + newval = RINT(a_recip * BILINEAR (chan[0] * chan[i], chan[bytes] * chan[bytes+i], chan[row] * chan[row+i], @@ -1438,8 +1438,8 @@ transform_core_do (GImage *gimage, } else /* no interpolation */ { - itx = rint(ttx); - ity = rint(tty); + itx = RINT(ttx); + ity = RINT(tty); if (itx >= x1 && itx < x2 && ity >= y1 && ity < y2 ) diff --git a/plug-ins/common/curve_bend.c b/plug-ins/common/curve_bend.c index e56227464a..d5bcaa0c80 100644 --- a/plug-ins/common/curve_bend.c +++ b/plug-ins/common/curve_bend.c @@ -2052,7 +2052,7 @@ static void bender_swap_callback (GtkWidget *widget, gpointer client_data) { -#define SWAP_VALUE(a, b, h) ({ h=a; a=b; b=h; }) +#define SWAP_VALUE(a, b, h) { h=a; a=b; b=h; } BenderDialog *cd; int i; int other; @@ -2212,7 +2212,7 @@ bender_load_callback (GtkWidget *w, if(cd->filesel != NULL) return; /* filesel is already open */ - filesel = gtk_file_selection_new ("Save Curve Points to file"); + filesel = gtk_file_selection_new ("Load Curve Points from file"); cd->filesel = filesel; gtk_window_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); diff --git a/plug-ins/makefile.msc b/plug-ins/makefile.msc index 0a257d22df..bd2cac280f 100644 --- a/plug-ins/makefile.msc +++ b/plug-ins/makefile.msc @@ -393,6 +393,10 @@ EXTRALIBS = user32.lib EXTRALIBS = user32.lib gdi32.lib comdlg32.lib !endif +!IFDEF EXTRA_winclipboard +EXTRALIBS = user32.lib +!endif + !IFDEF EXTRA_winsnap HAVE_RESOURCE = YES EXTRALIBS = user32.lib gdi32.lib diff --git a/plug-ins/sel2path/spline.c b/plug-ins/sel2path/spline.c index af8bef9530..e620c18028 100644 --- a/plug-ins/sel2path/spline.c +++ b/plug-ins/sel2path/spline.c @@ -30,13 +30,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ spline_type new_spline () { + real_coordinate_type coord = { -100.0, -100.0 }; spline_type spline; START_POINT (spline) = CONTROL1 (spline) = CONTROL2 (spline) = END_POINT (spline) - = (real_coordinate_type) { -100.0, -100.0 }; + = coord; SPLINE_DEGREE (spline) = -1; return spline; @@ -84,9 +85,23 @@ evaluate_spline (spline_type s, real t) for (j = 1; j <= degree; j++) for (i = 0; i <= degree - j; i++) { +#if defined (__GNUC__) real_coordinate_type t1 = Pmult_scalar (V[j - 1].v[i], one_minus_t); real_coordinate_type t2 = Pmult_scalar (V[j - 1].v[i + 1], t); V[j].v[i] = Padd (t1, t2); +#else + /* //HB: the above is really nice, but is there any other compiler + * supporting this ?? + */ + real_coordinate_type t1; + real_coordinate_type t2; + t1.x = V[j - 1].v[i].x * one_minus_t; + t1.y = V[j - 1].v[i].y * one_minus_t; + t2.x = V[j - 1].v[i + 1].x * t; + t2.y = V[j - 1].v[i + 1].y * t; + V[j].v[i].x = t1.x + t2.x; + V[j].v[i].y = t1.y + t2.y; +#endif } return V[degree].v[0];