[TextEditor_mcc] Floating point usage in mcc/HandleInput.c

  • From: Gunther Nikl <gni@xxxxxxxx>
  • To: texteditor_mcc@xxxxxxxxxxxxx
  • Date: Mon, 6 Jun 2005 15:25:44 +0200

Hello Jens,
One of your recent changes to the mcc does a floating point calculation.
On m68k thats bad because that means using the IEEE math libraries and
we all know that these libraries can't be shared among different users,
right? ;-) FWIW, I don't think there is the need to use a floating point
calculation at all. I suggest to apply the appended patch.

Gunther

-- 
Linux is only free if your time has no value
 - Jamie Zawinski


-- Attached file included as plaintext by Ecartis --

Index: HandleInput.c
===================================================================
RCS file: /cvsroot/texteditor-mcc/mcc/HandleInput.c,v
retrieving revision 1.10
diff -u -p -r1.10 HandleInput.c
--- HandleInput.c       4 Jun 2005 15:55:55 -0000       1.10
+++ HandleInput.c       6 Jun 2005 13:18:48 -0000
@@ -135,7 +135,7 @@ ULONG HandleInput(struct IClass *cl, Obj
                                        if(visible > 0)
                                        {
                                                    // we scroll 1/6 of the 
displayed text by default
-                                               LONG delta = 
((((double)visible)/6.0)+0.5); // round the value
+                                               LONG delta = (visible + 5) / 6;
 
                                                // make sure that we scroll at 
least 1 line
                                                if(delta < 1) delta = 1;
Index: Makefile.os3
===================================================================
RCS file: /cvsroot/texteditor-mcc/mcc/Makefile.os3,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile.os3
--- Makefile.os3        28 May 2005 17:40:47 -0000      1.3
+++ Makefile.os3        6 Jun 2005 13:18:48 -0000
@@ -40,7 +40,7 @@ OPTFLAGS = -O3 -fomit-frame-pointer -fun
 DEBUG    = -DDEBUG -g -O0
 CFLAGS   = -noixemul -I. -I../mcp -I../includes -c $(CPU) $(WARN) $(OPTFLAGS) 
$(DEBUG)
 LDFLAGS  = -noixemul -nostartfiles $(CPU)
-LDLIBS   = -lmui -ldebug -lm
+LDLIBS   = -lmui -ldebug
 
 # CPU and DEBUG can be defined outside, defaults to above
 # using e.g. "make DEBUG= CPU=-m68060" produces optimized non-debug 68060 
version


_____________________________________________________________________________
TextEditor ML   - //www.freelists.org/list/texteditor_mcc
Listserver help - mailto:texteditor_mcc-request@xxxxxxxxxxxxx?Subject=HELP
Bugtracker......: http://sourceforge.net/tracker/?atid=731469&group_id=135025

Other related posts: