ChangeLogTag:Tue Oct 26 13:11:19 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>

This commit is contained in:
Gonzalo A. Diethelm
1999-10-26 16:24:23 +00:00
parent 69cd472d59
commit f48a51de2d
5 changed files with 46 additions and 16 deletions

View File

@@ -1,3 +1,11 @@
Tue Oct 26 13:11:19 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
* source/tools/dates2.c:
* source/tools/hb_f.c:
* source/tools/strasint.c:
* source/tools/stringsx.c:
Added HB_TRACE() calls to the TOOLS library.
Tue Oct 26 12:55:49 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
* source/rdd/dbcmd.c:

View File

@@ -45,13 +45,18 @@ static int hb__daysinmonth[ 12 ] =
int hb_isleapyear( long lYear )
{
return (( lYear % 4 == 0 && lYear % 100 != 0 ) || lYear % 400 == 0 )?1:0;
HB_TRACE(("hb_isleapyear(%ld)", lYear));
return (( lYear % 4 == 0 && lYear % 100 != 0 ) || lYear % 400 == 0 )?1:0;
}
long hb_daysinmonth( long lMonth, long lYear )
{
int i = hb_isleapyear( lYear );
int i;
HB_TRACE(("hb_daysinmonth(%ld, %ld)", lMonth, lYear));
i = hb_isleapyear( lYear );
if( lMonth > 0 && lMonth < 13 )
return hb__daysinmonth[ lMonth-1 ] + ((i&&lMonth == 2)?1:0);
@@ -63,6 +68,8 @@ long hb_doy( long lDay, long lMonth, long lYear )
int i;
int iDoy = 0;
HB_TRACE(("hb_doy(%ld, %ld, %ld)", lDay, lMonth, lYear));
for( i = 1; i < lMonth; i++ )
iDoy += hb_daysinmonth( i, lYear );
iDoy += lDay;
@@ -72,8 +79,11 @@ long hb_doy( long lDay, long lMonth, long lYear )
long hb_wom( long lDay, long lMonth, long lYear )
{
int iWom = lDay + hb_dow( 1, lMonth, lYear) - 1;
int iWom;
HB_TRACE(("hb_wom(%ld, %ld, %ld)", lDay, lMonth, lYear));
iWom = lDay + hb_dow( 1, lMonth, lYear) - 1;
if( iWom > 0 )
return ( iWom - hb_dow( lDay, lMonth, lYear ) ) / 7 + 1 ;
else
@@ -84,6 +94,8 @@ long hb_woy( long lDay, long lMonth, long lYear, BOOL bISO )
{
int iWeek, n;
HB_TRACE(("hb_woy(%ld, %ld, %ld, %d)", lDay, lMonth, lYear, (int) bISO));
lDay = hb_doy( lDay, lMonth, lYear );
n = ( ( ( 1 - (bISO ? 1 : 0) ) % 7 ) ) - 1;
lDay += (n>0)?1:0;

View File

@@ -125,6 +125,8 @@ static long hb_hbfskip( int recs )
long x, y;
HB_TRACE(("hb_hbskip(%d)", recs));
if ( recs > 0 ) {
for (y = 0; y < recs; y++ ) {
hb_fsSeek( handles[area], offset[area], SEEK_SET );

View File

@@ -9,21 +9,25 @@
* By......: David A Pearson *
*****************************************************************************/
#include "hbtrace.h"
#define ISDIGIT(c) ((c) >= '0' && (c) <= '9')
int _GT_Internal_StringAsInt(char *String, int Start, int End)
{
int Decimal = 1;
int Digit = End;
int Value = 0;
int Decimal = 1;
int Digit = End;
int Value = 0;
for (Digit = End; Digit >= Start; Digit--)
{
if (ISDIGIT(String[Digit]))
{
Value += (String[Digit] - 0x30) * Decimal;
Decimal *= 0xA;
}
}
return(Value);
HB_TRACE(("_GT_Internal_StringAsInt(%s, %d, %d)", String, Start, End));
for (Digit = End; Digit >= Start; Digit--)
{
if (ISDIGIT(String[Digit]))
{
Value += (String[Digit] - 0x30) * Decimal;
Decimal *= 0xA;
}
}
return(Value);
}

View File

@@ -12,8 +12,12 @@ char *hb_strtoken(char *szText,
char cDelimiter,
long *lLen)
{
long wStart, wEnd = 0, wCounter = 0;
long wStart;
long wEnd = 0;
long wCounter = 0;
HB_TRACE(("hb_strtoken(%s, %ld, %ld, %d, %p)", szText, lText, lIndex, (int) cDelimiter, lLen));
do
{
wStart = wEnd;