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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 1 23:38:38 PST 2008


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 at digitalmars.com
        ReportedBy: kede0309 at 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


-- 



More information about the Digitalmars-d-bugs mailing list