Hi Przemek,

On 2009.08.11., at 0:02, Przemyslaw Czerpak wrote:

On Mon, 10 Aug 2009, [email protected] wrote:

Hi Viktor,

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.

Maybe we should add to RTL set of functions to swap bytes in numbers?
I.e. hb_swapI(), hb_swapW(), hb_swapL(), hb_swapU(), hb_swapLL()
The suffixes should correspond to BIN2?() functions but maybe you have
better proposition for names.
With such function tp_crc16() can be implemented as:

FUNCTION tp_crc16( cString )
  RETURN hb_swapW( hb_crcct( cString ) )

What do you think?

I agree, can be useful. Maybe HB_BINSWAP*() would be a less
generic name. It would also align with BIN2*() naming.

The other question is what to expect from HB_BINSWAPL[L]()? Would it
swap the two halves or would it reverse the bytes?

Brgds,
Viktor

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to