Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #926 (closed defect: fixed)

Opened 5 months ago

Last modified 4 months ago

core.ByteSwap.swap80 is broken -- assumes x86 Windows

Reported by: Don Clugston Assigned to: kris
Priority: major Milestone: 0.99.6
Component: Core Functionality Version: 0.99.4 Frank
Keywords: Cc:

Description

Although it states that it 'reverses 10-byte sequences', it uses real.sizeof to increment its pointers. Real.sizeof is 10 only for Windows, so an infinite loop will happen anywhere else (real.sizeof = 12 for Linux32, 16 for Linux64 and Sparc, 8 for most other platforms). At least one of *the documentation, * the code, or *the assert is wrong.

Change History

02/18/08 14:14:29 changed by kris

  • owner changed from sean to kris.
  • status changed from new to assigned.

Yeah, that blows. Thanks Don

02/19/08 03:16:13 changed by kris

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [3229]) fixes #926. Thanks Don :)

02/22/08 05:12:48 changed by Cyborg16

  • status changed from closed to reopened.
  • resolution deleted.

Uh... then some other functionality is needed for other platforms, e.g. in io/protocol/EndianProtocol?

Anyway I was told the old implementation was right for linux since the last two bytes are just padded. See here. Made sense (apart from the inappropriate name & doc).

02/29/08 07:18:25 changed by Cyborg16

I'm not sure if I should apologise for acting somewhat childishly here. If you feel I have, then please accept my apology. I don't doubt your know what you're doing with tango.

(Really, I'm confused as to why in some places a real appears to always be implemented as a 10-byte quantity and in others as whatever the CPU supports.)

02/29/08 10:23:23 changed by Don Clugston

  • status changed from reopened to closed.
  • resolution set to fixed.

You're not alone in your confusion. The semantics of real need to be worked out. For example, it's not clear whether 'doubledouble' (eg on PowerPC) is allowed to be real, since it doesn't quite satisfy all of the IEEE requirements.