From 5226368324b65063fd2e65facf5d0e3c65f7991f Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 7 Apr 2021 12:53:53 +0200 Subject: [PATCH] Remove support for formatting complex and imaginary types --- src/undead/doformat.d | 39 --------------------------------------- src/undead/stream.d | 36 ------------------------------------ 2 files changed, 75 deletions(-) diff --git a/src/undead/doformat.d b/src/undead/doformat.d index 7705982..10f4f93 100644 --- a/src/undead/doformat.d +++ b/src/undead/doformat.d @@ -74,13 +74,6 @@ enum Mangle : char Tdouble = 'd', Treal = 'e', - Tifloat = 'o', - Tidouble = 'p', - Tireal = 'j', - Tcfloat = 'q', - Tcdouble = 'r', - Tcreal = 'c', - Tchar = 'a', Twchar = 'u', Tdchar = 'w', @@ -125,12 +118,6 @@ private TypeInfo primitiveTypeInfo(Mangle m) Mangle.Tfloat : typeid(float), Mangle.Tdouble : typeid(double), Mangle.Treal : typeid(real), - Mangle.Tifloat : typeid(ifloat), - Mangle.Tidouble : typeid(idouble), - Mangle.Tireal : typeid(ireal), - Mangle.Tcfloat : typeid(cfloat), - Mangle.Tcdouble : typeid(cdouble), - Mangle.Tcreal : typeid(creal), Mangle.Tchar : typeid(char), Mangle.Twchar : typeid(wchar), Mangle.Tdchar : typeid(dchar) @@ -491,7 +478,6 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a dchar vdchar; Object vobject; real vreal; - creal vcreal; Mangle m2; int signed = 0; uint base = 10; @@ -824,36 +810,21 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a goto Lnumber; case Mangle.Tfloat: - case Mangle.Tifloat: if (fc == 'x' || fc == 'X') goto Luint; vreal = getArg!(float)(); goto Lreal; case Mangle.Tdouble: - case Mangle.Tidouble: if (fc == 'x' || fc == 'X') goto Lulong; vreal = getArg!(double)(); goto Lreal; case Mangle.Treal: - case Mangle.Tireal: vreal = getArg!(real)(); goto Lreal; - case Mangle.Tcfloat: - vcreal = getArg!(cfloat)(); - goto Lcomplex; - - case Mangle.Tcdouble: - vcreal = getArg!(cdouble)(); - goto Lcomplex; - - case Mangle.Tcreal: - vcreal = getArg!(creal)(); - goto Lcomplex; - case Mangle.Tsarray: putArray(argptr, (cast(TypeInfo_StaticArray)ti).len, (cast(TypeInfo_StaticArray)ti).next); return; @@ -1066,16 +1037,6 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a putreal(vreal); return; - Lcomplex: - putreal(vcreal.re); - if (vcreal.im >= 0) - { - putc('+'); - } - putreal(vcreal.im); - putc('i'); - return; - Lerror: throw new FormatException("formatArg"); } diff --git a/src/undead/stream.d b/src/undead/stream.d index b02d963..15cc1e0 100644 --- a/src/undead/stream.d +++ b/src/undead/stream.d @@ -126,12 +126,6 @@ interface InputStream { void read(out float x); /// ditto void read(out double x); /// ditto void read(out real x); /// ditto - void read(out ifloat x); /// ditto - void read(out idouble x); /// ditto - void read(out ireal x); /// ditto - void read(out cfloat x); /// ditto - void read(out cdouble x); /// ditto - void read(out creal x); /// ditto void read(out char x); /// ditto void read(out wchar x); /// ditto void read(out dchar x); /// ditto @@ -288,12 +282,6 @@ interface OutputStream { void write(float x); /// ditto void write(double x); /// ditto void write(real x); /// ditto - void write(ifloat x); /// ditto - void write(idouble x); /// ditto - void write(ireal x); /// ditto - void write(cfloat x); /// ditto - void write(cdouble x); /// ditto - void write(creal x); /// ditto void write(char x); /// ditto void write(wchar x); /// ditto void write(dchar x); /// ditto @@ -447,12 +435,6 @@ class Stream : InputStream, OutputStream { void read(out float x) { readExact(&x, x.sizeof); } void read(out double x) { readExact(&x, x.sizeof); } void read(out real x) { readExact(&x, x.sizeof); } - void read(out ifloat x) { readExact(&x, x.sizeof); } - void read(out idouble x) { readExact(&x, x.sizeof); } - void read(out ireal x) { readExact(&x, x.sizeof); } - void read(out cfloat x) { readExact(&x, x.sizeof); } - void read(out cdouble x) { readExact(&x, x.sizeof); } - void read(out creal x) { readExact(&x, x.sizeof); } void read(out char x) { readExact(&x, x.sizeof); } void read(out wchar x) { readExact(&x, x.sizeof); } void read(out dchar x) { readExact(&x, x.sizeof); } @@ -1113,12 +1095,6 @@ class Stream : InputStream, OutputStream { void write(float x) { writeExact(&x, x.sizeof); } void write(double x) { writeExact(&x, x.sizeof); } void write(real x) { writeExact(&x, x.sizeof); } - void write(ifloat x) { writeExact(&x, x.sizeof); } - void write(idouble x) { writeExact(&x, x.sizeof); } - void write(ireal x) { writeExact(&x, x.sizeof); } - void write(cfloat x) { writeExact(&x, x.sizeof); } - void write(cdouble x) { writeExact(&x, x.sizeof); } - void write(creal x) { writeExact(&x, x.sizeof); } void write(char x) { writeExact(&x, x.sizeof); } void write(wchar x) { writeExact(&x, x.sizeof); } void write(dchar x) { writeExact(&x, x.sizeof); } @@ -2469,12 +2445,6 @@ class EndianStream : FilterStream { override void read(out float x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } override void read(out double x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } override void read(out real x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } - override void read(out ifloat x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } - override void read(out idouble x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } - override void read(out ireal x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } - override void read(out cfloat x) { readExact(&x, x.sizeof); fixBlockBO(&x,float.sizeof,2); } - override void read(out cdouble x) { readExact(&x, x.sizeof); fixBlockBO(&x,double.sizeof,2); } - override void read(out creal x) { readExact(&x, x.sizeof); fixBlockBO(&x,real.sizeof,2); } override void read(out char x) { readExact(&x, x.sizeof); } override void read(out wchar x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } override void read(out dchar x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); } @@ -2524,12 +2494,6 @@ class EndianStream : FilterStream { override void write(float x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } override void write(double x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } override void write(real x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } - override void write(ifloat x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } - override void write(idouble x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } - override void write(ireal x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } - override void write(cfloat x) { fixBlockBO(&x,float.sizeof,2); writeExact(&x, x.sizeof); } - override void write(cdouble x) { fixBlockBO(&x,double.sizeof,2); writeExact(&x, x.sizeof); } - override void write(creal x) { fixBlockBO(&x,real.sizeof,2); writeExact(&x, x.sizeof); } override void write(char x) { writeExact(&x, x.sizeof); } override void write(wchar x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); } override void write(dchar x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }