[Waba-commits] CVS: waba/vm/toppers nmtoppers_c.c,1.1.2.1,1.1.2.2
Status: Abandoned
Brought to you by:
bornet
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:35:58
|
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv25193 Modified Files: Tag: WABAJTRON-branch nmtoppers_c.c Log Message: Appended some functions for waba/sys/Convert.toString Index: nmtoppers_c.c =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_c.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** nmtoppers_c.c 2001/08/13 13:42:37 1.1.2.1 --- nmtoppers_c.c 2001/09/02 05:35:56 1.1.2.2 *************** *** 18,22 **** #include "guimgl.h" #endif ! #include "waba.h" Var Return0Func(Var stack[]) --- 18,22 ---- #include "guimgl.h" #endif ! #include "../waba.h" Var Return0Func(Var stack[]) *************** *** 207,210 **** --- 207,256 ---- return v; } + + + #ifdef WITH_64BITS + + /* implementation of native waba/sys/Convert.toString(long l) */ + Var ConvertLongToString( Var stack[] ) { + Var v; + char buf[30]; + + sprintf( buf, "%lld", vars2int64( stack )); + + v.obj = createString(buf); + return v; + } + + /* implementation of native waba/sys/Convert.toString(double d) */ + Var ConvertDoubleToString( Var stack[] ) { + Var v; + char buf[40]; + // int len; + + sprintf(buf, "%lf", vars2double( stack )); + + v.obj = createString(buf); + return v; + } + + #else + + /* implementation of native waba/sys/Convert.toString(long l) : not supported */ + Var ConvertLongToString( Var stack[] ) { + Var v; + + v.obj = 0; + return v; + } + + /* implementation of native waba/sys/Convert.toString(double d) : not supported */ + Var ConvertDoubleToString( Var stack[] ) { + Var v; + + v.obj = 0; + return v; + } + + #endif /* ifdef WITH_64BITS ... else */ Var ConvertCharToString(Var stack[]) |