From fe38540ca294adb6d1cf2135f2336223313085f7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 20 Feb 2010 11:57:17 +0000 Subject: [PATCH] 2010-02-20 12:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbsetup.ch * src/common/hbverdsp.c - Deleted HB_COMPAT_FLAGSHIP, HB_COMPAT_FOXPRO. * include/hbextern.ch * src/rtl/seconds.c + Added HB_SECONDSCPU() (native Harbour version of FlagShip specific SECONDSCPU()) * tests/memtst.prg * tests/speedold.prg * tests/speedtst.prg * tests/vidtest.prg * Changed to use HB_SECONDSCPU(). + Added translation from SECONDSCPU() to HB_SECONDSCPU() when built for FlagShip (where applicable). * include/hbextern.ch * src/rtl/Makefile - src/rtl/strpeek.c - src/rtl/secondfs.c * contrib/Makefile + contrib/hbfship + contrib/hbfship/Makefile + contrib/hbfship/hbfship.hbc + contrib/hbfship/secondfs.c + contrib/hbfship/strpeek.c - Moved FlagShip specific function from core to new hbfship lib. * Changed SECONDSCPU() to be just a wrapper over core HB_SECONDSCPU(). ; INCOMPATIBLE: If you used SECONDSCPU() function, change it to HB_SECONDSCPU(), or add hbfship to your lib list. If you used STRPEEK() or STRPOKE() functions, add hbfship to your lib list. * utils/hbmk2/examples/contribf.hbc + Added hbfship. --- harbour/ChangeLog | 40 ++++++- harbour/contrib/Makefile | 1 + harbour/contrib/hbfship/Makefile | 18 +++ harbour/contrib/hbfship/hbfship.hbc | 7 ++ .../{src/rtl => contrib/hbfship}/secondfs.c | 7 +- .../{src/rtl => contrib/hbfship}/strpeek.c | 4 - harbour/include/hbextern.ch | 11 +- harbour/include/hbsetup.ch | 5 +- harbour/src/common/hbverdsp.c | 8 +- harbour/src/rtl/Makefile | 2 - harbour/src/rtl/seconds.c | 6 + harbour/tests/memtst.prg | 12 +- harbour/tests/speedold.prg | 110 +++++++++--------- harbour/tests/speedtst.prg | 13 ++- harbour/tests/vidtest.prg | 20 ++-- harbour/utils/hbmk2/examples/contribf.hbc | 2 +- 16 files changed, 157 insertions(+), 109 deletions(-) create mode 100644 harbour/contrib/hbfship/Makefile create mode 100644 harbour/contrib/hbfship/hbfship.hbc rename harbour/{src/rtl => contrib/hbfship}/secondfs.c (95%) rename harbour/{src/rtl => contrib/hbfship}/strpeek.c (98%) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8ca74b2044..38518c06f7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,44 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-20 12:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbsetup.ch + * src/common/hbverdsp.c + - Deleted HB_COMPAT_FLAGSHIP, HB_COMPAT_FOXPRO. + + * include/hbextern.ch + * src/rtl/seconds.c + + Added HB_SECONDSCPU() + (native Harbour version of FlagShip specific SECONDSCPU()) + + * tests/memtst.prg + * tests/speedold.prg + * tests/speedtst.prg + * tests/vidtest.prg + * Changed to use HB_SECONDSCPU(). + + Added translation from SECONDSCPU() to HB_SECONDSCPU() when + built for FlagShip (where applicable). + + * include/hbextern.ch + * src/rtl/Makefile + - src/rtl/strpeek.c + - src/rtl/secondfs.c + * contrib/Makefile + + contrib/hbfship + + contrib/hbfship/Makefile + + contrib/hbfship/hbfship.hbc + + contrib/hbfship/secondfs.c + + contrib/hbfship/strpeek.c + - Moved FlagShip specific function from core to new hbfship lib. + * Changed SECONDSCPU() to be just a wrapper over core HB_SECONDSCPU(). + ; INCOMPATIBLE: If you used SECONDSCPU() function, change it to + HB_SECONDSCPU(), or add hbfship to your lib list. + If you used STRPEEK() or STRPOKE() functions, + add hbfship to your lib list. + + * utils/hbmk2/examples/contribf.hbc + + Added hbfship. + 2010-02-20 12:00 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/common/hbverdsp.c * include/hbsetup.ch @@ -138,7 +176,7 @@ * Synced contrib/xpp compatibility lib source with core. - Deleted Xbase++ compatibility functions from core. ; NOTE: INCOMPATIBLE. If you use Xbase++ function, you should now link - xpp lib. (the name of the lib is not yet finalized) + xpp lib. (the name of the lib is not yet finalized) [DONE] ; TODO: Clean remaining four HB_COMPAT_XPP guards and delete this build-time option from core. [DONE] diff --git a/harbour/contrib/Makefile b/harbour/contrib/Makefile index 00d5be88d0..e32b721239 100644 --- a/harbour/contrib/Makefile +++ b/harbour/contrib/Makefile @@ -10,6 +10,7 @@ DIRS := \ hbbtree \ hbclipsm \ hbct \ + hbfship \ hbgt \ hbmemio \ hbmisc \ diff --git a/harbour/contrib/hbfship/Makefile b/harbour/contrib/hbfship/Makefile new file mode 100644 index 0000000000..a4e6cf8a8b --- /dev/null +++ b/harbour/contrib/hbfship/Makefile @@ -0,0 +1,18 @@ +# +# $Id$ +# + +ROOT := ../../ + +include $(TOP)$(ROOT)config/global.mk + +LIBNAME := hbfship + +C_SOURCES := \ + secondfs.c \ + strpeek.c \ + +PRG_SOURCES := \ + +include $(TOP)$(ROOT)config/header.mk +include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/hbfship/hbfship.hbc b/harbour/contrib/hbfship/hbfship.hbc new file mode 100644 index 0000000000..d59bed7c8e --- /dev/null +++ b/harbour/contrib/hbfship/hbfship.hbc @@ -0,0 +1,7 @@ +# +# $Id$ +# + +incpaths=. + +libs=hbfship diff --git a/harbour/src/rtl/secondfs.c b/harbour/contrib/hbfship/secondfs.c similarity index 95% rename from harbour/src/rtl/secondfs.c rename to harbour/contrib/hbfship/secondfs.c index 0ddd23ee51..a58e629ef0 100644 --- a/harbour/src/rtl/secondfs.c +++ b/harbour/contrib/hbfship/secondfs.c @@ -51,13 +51,10 @@ */ #include "hbapi.h" -#include "hbdate.h" -#ifdef HB_COMPAT_FLAGSHIP +HB_FUNC_EXTERN( HB_SECONDSCPU ); HB_FUNC( SECONDSCPU ) { - hb_retnd( hb_secondsCPU( hb_parni( 1 ) ) ); + HB_FUNC_EXEC( HB_SECONDSCPU ); } - -#endif diff --git a/harbour/src/rtl/strpeek.c b/harbour/contrib/hbfship/strpeek.c similarity index 98% rename from harbour/src/rtl/strpeek.c rename to harbour/contrib/hbfship/strpeek.c index 85920f1a0a..d727cb3615 100644 --- a/harbour/src/rtl/strpeek.c +++ b/harbour/contrib/hbfship/strpeek.c @@ -54,8 +54,6 @@ #include "hbapiitm.h" #include "hbapierr.h" -#ifdef HB_COMPAT_FLAGSHIP - HB_FUNC( STRPEEK ) { PHB_ITEM pText = hb_param( 1, HB_IT_STRING ); @@ -93,5 +91,3 @@ HB_FUNC( STRPOKE ) else hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } - -#endif /* HB_COMPAT_FLAGSHIP */ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 3469b3406b..69a69c82e9 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -906,6 +906,7 @@ EXTERNAL HB_MMIDDLEDOWN EXTERNAL HB_STRFORMAT EXTERNAL HB_ALERT EXTERNAL HB_SETCLSHANDLE +EXTERNAL HB_SECONDSCPU EXTERNAL HB_INISETCOMMENT EXTERNAL HB_INIREAD @@ -1237,14 +1238,4 @@ EXTERNAL HBNIL EXTERNAL HBNUMERIC #endif /* HB_REQUEST_SCALAR */ -/* FlagShip extension */ - -#ifdef HB_COMPAT_FLAGSHIP - -EXTERNAL STRPEEK -EXTERNAL STRPOKE -EXTERNAL SECONDSCPU - -#endif /* HB_COMPAT_FLAGSHIP */ - #endif /* HB_EXTERN_CH_ */ diff --git a/harbour/include/hbsetup.ch b/harbour/include/hbsetup.ch index 8e805d610d..76cb6ad423 100644 --- a/harbour/include/hbsetup.ch +++ b/harbour/include/hbsetup.ch @@ -56,14 +56,11 @@ #ifndef HB_SETUP_CH_ #define HB_SETUP_CH_ -/* NOTE: You can select here, which features you want to include of the - different Clipper implementations. */ +/* NOTE: You can fine-tune here, which Clipper features you want to include. */ /* #define HB_CLP_STRICT */ /* Enable Cl*pper 5.2e/5.3x strict compatibility */ #define HB_CLP_UNDOC /* Enable Cl*pper 5.2e/5.3x undocumented features */ #define HB_COMPAT_C53 /* Enable Cl*pper 5.3x extensions */ -#define HB_COMPAT_FLAGSHIP /* Enable Flagship extensions */ -/* #define HB_COMPAT_FOXPRO */ /* Enable FoxPro extensions */ /* *********************************************************************** * Leave this #define if you want to allow usage of legacy Harbour 2.0.0/Clipper diff --git a/harbour/src/common/hbverdsp.c b/harbour/src/common/hbverdsp.c index 805f56e37a..a95f7430a1 100644 --- a/harbour/src/common/hbverdsp.c +++ b/harbour/src/common/hbverdsp.c @@ -6,7 +6,7 @@ * Harbour Project source code: * Display build information * - * Copyright 1999 {list of individual authors and e-mail addresses} + * Copyright 1999-2010 Viktor Szakats (harbour.01 syenar.hu) * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -162,12 +162,6 @@ void hb_verBuildInfo( void ) #endif #if defined( HB_CLP_STRICT ) hb_conOutErr( "(Clipper 5.x strict) ", 0 ); -#endif -#if defined( HB_COMPAT_FLAGSHIP ) - hb_conOutErr( "(Flagship) ", 0 ); -#endif -#if defined( HB_COMPAT_FOXPRO ) - hb_conOutErr( "(FoxPro) ", 0 ); #endif hb_conOutErr( hb_conNewLine(), 0 ); diff --git a/harbour/src/rtl/Makefile b/harbour/src/rtl/Makefile index 064d31ef4d..8b37b49fd3 100644 --- a/harbour/src/rtl/Makefile +++ b/harbour/src/rtl/Makefile @@ -142,7 +142,6 @@ C_SOURCES := \ saverest.c \ scroll.c \ scrrow.c \ - secondfs.c \ seconds.c \ setcolor.c \ setcurs.c \ @@ -163,7 +162,6 @@ C_SOURCES := \ strcase.c \ strclear.c \ strmatch.c \ - strpeek.c \ strtoexp.c \ strtran.c \ strxor.c \ diff --git a/harbour/src/rtl/seconds.c b/harbour/src/rtl/seconds.c index 958ebb4059..e70b2160d9 100644 --- a/harbour/src/rtl/seconds.c +++ b/harbour/src/rtl/seconds.c @@ -6,6 +6,7 @@ * Harbour Project source code: * SECONDS() function * + * Copyright 2003 Przemyslaw Czerpak (HB_SECONDSCPU()) * Copyright 1999 Jose Lalin * www - http://www.harbour-project.org * @@ -58,6 +59,11 @@ HB_FUNC( SECONDS ) hb_retnd( hb_dateSeconds() ); } +HB_FUNC( HB_SECONDSCPU ) +{ + hb_retnd( hb_secondsCPU( hb_parni( 1 ) ) ); +} + HB_FUNC( HB_MILLISECONDS ) { hb_retnint( ( HB_MAXINT ) hb_dateMilliSeconds() ); diff --git a/harbour/tests/memtst.prg b/harbour/tests/memtst.prg index 719d68c13d..2e36ecae4f 100644 --- a/harbour/tests/memtst.prg +++ b/harbour/tests/memtst.prg @@ -30,12 +30,12 @@ endif ? ? "testing single large memory blocks allocation and freeing..." nRealSec := seconds() -nCPUSec := secondsCPU() +nCPUSec := hb_secondsCPU() for i := 1 to N_LOOPS a := space( 50000 ) next a := NIL -nCPUSec := secondsCPU() - nCPUSec +nCPUSec := hb_secondsCPU() - nCPUSec nRealSec := seconds() - nRealSec ? " CPU time:", nCPUSec, "sec." ? "real time:", nRealSec, "sec." @@ -43,7 +43,7 @@ nRealSec := seconds() - nRealSec ? ? "testing many large memory blocks allocation and freeing..." nRealSec := seconds() -nCPUSec := secondsCPU() +nCPUSec := hb_secondsCPU() a := array(100) for i := 1 to N_LOOPS a[ i % 100 + 1 ] := space( 50000 ) @@ -52,7 +52,7 @@ for i := 1 to N_LOOPS endif next a := NIL -nCPUSec := secondsCPU() - nCPUSec +nCPUSec := hb_secondsCPU() - nCPUSec nRealSec := seconds() - nRealSec ? " CPU time:", nCPUSec, "sec." ? "real time:", nRealSec, "sec." @@ -63,7 +63,7 @@ nRealSec := seconds() - nRealSec wait nRealSec := seconds() -nCPUSec := secondsCPU() +nCPUSec := hb_secondsCPU() a := {} for i := 1 to N_LOOPS aadd( a, {} ) @@ -71,7 +71,7 @@ for i := 1 to N_LOOPS ?? i endif next -nCPUSec := secondsCPU() - nCPUSec +nCPUSec := hb_secondsCPU() - nCPUSec nRealSec := seconds() - nRealSec ? " CPU time:", nCPUSec, "sec." ? "real time:", nRealSec, "sec." diff --git a/harbour/tests/speedold.prg b/harbour/tests/speedold.prg index 81c41cc40c..96a7905842 100644 --- a/harbour/tests/speedold.prg +++ b/harbour/tests/speedold.prg @@ -35,7 +35,7 @@ #endif #ifdef REAL_TIME - #xtranslate secondscpu([]) => seconds() + #xtranslate hb_secondsCPU([]) => seconds() #endif #ifndef EOL #define EOL hb_OSNewLine() @@ -100,15 +100,15 @@ t:=seconds()+5; while t > seconds(); enddo ? "ARR_LEN =", ARR_LEN ? "N_LOOPS =", N_LOOPS -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS next -tn:=secondscpu()-t +tn:=hb_secondsCPU()-t ? "empty loops overhead =", tn #ifdef REAL_TIME ? "real time -> seconds()" #else - ? "CPU usage -> secondsCPU()" + ? "CPU usage -> hb_secondsCPU()" #endif ? "" @@ -153,39 +153,39 @@ L_N := 112345.67 L_D := date() -total:=secondscpu() +total:=hb_secondsCPU() totalr:=seconds() -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=L_C next dsp_time( "c:=L_C -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=L_N next dsp_time( "n:=L_N -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS d:=L_D next dsp_time( "d:=L_D -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=M_C next dsp_time( "c:=M_C -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=M_N next dsp_time( "n:=M_N -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS d:=M_D next @@ -193,38 +193,38 @@ dsp_time( "d:=M_D -> ", t, tn) #ifndef NO_DBF_TEST select(1) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=F_C next dsp_time( "(sh) c:=F_C -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=F_N next dsp_time( "(sh) n:=F_N -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS d:=F_D next dsp_time( "(sh) d:=F_D -> ", t, tn) select(2) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=F_C next dsp_time( "(ex) c:=F_C -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=F_N next dsp_time( "(ex) n:=F_N -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS d:=F_D next @@ -232,14 +232,14 @@ dsp_time( "(ex) d:=F_D -> ", t, tn) #endif o:=errorNew() -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=o:GenCode next dsp_time( "n:=o:GenCode -> ", t, tn) #ifdef __HARBOUR__ -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=o[8] next @@ -247,13 +247,13 @@ dsp_time( "n:=o[8] -> ", t, tn) #endif #ifdef ASSOC_ARRAY -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100))]:=i next dsp_time( "aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100)]:=i -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100))] next @@ -261,38 +261,38 @@ dsp_time( "c:=aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100)] -> ", t, tn) #endif #ifndef NO_KEYBOARD_TEST -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS inkey() next dsp_time( "inkey() -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS nextkey() next dsp_time( "nextkey() -> ", t, tn) #endif -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS round(i/1000,2) next dsp_time( "round(i/1000,2) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS str(i/1000) next dsp_time( "str(i/1000) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS val(a3[i%ARR_LEN+1]) next dsp_time( "val(a3[i%ARR_LEN+1]) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() j:=date() for i:=1 to N_LOOPS dtos(j+i%10000-5000) @@ -300,87 +300,87 @@ next dsp_time( "dtos(j+i%10000-5000) -> ", t, tn) bc:={||i%ARR_LEN} -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS eval(bc) next dsp_time( "eval({||i%ARR_LEN}) -> ", t, tn) bc:={|x|x%ARR_LEN} -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS eval(bc,i) next dsp_time( "eval({|x|x%ARR_LEN},i) -> ", t, tn) bc:={|x|f1(x)} -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS eval(bc,i) next dsp_time( "eval({|x|f1(x)},i) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS n:=&("f1("+str(i)+")") next dsp_time( "&('f1('+str(i)+')') -> ", t, tn) bc:=&("{|x|f1(x)}") -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS eval(bc,i) next dsp_time( "eval([&('{|x|f1(x)}')]) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j:=valtype(a)+valtype(i) next dsp_time( "j := valtype(a)+valtype(i) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j := str(i%100,2) $ a2[i%ARR_LEN+1] next dsp_time( "j := str(i%100,2) $ a2[i%ARR_LEN+1] -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j := val(a2[i%ARR_LEN+1]) next dsp_time( "j := val(a2[i%ARR_LEN+1]) -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j := a2[i%ARR_LEN+1] == c next dsp_time( "j := a2[i%ARR_LEN+1] == s -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j := a2[i%ARR_LEN+1] = c next dsp_time( "j := a2[i%ARR_LEN+1] = s -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j := a2[i%ARR_LEN+1] >= c next dsp_time( "j := a2[i%ARR_LEN+1] >= s -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS j := a2[i%ARR_LEN+1] < c next dsp_time( "j := a2[i%ARR_LEN+1] < s -> ", t, tn) aa:={} -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS if i%1000 == 0 aa:={} @@ -389,46 +389,46 @@ for i:=1 to N_LOOPS next dsp_time( "aadd(aa,{i,j,s,a,a2,t,bc}) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f0() next dsp_time( "f0() -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f1(i) next dsp_time( "f1(i) -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f2(c) next dsp_time( "f2(c["+ltrim(str(len(c)))+"]) -> ", t, tn) c:=replicate(c,5000) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f2(c) next dsp_time( "f2(c["+ltrim(str(len(c)))+"]) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f2(@c) next dsp_time( "f2(@c["+ltrim(str(len(c)))+"]) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f2(c) c2:=c next dsp_time( "f2(c["+ltrim(str(len(c)))+"]); c2:=c -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f2(@c) c2:=c @@ -436,44 +436,44 @@ next dsp_time( "f2(@c["+ltrim(str(len(c)))+"]); c2:=c -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f3(a,a2,c,i,j,t,bc) next dsp_time( "f3(a,a2,c,i,j,t,bc) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS f2(a2) next dsp_time( "f2(a2) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=f4() next dsp_time( "s:=f4() -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS c:=f5() next dsp_time( "s:=f5() -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS ascan(a,i%ARR_LEN) next dsp_time( "ascan(a,i%ARR_LEN) -> ", t, tn) c:=dtos(date()) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS ascan(a2,c+chr(i%64+64)) next dsp_time( "ascan(a2,c+chr(i%64+64)) -> ", t, tn) -t:=secondscpu() +t:=hb_secondsCPU() for i:=1 to N_LOOPS ascan(a,{|x|x==i%ARR_LEN}) next @@ -498,7 +498,7 @@ endif return nil function dsp_time(s,t,tn) -? padr(s,50)+str(max(secondscpu()-t-tn,0),8,2) +? padr(s,50)+str(max(hb_secondsCPU()-t-tn,0),8,2) return nil function f0(x) diff --git a/harbour/tests/speedtst.prg b/harbour/tests/speedtst.prg index 26bd5a7275..c901628a10 100644 --- a/harbour/tests/speedtst.prg +++ b/harbour/tests/speedtst.prg @@ -43,7 +43,7 @@ #define __ST__ #endif /* Clipper does not have function to extract process time */ - #xtranslate secondsCPU() => seconds() + #xtranslate hb_secondsCPU() => seconds() #endif #ifdef FlagShip @@ -52,6 +52,7 @@ #ifndef __ST__ #define __ST__ #endif + #xtranslate hb_secondsCPU([]) => secondsCPU([]) /* the FlagShip version of seconds() returns integer values */ #xtranslate seconds() => fs_seconds() #endif @@ -59,7 +60,7 @@ #ifdef __XPP__ #define __NO_OBJ_ARRAY__ /* Has xBase++ function to extract process time? */ - #xtranslate secondsCPU() => seconds() + #xtranslate hb_secondsCPU() => seconds() #endif #ifdef __CLIP__ @@ -126,11 +127,11 @@ [ private ; ] ; [ public ; ] ; [ ; ] ; - time := secondscpu() ; ; + time := hb_secondsCPU() ; ; for i:=1 to N_LOOPS ; ; [ ( ) ; ] ; next ; ; - time := secondscpu() - time ; ; + time := hb_secondsCPU() - time ; ; [ ; ] ; return { procname() + ": " + iif( <.info.>, <(info)>, # ), time } @@ -542,7 +543,7 @@ else endif nSeconds := seconds() -nTimes := secondsCPU() +nTimes := hb_secondsCPU() nTimeTotST := nTimeTotMT := 0 @@ -640,7 +641,7 @@ nTimeTotST := nTimeTotMT := 0 next #endif -nTimes := secondsCPU() - nTimes +nTimes := hb_secondsCPU() - nTimes nSeconds := seconds() - nSeconds if lScale diff --git a/harbour/tests/vidtest.prg b/harbour/tests/vidtest.prg index acfeef31f3..4cd1d9d18a 100644 --- a/harbour/tests/vidtest.prg +++ b/harbour/tests/vidtest.prg @@ -15,8 +15,12 @@ #include "box.ch" #ifndef __CLIP__ - #ifndef FlagShip - #xtranslate secondscpu([]) => seconds([]) + #ifdef FlagShip + #xtranslate hb_secondsCPU([]) => secondsCPU([]) + #else + #ifndef __HARBOUR__ + #xtranslate hb_secondsCPU([]) => seconds([]) + #endif #define EOL chr(13) + chr(10) #endif #endif @@ -66,7 +70,7 @@ static function StaticText() local c local i := 0 local nEnd := 0 - local nStart := secondscpu() + local nStart := hb_secondsCPU() str := "Hello World - From " + Left(str,At(" ",str)-1) c := (MaxCol()-len(str)) / 2 @@ -75,7 +79,7 @@ static function StaticText() @ r, c say str next i - nEnd := secondscpu() + nEnd := hb_secondsCPU() cResult := "StaticText: Iterations=5000, Time="+alltrim(str(nEnd-nStart))+ ; "secs, Average FPS = "+alltrim(str(round(5000 / (nEnd-nStart),0)))+" FPS" @@ -109,7 +113,7 @@ static function WindowBounce() clr[i] := "W+/"+aCol[(i-1)%16+1] next i - nStart := secondscpu() + nStart := hb_secondsCPU() dispbegin() do while nFrames < 5000 @@ -141,7 +145,7 @@ static function WindowBounce() enddo dispend() - nEnd := secondscpu() + nEnd := hb_secondsCPU() cResult := "WindowBounce:Iterations="+alltrim(str(nFrames))+", Time="+alltrim(str(nEnd-nStart))+ ; "secs, Average FPS = "+alltrim(str(round(nFrames / (nEnd-nStart),0)))+" FPS" @@ -163,7 +167,7 @@ static function ColourBoxes() local aCol := {"N", "B", "G", "BG", "R", "RB", "GR", "W", ; "N*","B*","G*","BG*","R*","RB*","GR*","W*" } - nStart := secondscpu() + nStart := hb_secondsCPU() // display boxes to screen do while nFrames < 5000 @@ -191,7 +195,7 @@ static function ColourBoxes() nDepth-- enddo - nEnd := secondscpu() + nEnd := hb_secondsCPU() cResult := "ColourBoxes: Iterations="+alltrim(str(nFrames))+", Time="+alltrim(str(nEnd-nStart))+ ; "secs, Average FPS = "+alltrim(str(round(nFrames / (nEnd-nStart),0)))+" FPS" diff --git a/harbour/utils/hbmk2/examples/contribf.hbc b/harbour/utils/hbmk2/examples/contribf.hbc index 89fa7e1591..446b89a0a4 100644 --- a/harbour/utils/hbmk2/examples/contribf.hbc +++ b/harbour/utils/hbmk2/examples/contribf.hbc @@ -6,7 +6,7 @@ # [ This should be kept in sync with local Makefile information. ] # contribs portable, with no external dependencies: -libs=hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmzip hbnf hbtpathy hbziparc rddsql xhb +libs=hbbmcdx hbbtree hbclipsm hbct hbfship hbgt hbmisc hbmzip hbnf hbtpathy hbziparc rddsql xhb # contribs portable, with external dependencies: libs=hbcurl hbfbird hbgd hbhpdf hbmysql hbpgsql hbqt hbtip sddfb sddmy sddpg