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.
This commit is contained in:
Tor Lillqvist
1999-08-16 19:33:35 +00:00
parent 2c206a4840
commit 97346fb110
7 changed files with 45 additions and 19 deletions

View File

@ -1,3 +1,14 @@
1999-08-16 Tor Lillqvist <tml@iki.fi>
* 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) Mon Aug 16 03:46:43 1999 Jay Cox (jaycox@earthlink.net)
* app/transform_core.c: put the gimp_matrix_is_simple * app/transform_core.c: put the gimp_matrix_is_simple

View File

@ -39,7 +39,6 @@ GCG = ..\tools\gcg\gcg -I. -I ..\tools\gcg\gh
all : \ all : \
..\config.h \ ..\config.h \
..\libgimp\gimpfeatures.h \
gimpim.lib \ gimpim.lib \
colormap_dialog.c \ colormap_dialog.c \
gimp.exe gimp.exe
@ -50,9 +49,6 @@ install : gimp.exe
..\config.h : ..\config.h.win32 ..\config.h : ..\config.h.win32
copy ..\config.h.win32 $@ copy ..\config.h.win32 $@
..\libgimp\gimpfeatures.h : ..\libgimp\gimpfeatures.h.win32
copy ..\libgimp\gimpfeatures.h.win32 $@
gimpim_OBJECTS = \ gimpim_OBJECTS = \
gimpdrawable.obj\ gimpdrawable.obj\
gimpimage.obj \ gimpimage.obj \

View File

@ -1329,7 +1329,7 @@ transform_core_do (GImage *gimage,
else else
{ {
a_recip = 1.0 / a_val; a_recip = 1.0 / a_val;
d[alpha] = rint(a_val); d[alpha] = RINT(a_val);
} }
/* for colour channels c, /* for colour channels c,
@ -1337,7 +1337,7 @@ transform_core_do (GImage *gimage,
*/ */
for (i = -alpha; i < 0; ++i) { for (i = -alpha; i < 0; ++i) {
start = &data[alpha]; 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, bytes, i),
CUBIC_SCALED_ROW (dx, start + row, bytes, i), CUBIC_SCALED_ROW (dx, start + row, bytes, i),
CUBIC_SCALED_ROW (dx, start + row + row, bytes, i), CUBIC_SCALED_ROW (dx, start + row + row, bytes, i),
@ -1401,7 +1401,7 @@ transform_core_do (GImage *gimage,
d[alpha] = 255; d[alpha] = 255;
} else { } else {
a_recip = 1.0 / a_val; a_recip = 1.0 / a_val;
d[alpha] = rint(a_val); d[alpha] = RINT(a_val);
} }
/* for colour channels c, /* for colour channels c,
@ -1409,7 +1409,7 @@ transform_core_do (GImage *gimage,
*/ */
for (i = -alpha; i < 0; ++i) { for (i = -alpha; i < 0; ++i) {
chan = &data[alpha]; chan = &data[alpha];
newval = rint(a_recip * newval = RINT(a_recip *
BILINEAR (chan[0] * chan[i], BILINEAR (chan[0] * chan[i],
chan[bytes] * chan[bytes+i], chan[bytes] * chan[bytes+i],
chan[row] * chan[row+i], chan[row] * chan[row+i],
@ -1438,8 +1438,8 @@ transform_core_do (GImage *gimage,
} }
else /* no interpolation */ else /* no interpolation */
{ {
itx = rint(ttx); itx = RINT(ttx);
ity = rint(tty); ity = RINT(tty);
if (itx >= x1 && itx < x2 && if (itx >= x1 && itx < x2 &&
ity >= y1 && ity < y2 ) ity >= y1 && ity < y2 )

View File

@ -1329,7 +1329,7 @@ transform_core_do (GImage *gimage,
else else
{ {
a_recip = 1.0 / a_val; a_recip = 1.0 / a_val;
d[alpha] = rint(a_val); d[alpha] = RINT(a_val);
} }
/* for colour channels c, /* for colour channels c,
@ -1337,7 +1337,7 @@ transform_core_do (GImage *gimage,
*/ */
for (i = -alpha; i < 0; ++i) { for (i = -alpha; i < 0; ++i) {
start = &data[alpha]; 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, bytes, i),
CUBIC_SCALED_ROW (dx, start + row, bytes, i), CUBIC_SCALED_ROW (dx, start + row, bytes, i),
CUBIC_SCALED_ROW (dx, start + row + row, bytes, i), CUBIC_SCALED_ROW (dx, start + row + row, bytes, i),
@ -1401,7 +1401,7 @@ transform_core_do (GImage *gimage,
d[alpha] = 255; d[alpha] = 255;
} else { } else {
a_recip = 1.0 / a_val; a_recip = 1.0 / a_val;
d[alpha] = rint(a_val); d[alpha] = RINT(a_val);
} }
/* for colour channels c, /* for colour channels c,
@ -1409,7 +1409,7 @@ transform_core_do (GImage *gimage,
*/ */
for (i = -alpha; i < 0; ++i) { for (i = -alpha; i < 0; ++i) {
chan = &data[alpha]; chan = &data[alpha];
newval = rint(a_recip * newval = RINT(a_recip *
BILINEAR (chan[0] * chan[i], BILINEAR (chan[0] * chan[i],
chan[bytes] * chan[bytes+i], chan[bytes] * chan[bytes+i],
chan[row] * chan[row+i], chan[row] * chan[row+i],
@ -1438,8 +1438,8 @@ transform_core_do (GImage *gimage,
} }
else /* no interpolation */ else /* no interpolation */
{ {
itx = rint(ttx); itx = RINT(ttx);
ity = rint(tty); ity = RINT(tty);
if (itx >= x1 && itx < x2 && if (itx >= x1 && itx < x2 &&
ity >= y1 && ity < y2 ) ity >= y1 && ity < y2 )

View File

@ -2052,7 +2052,7 @@ static void
bender_swap_callback (GtkWidget *widget, bender_swap_callback (GtkWidget *widget,
gpointer client_data) 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; BenderDialog *cd;
int i; int i;
int other; int other;
@ -2212,7 +2212,7 @@ bender_load_callback (GtkWidget *w,
if(cd->filesel != NULL) if(cd->filesel != NULL)
return; /* filesel is already open */ 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; cd->filesel = filesel;
gtk_window_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_window_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);

View File

@ -393,6 +393,10 @@ EXTRALIBS = user32.lib
EXTRALIBS = user32.lib gdi32.lib comdlg32.lib EXTRALIBS = user32.lib gdi32.lib comdlg32.lib
!endif !endif
!IFDEF EXTRA_winclipboard
EXTRALIBS = user32.lib
!endif
!IFDEF EXTRA_winsnap !IFDEF EXTRA_winsnap
HAVE_RESOURCE = YES HAVE_RESOURCE = YES
EXTRALIBS = user32.lib gdi32.lib EXTRALIBS = user32.lib gdi32.lib

View File

@ -30,13 +30,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
spline_type spline_type
new_spline () new_spline ()
{ {
real_coordinate_type coord = { -100.0, -100.0 };
spline_type spline; spline_type spline;
START_POINT (spline) START_POINT (spline)
= CONTROL1 (spline) = CONTROL1 (spline)
= CONTROL2 (spline) = CONTROL2 (spline)
= END_POINT (spline) = END_POINT (spline)
= (real_coordinate_type) { -100.0, -100.0 }; = coord;
SPLINE_DEGREE (spline) = -1; SPLINE_DEGREE (spline) = -1;
return spline; return spline;
@ -84,9 +85,23 @@ evaluate_spline (spline_type s, real t)
for (j = 1; j <= degree; j++) for (j = 1; j <= degree; j++)
for (i = 0; i <= degree - j; i++) 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 t1 = Pmult_scalar (V[j - 1].v[i], one_minus_t);
real_coordinate_type t2 = Pmult_scalar (V[j - 1].v[i + 1], t); real_coordinate_type t2 = Pmult_scalar (V[j - 1].v[i + 1], t);
V[j].v[i] = Padd (t1, t2); 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]; return V[degree].v[0];