2011-02-17 10:28 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/hbrandom.c
! Typo in comment. [Tamas]
+ Enabled using DBL_EPSILON in hb_random_num() on Windows
platform, except bcc, which - according to the comment
from original author - has some problems with this value.
* package/harb_win.rc
* contrib/hbrun/hbrun.rc
* Modified manifest inclusion to be friendly with all Windows
compilers (ie. not break them with their own headers and
predefined macro definitions).
This commit is contained in:
@@ -16,16 +16,29 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-02-17 10:28 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/rtl/hbrandom.c
|
||||
! Typo in comment. [Tamas]
|
||||
+ Enabled using DBL_EPSILON in hb_random_num() on Windows
|
||||
platform, except bcc, which - according to the comment
|
||||
from original author - has some problems with this value.
|
||||
|
||||
* package/harb_win.rc
|
||||
* contrib/hbrun/hbrun.rc
|
||||
* Modified manifest inclusion to be friendly with all Windows
|
||||
compilers (ie. not break them with their own headers and
|
||||
predefined macro definitions).
|
||||
|
||||
2011-02-16 18:40 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtgui/qth/QTableWidget.qth
|
||||
* contrib/hbqt/qtgui/qth/QTreeWidget.qth
|
||||
* contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth
|
||||
+ Added: [*A=1*] token to methods where ownership is
|
||||
+ Added: [*A=1*] token to methods where ownership is
|
||||
returned back to HVM from Qt object.
|
||||
* contrib/hbqt/hbmk2_qt.hbs
|
||||
+ Implemented: protocol to transfer the ownership to free
|
||||
a Qt object to HVM.
|
||||
TODO: spot methods in all .qth files where ownership
|
||||
+ Implemented: protocol to transfer the ownership to free
|
||||
a Qt object to HVM.
|
||||
TODO: spot methods in all .qth files where ownership
|
||||
is switched to application instead of its parent.
|
||||
Speak-out if you find one.
|
||||
|
||||
@@ -34,7 +47,7 @@
|
||||
! Fix: optional parameter was not properly laid.
|
||||
* contrib/hbide/idedocwriter.prg
|
||||
* contrib/hbide/ideharbourhelp.prg
|
||||
+ Implemented: Harbour's core API functions to manage
|
||||
+ Implemented: Harbour's core API functions to manage
|
||||
Documents retrieval and storage.
|
||||
|
||||
2011-02-17 00:53 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
ICON 1 DISCARDABLE "../../package/harb_os2.ico"
|
||||
#else
|
||||
1 ICON DISCARDABLE "../../package/harb_win.ico"
|
||||
#if defined( __MINGW32__ ) || defined( __BORLANDC__ ) || defined( _MSC_VER )
|
||||
#include "../../package/harb_win.rc"
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "../../package/harb_win.mft"
|
||||
#endif
|
||||
__HB_CREATEPROCESS_MANIFEST_RESOURCE_ID __HB_RT_MANIFEST "../../package/harb_win.mft"
|
||||
#endif
|
||||
|
||||
@@ -57,11 +57,8 @@ END
|
||||
|
||||
/* Preparation for manifest */
|
||||
|
||||
#include <winuser.h>
|
||||
|
||||
#ifndef RT_MANIFEST
|
||||
#define RT_MANIFEST 24
|
||||
#endif
|
||||
#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID
|
||||
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
|
||||
#endif
|
||||
/* Not using predefined Windows macros here, because some C compilers
|
||||
with fail badly with their own definitions (f.e. pocc) and/or their own
|
||||
Windows headers. [vszakats] */
|
||||
#define __HB_CREATEPROCESS_MANIFEST_RESOURCE_ID 1
|
||||
#define __HB_RT_MANIFEST 24
|
||||
|
||||
@@ -54,9 +54,7 @@
|
||||
#include "hbdate.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#if !defined( HB_OS_WIN ) /* for DBL_EPSILON */
|
||||
#include <float.h>
|
||||
#endif
|
||||
#include <float.h>
|
||||
|
||||
/* Globally available data, no need to MT it */
|
||||
static volatile int s_fInit = 0;
|
||||
@@ -95,7 +93,7 @@ HB_FUNC( HB_RANDOM )
|
||||
*
|
||||
* HB_RANDOMINT() --> returns 0 or 1, evenly distributed
|
||||
* HB_RANDOMINT( N ) --> returns an integer between 1 and N (inclusive)
|
||||
* HB_RANDOMINT( x, y ) --> Returns a real number between x and y (inclusive)
|
||||
* HB_RANDOMINT( x, y ) --> Returns an integer number between x and y (inclusive)
|
||||
* The integer returned is of the longest type available
|
||||
*/
|
||||
HB_FUNC( HB_RANDOMINT )
|
||||
@@ -131,7 +129,7 @@ double hb_random_num()
|
||||
{
|
||||
double d1, d2;
|
||||
|
||||
if( !s_fInit )
|
||||
if( ! s_fInit )
|
||||
{
|
||||
srand( ( unsigned ) hb_dateMilliSeconds() );
|
||||
s_fInit = HB_TRUE;
|
||||
@@ -139,8 +137,7 @@ double hb_random_num()
|
||||
|
||||
d1 = ( double ) rand();
|
||||
d2 = ( double ) RAND_MAX;
|
||||
#if defined( HB_OS_WIN )
|
||||
/* TOFIX: it breaks the range of random values */
|
||||
#if defined( __BORLANDC__ )
|
||||
/* It seems that on Windows platform there some weirdness about EPSILON value so
|
||||
that a float division using an epsilon smaller than 1e-10 may be rounded.
|
||||
Must dig if it's a borland lib bug or a windows problem.
|
||||
|
||||
Reference in New Issue
Block a user