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:
http://d.puremagic.com/issues/show_bug.cgi?id=1763

           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


Hi,

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;
  s.read(b);
  s.read(ub);


Keep up the good work.
Scott


-- 
Jan 01 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1763


bugzilla digitalmars.com changed:

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





Fixed dmd 1.035


-- 
Sep 02 2008