www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1763] New: EndianStream doesn't handle ubyte/byte read/writes. Simple fix.

reply d-bugmail puremagic.com writes:

           Summary: EndianStream doesn't handle ubyte/byte read/writes.
                    Simple fix.
           Product: D
           Version: 1.015
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: kede0309 gmail.com


Can we add the following to EndianStream for completeness?

 void read(out byte x) { readExact(&x, x.sizeof); }
 void read(out ubyte x) { readExact(&x, x.sizeof); }

 void write(out byte x) { writeExact(&x, x.sizeof); }
 void write(out ubyte x) { writeExact(&x, x.sizeof); }

otherwise code such as the following won't compile without a fudge:

  s = new EndianStream(stream);
  byte b;
  ubyte ub;

Keep up the good work.

Jan 01 2008
parent d-bugmail puremagic.com writes:

bugzilla digitalmars.com changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

------- Comment #1 from bugzilla digitalmars.com  2008-09-03 01:39 -------
Fixed dmd 1.035

Sep 02 2008