From 74be9527456bdc8e2e23b5409396577c0c667206 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 10 Aug 2009 20:35:03 +0000 Subject: [PATCH] 2009-08-10 22:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtpathy/telepath.prg * contrib/hbtpathy/tpcommon.c + TP_CRC16() reimplemented in .prg after reading Przemek's e-mail. --- harbour/ChangeLog | 5 +++++ harbour/contrib/hbtpathy/telepath.prg | 3 ++- harbour/contrib/hbtpathy/tpcommon.c | 9 --------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b6d14dc5a9..46a40b8784 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-10 22:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbtpathy/telepath.prg + * contrib/hbtpathy/tpcommon.c + + TP_CRC16() reimplemented in .prg after reading Przemek's e-mail. + 2009-08-10 22:31 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtpathy/tpcommon.c + __TP_CRC16() rewritten using core checksum function. diff --git a/harbour/contrib/hbtpathy/telepath.prg b/harbour/contrib/hbtpathy/telepath.prg index c10ab6f6ad..d4a8a07e24 100644 --- a/harbour/contrib/hbtpathy/telepath.prg +++ b/harbour/contrib/hbtpathy/telepath.prg @@ -489,8 +489,9 @@ PROCEDURE tp_clrkbd() RETURN FUNCTION tp_crc16( cString ) + LOCAL crc := hb_crcct( cString ) - RETURN __tp_CRC16( cString ) + RETURN Int( crc / 256 ) + Int( ( crc % 256 ) * 256 ) /* swap lo and hi bytes */ FUNCTION tp_crc32( cString ) diff --git a/harbour/contrib/hbtpathy/tpcommon.c b/harbour/contrib/hbtpathy/tpcommon.c index 3163721140..51fc7ad79d 100644 --- a/harbour/contrib/hbtpathy/tpcommon.c +++ b/harbour/contrib/hbtpathy/tpcommon.c @@ -51,15 +51,6 @@ */ #include "hbapi.h" -#include "hbapifs.h" -#include "hbchksum.h" - -HB_FUNC( __TP_CRC16 ) -{ - long crc = ( long ) hb_crcct( 0, hb_parcx( 1 ), hb_parclen( 1 ), 0x11021 ); - - hb_retnl( ( crc >> 8 ) | ( ( crc << 8 ) & 0xFF00 ) ); /* swap hi and lo byte */ -} HB_FUNC_EXTERN( HB_BITAND );