Author Thibaut Paumard <paumard@users.sourceforge.net>
Forwarded: yes
Last-Update: 2010-03-07
Description: not all round() implementations return a long

--- a/curses.i
+++ b/curses.i
@@ -17,6 +17,8 @@
  * Mass Ave, Cambridge, MA 02139, USA).
 */
 
+#include "utils.i"
+
 func curses{}
 /* DOCUMENT curses package
    The curses plugin wraps some of the curses routine, hopefully enough
@@ -236,7 +238,7 @@
   cerase;
   tic;
   while ((elapsed=tac()) < sec) {
-    el = round(elapsed);
+    el = long(round(elapsed));
     cmvprintw,0,0,"[%-"+swrite(format="%s",sec)+"s]",((el==0)?"":array("*",el)(sum));
     cmvprintw,0,sec+3,"Time remaining: %s sec",swrite(format="%.3f",sec-elapsed);
     cclrtobot;
@@ -257,7 +259,7 @@
   if (line==[]) line=0;
   nc = cgetcols();
 
-  el = round(current*1./outof*nstars);
+  el = long(round(current*1./outof*nstars));
   cmvprintw,line,nc-nstars-2,"[%-"+swrite(format="%d",nstars)+"s]",
     ((el==0)?"":array("*",el)(sum));
 
