Re: QC Report on Swap Function
- From: "Rudy Velthuis [TeamB]" <velthuis@xxxxxxxxx>
- Date: Sun, 28 Aug 2005 19:02:24 +0200
At 18:51:52, 28.08.2005, Dennis wrote:
> Hi
>
> Do you find it OK that this report is closed with status "As designed"?
>
> swap is defective on 4 byte variables
> http://qc.borland.com/wc/qcmain.aspx?d=13719
I don't see it as defective.
Swap is a very old function, carried over from 16 bit Turbo Pascal, and
it was never intended to do anything more than swap two bytes (and AFAIK,
that is how it is documented), so yes, I think it is OK that it doesn't
touch anything else but these two bytes, and does not affect the top word
of a 32 bit type.
>From the D7 help files:
<<
Category
backward compatibility routines
Delphi syntax:
function Swap(X);
Description
In Delphi code, Swap exchanges the high-order bytes with the low-order
bytes of the argument. X is an expression of type SmallInt, as a 16-bit
value, or Word. This is provided for backward compatibility only.
>>
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de
"Well-timed silence hath more eloquence than speech."
- Martin Fraquhar Tupper
.
- Follow-Ups:
- Re: QC Report on Swap Function
- From: Dennis
- Re: QC Report on Swap Function
- From: Lars
- Re: QC Report on Swap Function
- References:
- QC Report on Swap Function
- From: Dennis
- QC Report on Swap Function
- Prev by Date: QC Report on Swap Function
- Next by Date: Re: QC Report on Swap Function
- Previous by thread: QC Report on Swap Function
- Next by thread: Re: QC Report on Swap Function
- Index(es):