Board index » delphi » QC Report on Swap Function
Dennis
Delphi Developer |
Dennis
Delphi Developer |
QC Report on Swap Function2005-08-29 12:51:52 AM delphi39 Hi Do you find it OK that this report is closed with status "As designed"? swap is defective on 4 byte variables qc.borland.com/wc/qcmain.aspx Best regards Dennis |
Rudy Velthuis [TeamB]
Delphi Developer |
2005-08-29 01:02:24 AM
Re:QC Report on Swap Function
At 18:51:52, 28.08.2005, Dennis writes:
QuoteHi 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 Delphi 7 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. Quote> "Well-timed silence hath more eloquence than speech." - Martin Fraquhar Tupper |
Lars
Delphi Developer |
2005-08-29 01:28:34 AM
Re:QC Report on Swap Function
Rudy Velthuis [TeamB] writes:
QuoteAt 18:51:52, 28.08.2005, Dennis writes: I can see the swap there is now is a compiler magic function as in 'inline' before the compiler had inline option. ;-) Is there a reason for not put in new overloaded functions ? Regards Lars G |
Rudy Velthuis [TeamB]
Delphi Developer |
2005-08-29 01:31:19 AM
Re:QC Report on Swap Function
At 19:28:34, 28.08.2005, Lars writes:
QuoteTrue but why no have a swap there is working on 4 byte variables ? guess it is implemented various times already. -- Rudy Velthuis [TeamB] velthuis.homepage.t-online.de "Plato was a bore." - Friedrich Nietzsche (1844-1900) |
Kristofer Skaug
Delphi Developer |
2005-08-29 03:34:04 AM
Re:QC Report on Swap Function
Lars writes:
QuoteTrue but why no have a swap there is working on 4 byte variables ? I've long ago "rolled my own" for all of the above, but better and faster implementations are always welcome! Byte-swapping functions should IMO not be overloaded, as the specific data representation is inherently important; so the programmer should be explicit about the exact swap being done. Anyway, the compiler couldn't distinguish between 24 and 32 bit input, or 48 and 64 bit input, for that matter. -- Kristofer |
Max
Delphi Developer |
2005-08-29 03:56:56 AM
Re:QC Report on Swap Function
Kristofer Skaug writes:
QuoteLars writes: -- ------------------------------------------------- Binary Packets with daily error corrections www.de.freepascal.org/lazarus/ New: Free Pascal 2.1.1 / Lazarus 0.9.9 ------------------------------------------------- Create native 64-bit compiler/IDE Vote qc.borland.com/wc/qcmain.aspx ------------------------------------------------- Parameterized Types (aka Generics) also for Win32 Vote qc.borland.com/wc/qcmain.aspx ------------------------------------------------- Help system needs major work Vote qc.borland.com/wc/qcmain.aspx ------------------------------------------------- |
Dennis
Delphi Developer |
2005-08-29 03:58:07 AM
Re:QC Report on Swap Function
Hi Rudy
I agree with you. Best regards Dennis |
Rudy Velthuis [TeamB]
Delphi Developer |
2005-08-29 04:07:33 AM
Re:QC Report on Swap Function
At 21:56:56, 28.08.2005, Max writes:
Quote>Anyway, the -- Rudy Velthuis [TeamB] velthuis.homepage.t-online.de "You'll notice that Nancy Reagan never drinks water when Ronnie speaks." -- Robin Williams. |
Dennis
Delphi Developer |
2005-08-29 06:21:13 PM
Re:QC Report on Swap Function
Hi All
I suggest that we create two new QC reports. One requesting the outdated Swap to be removed. One requesting a complete set of new Swap functions as described elsewhere in this thread. Do you find this a good idea? Best regards Dennis |
John Herbster
Delphi Developer |
2005-08-29 07:38:14 PM
Re:QC Report on Swap FunctionQuoteI suggest that we create two new QC reports. |
Rudy Velthuis [TeamB]
Delphi Developer |
2005-08-29 08:03:28 PM
Re:QC Report on Swap Function
At 12:21:13, 29.08.2005, Dennis writes:
QuoteHi All Rudy Velthuis [TeamB] velthuis.homepage.t-online.de "Hell is other people." - Jean-Paul Sartre (1905-1980) |
Kristofer Skaug
Delphi Developer |
2005-08-30 03:55:29 AM
Re:QC Report on Swap Function
Max writes:
QuoteBorland should remove such old stuff left from TP days -- Kristofer |
Kristofer Skaug
Delphi Developer |
2005-08-30 03:57:11 AM
Re:QC Report on Swap Function
Rudy Velthuis [TeamB] writes:
Quote> -- Kristofer |
Kristofer Skaug
Delphi Developer |
2005-08-30 03:59:29 AM
Re:QC Report on Swap Function
Dennis writes:
Quote
QuoteOne requesting a complete set of new Swap functions as described -- Kristofer |
Rudy Velthuis [TeamB]
Delphi Developer |
2005-08-30 04:09:57 AM
Re:QC Report on Swap Function
At 21:57:11, 29.08.2005, Kristofer Skaug writes:
QuoteRudy Velthuis [TeamB] writes: -- Rudy Velthuis [TeamB] velthuis.homepage.t-online.de "We are not retreating - we are advancing in another Direction." -- General Douglas MacArthur (1880-1964) |