2007-11-20 19:09 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/bin/hb-func.sh
    ! fixed using -o<name> in hbcc

  * harbour/contrib/rdd_ads/rddads.h
    ! small hack for Linux compilation and compilers which do not set
      unix macro

  * harbour/contrib/rdd_ads/Makefile
    * added /usr/local/ads/acesdk to include directory list
      Viktor the side effect of removing ace.h from our repository is
      blocking ADS* RDDs compilation by people who do not have ACE
      installed - I expect it will be serious problem in creating BETA4
      binaries because not all people who create them have ACE installed
      or even want to install it and without these RDDs for many users
      new Harbour version will be unusable.

  * harbour/source/rtl/seconds.c
    ! fixed stupid typo in milliseconds calculation

  * harbour/contrib/xhb/hbchksum.c
  * harbour/contrib/xhb/hbcomprs.c
  * harbour/contrib/xhb/hbcomprs.h
    ! use hb_retclenAdopt() instead of hb_retclenAdoptRaw()
    + svn:keywords Id
      svn:eol-style native
    TOFIX - these files have to be removed or changed to avoid name conflicts
    with ZLIB - personally I vote to add real ZLIB wrapper and only xHarbour
    compatible .prg functions when they are necessary. Probably only:
        HB_COMPRESS(), HB_UNCOMPRESS(), HB_COMPRESSBUFLEN()
    and maybe:
        HB_COMPRESSERROR(), HB_COMPRESSERRORDESC()
    In xHarbour:
        HB_CHECKSUM( <cValue> [, <nStart>] ) -> <nChkSum>
    is exactly the same function as in Harbour:
        HB_ADLER32( <cValue> [, <nStart>] ) -> <nChkSum>
    with the exception to bug with negative values fixed in Harbour only.
This commit is contained in:
Przemyslaw Czerpak
2007-11-20 18:09:55 +00:00
parent 0f34f5f783
commit 1153e28e4b
8 changed files with 5431 additions and 5383 deletions

View File

@@ -8,6 +8,44 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-20 19:09 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
! fixed using -o<name> in hbcc
* harbour/contrib/rdd_ads/rddads.h
! small hack for Linux compilation and compilers which do not set
unix macro
* harbour/contrib/rdd_ads/Makefile
* added /usr/local/ads/acesdk to include directory list
Viktor the side effect of removing ace.h from our repository is
blocking ADS* RDDs compilation by people who do not have ACE
installed - I expect it will be serious problem in creating BETA4
binaries because not all people who create them have ACE installed
or even want to install it and without these RDDs for many users
new Harbour version will be unusable.
* harbour/source/rtl/seconds.c
! fixed stupid typo in milliseconds calculation
* harbour/contrib/xhb/hbchksum.c
* harbour/contrib/xhb/hbcomprs.c
* harbour/contrib/xhb/hbcomprs.h
! use hb_retclenAdopt() instead of hb_retclenAdoptRaw()
+ svn:keywords Id
svn:eol-style native
TOFIX - these files have to be removed or changed to avoid name conflicts
with ZLIB - personally I vote to add real ZLIB wrapper and only xHarbour
compatible .prg functions when they are necessary. Probably only:
HB_COMPRESS(), HB_UNCOMPRESS(), HB_COMPRESSBUFLEN()
and maybe:
HB_COMPRESSERROR(), HB_COMPRESSERRORDESC()
In xHarbour:
HB_CHECKSUM( <cValue> [, <nStart>] ) -> <nChkSum>
is exactly the same function as in Harbour:
HB_ADLER32( <cValue> [, <nStart>] ) -> <nChkSum>
with the exception to bug with negative values fixed in Harbour only.
2007-11-20 17:02 UTC+0100 Miguel Angel Marchuet Frutos <miguelangel@marchuet.net>
* contrib/xhb/common.mak
+ Added some missing lines (suggested by Juan Gálvez)

View File

@@ -233,6 +233,15 @@ elif [ "\$*" = "mk-links" ]; then
exit
fi
## check basename
case "\${0##*/}" in
*cc) HB=cc ;;
*cmp) HB=cmp ;;
*lnk) HB=lnk ;;
*mk) HB=mk ;;
*) exit 1 ;;
esac
## default parameters
HB_STATIC="${hb_static}"
HB_MT=""
@@ -262,11 +271,13 @@ while [ \$n -lt \${#P[@]} ]; do
-o*)
d="\${v#-o}"; p="\${v}"
if [ -d "\${d}" ]; then
DIROUT="\${d%/}"
DIROUT="\${d%}"
elif [ -d "\${d%/*}" ]; then
DIROUT="\${d%/*}"; FILEOUT="\${d##*/}"; p="-o\${d%.*}"
DIROUT="\${d%/*}"; FILEOUT="\${d##*/}"; p="-o\${d}"
[ \${HB} != "cc" ] || p="-o\${d%.*}"
elif [ -n "\${d}" ]; then
FILEOUT="\${d}"; p="-o\${d%.*}"
FILEOUT="\${d}"; p="-o\${d}"
[ \${HB} != "cc" ] || p="-o\${d%.*}"
fi ;;
-static) HB_STATIC="yes" ;;
-fullstatic) HB_STATIC="full" ;;
@@ -532,9 +543,6 @@ hb_cleanup()
trap hb_cleanup EXIT &>/dev/null
## get basename
HB="\${0##*/}"
case "\${HB}" in
*cc)
hb_cc "\${P[@]}"

View File

@@ -15,7 +15,11 @@ PRG_HEADERS=\
LIBNAME=rddads
ifeq ($(HB_ARCHITECTURE),w32)
C_USR += -DWIN32
C_USR += -DWIN32
endif
ifneq ($(wildcard /usr/local/ads/acesdk/ace.h),)
C_USR += -I/usr/local/ads/acesdk
endif
include $(TOP)$(ROOT)config/header.cf

View File

@@ -58,10 +58,8 @@
#if defined( HB_OS_WIN_32 ) && !defined( WIN32 )
#define WIN32
#endif
#if defined( unix ) || defined(__LINUX__)
#ifndef ADS_LINUX
#define ADS_LINUX
#endif
#if !defined( unix ) && ( defined( __LINUX__ ) || defined( HB_OS_LINUX ) )
#define unix
#endif
#if defined( __WATCOMC__ ) || defined( __LCC__ )

View File

@@ -1,134 +1,134 @@
/*
* $Id: hbchksum.c,v 1.2 2004/02/14 21:01:16 andijahja Exp $
*/
/*
* xHarbour Project source code:
* Fast and reliable checksum function
*
* Copyright 2003 Giancarlo Niccolai <giancarlo@niccolai.ws>
* www - http://www.xharbour.org
* SEE ALSO COPYRIGHT NOTICE FOR ADLER32 BELOW.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/* This file includes code slices from adler32.c for advanced CRC
* Holder of copyright for this code is:
*
* Copyright (C) 1995-2002 Mark Adler
*
* ZLIB (containing adler32 code) can be found at:
* http://www.gzip.org/zlib/
*/
#include "hbcomprs.h"
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbfast.h"
#include "hbstack.h"
#include "hbdefs.h"
#include "hbvm.h"
#include "hbapierr.h"
/* ========================================================================= */
#define BASE 65521L /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
ULONG HB_EXPORT adler32( ULONG adler, const BYTE *buf, UINT len)
{
ULONG s1 = adler & 0xffff;
ULONG s2 = (adler >> 16) & 0xffff;
int k;
if (buf == NULL) return 1L;
while (len > 0) {
k = len < NMAX ? len : NMAX;
len -= k;
while (k >= 16) {
DO16(buf);
buf += 16;
k -= 16;
}
if (k != 0) do {
s1 += *buf++;
s2 += s1;
} while (--k);
s1 %= BASE;
s2 %= BASE;
}
return (s2 << 16) | s1;
}
HB_FUNC( HB_CHECKSUM )
{
PHB_ITEM pString = hb_param( 1, HB_IT_STRING );
ULONG ulSum = 0;
if(pString == NULL)
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, "Must be a string", 1, hb_param(1, HB_IT_ANY) );
return;
}
if( ISNUM(2) )
{
ulSum = (ULONG) hb_parnl( 2 );
}
/*
hb_retnd( (LONG)
adler32( ulSum, ( const BYTE *) pString->item.asString.value, pString->item.asString.length ) );
*/
hb_retnd( (LONG)
adler32( ulSum, ( const BYTE *) hb_itemGetCPtr( pString ), hb_itemGetCLen( pString ) ) );
}
/*
* $Id$
*/
/*
* xHarbour Project source code:
* Fast and reliable checksum function
*
* Copyright 2003 Giancarlo Niccolai <giancarlo@niccolai.ws>
* www - http://www.xharbour.org
* SEE ALSO COPYRIGHT NOTICE FOR ADLER32 BELOW.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/* This file includes code slices from adler32.c for advanced CRC
* Holder of copyright for this code is:
*
* Copyright (C) 1995-2002 Mark Adler
*
* ZLIB (containing adler32 code) can be found at:
* http://www.gzip.org/zlib/
*/
#include "hbcomprs.h"
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbfast.h"
#include "hbstack.h"
#include "hbdefs.h"
#include "hbvm.h"
#include "hbapierr.h"
/* ========================================================================= */
#define BASE 65521L /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
ULONG HB_EXPORT adler32( ULONG adler, const BYTE *buf, UINT len)
{
ULONG s1 = adler & 0xffff;
ULONG s2 = (adler >> 16) & 0xffff;
int k;
if (buf == NULL) return 1L;
while (len > 0) {
k = len < NMAX ? len : NMAX;
len -= k;
while (k >= 16) {
DO16(buf);
buf += 16;
k -= 16;
}
if (k != 0) do {
s1 += *buf++;
s2 += s1;
} while (--k);
s1 %= BASE;
s2 %= BASE;
}
return (s2 << 16) | s1;
}
HB_FUNC( HB_CHECKSUM )
{
PHB_ITEM pString = hb_param( 1, HB_IT_STRING );
ULONG ulSum = 0;
if(pString == NULL)
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, "Must be a string", 1, hb_param(1, HB_IT_ANY) );
return;
}
if( ISNUM(2) )
{
ulSum = (ULONG) hb_parnl( 2 );
}
/*
hb_retnd( (LONG)
adler32( ulSum, ( const BYTE *) pString->item.asString.value, pString->item.asString.length ) );
*/
hb_retnd( (LONG)
adler32( ulSum, ( const BYTE *) hb_itemGetCPtr( pString ), hb_itemGetCLen( pString ) ) );
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -147,7 +147,7 @@ HB_EXPORT HB_ULONG hb_dateMilliSeconds( void )
gettimeofday( &tv, NULL );
return ( HB_ULONG ) tv.tv_sec * 1000 * tv.tv_usec / 1000;
return ( HB_ULONG ) tv.tv_sec * 1000 + tv.tv_usec / 1000;
#else
struct timeb tb;
@@ -155,7 +155,7 @@ HB_EXPORT HB_ULONG hb_dateMilliSeconds( void )
ftime( &tb );
return ( HB_ULONG ) tb.time * 1000 * tb.millitm;
return ( HB_ULONG ) tb.time * 1000 + tb.millitm;
#endif
}