Skip to content

Commit 9a7b2ad

Browse files
authored
Merge pull request #44 from ibuclaw/rmcomplex
Remove support for formatting complex and imaginary types
2 parents 7d6d0b6 + 5226368 commit 9a7b2ad

File tree

2 files changed

+0
-75
lines changed

2 files changed

+0
-75
lines changed

src/undead/doformat.d

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ enum Mangle : char
7474
Tdouble = 'd',
7575
Treal = 'e',
7676

77-
Tifloat = 'o',
78-
Tidouble = 'p',
79-
Tireal = 'j',
80-
Tcfloat = 'q',
81-
Tcdouble = 'r',
82-
Tcreal = 'c',
83-
8477
Tchar = 'a',
8578
Twchar = 'u',
8679
Tdchar = 'w',
@@ -125,12 +118,6 @@ private TypeInfo primitiveTypeInfo(Mangle m)
125118
Mangle.Tfloat : typeid(float),
126119
Mangle.Tdouble : typeid(double),
127120
Mangle.Treal : typeid(real),
128-
Mangle.Tifloat : typeid(ifloat),
129-
Mangle.Tidouble : typeid(idouble),
130-
Mangle.Tireal : typeid(ireal),
131-
Mangle.Tcfloat : typeid(cfloat),
132-
Mangle.Tcdouble : typeid(cdouble),
133-
Mangle.Tcreal : typeid(creal),
134121
Mangle.Tchar : typeid(char),
135122
Mangle.Twchar : typeid(wchar),
136123
Mangle.Tdchar : typeid(dchar)
@@ -491,7 +478,6 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a
491478
dchar vdchar;
492479
Object vobject;
493480
real vreal;
494-
creal vcreal;
495481
Mangle m2;
496482
int signed = 0;
497483
uint base = 10;
@@ -824,36 +810,21 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a
824810
goto Lnumber;
825811

826812
case Mangle.Tfloat:
827-
case Mangle.Tifloat:
828813
if (fc == 'x' || fc == 'X')
829814
goto Luint;
830815
vreal = getArg!(float)();
831816
goto Lreal;
832817

833818
case Mangle.Tdouble:
834-
case Mangle.Tidouble:
835819
if (fc == 'x' || fc == 'X')
836820
goto Lulong;
837821
vreal = getArg!(double)();
838822
goto Lreal;
839823

840824
case Mangle.Treal:
841-
case Mangle.Tireal:
842825
vreal = getArg!(real)();
843826
goto Lreal;
844827

845-
case Mangle.Tcfloat:
846-
vcreal = getArg!(cfloat)();
847-
goto Lcomplex;
848-
849-
case Mangle.Tcdouble:
850-
vcreal = getArg!(cdouble)();
851-
goto Lcomplex;
852-
853-
case Mangle.Tcreal:
854-
vcreal = getArg!(creal)();
855-
goto Lcomplex;
856-
857828
case Mangle.Tsarray:
858829
putArray(argptr, (cast(TypeInfo_StaticArray)ti).len, (cast(TypeInfo_StaticArray)ti).next);
859830
return;
@@ -1066,16 +1037,6 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a
10661037
putreal(vreal);
10671038
return;
10681039

1069-
Lcomplex:
1070-
putreal(vcreal.re);
1071-
if (vcreal.im >= 0)
1072-
{
1073-
putc('+');
1074-
}
1075-
putreal(vcreal.im);
1076-
putc('i');
1077-
return;
1078-
10791040
Lerror:
10801041
throw new FormatException("formatArg");
10811042
}

src/undead/stream.d

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ interface InputStream {
126126
void read(out float x); /// ditto
127127
void read(out double x); /// ditto
128128
void read(out real x); /// ditto
129-
void read(out ifloat x); /// ditto
130-
void read(out idouble x); /// ditto
131-
void read(out ireal x); /// ditto
132-
void read(out cfloat x); /// ditto
133-
void read(out cdouble x); /// ditto
134-
void read(out creal x); /// ditto
135129
void read(out char x); /// ditto
136130
void read(out wchar x); /// ditto
137131
void read(out dchar x); /// ditto
@@ -288,12 +282,6 @@ interface OutputStream {
288282
void write(float x); /// ditto
289283
void write(double x); /// ditto
290284
void write(real x); /// ditto
291-
void write(ifloat x); /// ditto
292-
void write(idouble x); /// ditto
293-
void write(ireal x); /// ditto
294-
void write(cfloat x); /// ditto
295-
void write(cdouble x); /// ditto
296-
void write(creal x); /// ditto
297285
void write(char x); /// ditto
298286
void write(wchar x); /// ditto
299287
void write(dchar x); /// ditto
@@ -447,12 +435,6 @@ class Stream : InputStream, OutputStream {
447435
void read(out float x) { readExact(&x, x.sizeof); }
448436
void read(out double x) { readExact(&x, x.sizeof); }
449437
void read(out real x) { readExact(&x, x.sizeof); }
450-
void read(out ifloat x) { readExact(&x, x.sizeof); }
451-
void read(out idouble x) { readExact(&x, x.sizeof); }
452-
void read(out ireal x) { readExact(&x, x.sizeof); }
453-
void read(out cfloat x) { readExact(&x, x.sizeof); }
454-
void read(out cdouble x) { readExact(&x, x.sizeof); }
455-
void read(out creal x) { readExact(&x, x.sizeof); }
456438
void read(out char x) { readExact(&x, x.sizeof); }
457439
void read(out wchar x) { readExact(&x, x.sizeof); }
458440
void read(out dchar x) { readExact(&x, x.sizeof); }
@@ -1113,12 +1095,6 @@ class Stream : InputStream, OutputStream {
11131095
void write(float x) { writeExact(&x, x.sizeof); }
11141096
void write(double x) { writeExact(&x, x.sizeof); }
11151097
void write(real x) { writeExact(&x, x.sizeof); }
1116-
void write(ifloat x) { writeExact(&x, x.sizeof); }
1117-
void write(idouble x) { writeExact(&x, x.sizeof); }
1118-
void write(ireal x) { writeExact(&x, x.sizeof); }
1119-
void write(cfloat x) { writeExact(&x, x.sizeof); }
1120-
void write(cdouble x) { writeExact(&x, x.sizeof); }
1121-
void write(creal x) { writeExact(&x, x.sizeof); }
11221098
void write(char x) { writeExact(&x, x.sizeof); }
11231099
void write(wchar x) { writeExact(&x, x.sizeof); }
11241100
void write(dchar x) { writeExact(&x, x.sizeof); }
@@ -2469,12 +2445,6 @@ class EndianStream : FilterStream {
24692445
override void read(out float x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
24702446
override void read(out double x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
24712447
override void read(out real x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
2472-
override void read(out ifloat x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
2473-
override void read(out idouble x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
2474-
override void read(out ireal x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
2475-
override void read(out cfloat x) { readExact(&x, x.sizeof); fixBlockBO(&x,float.sizeof,2); }
2476-
override void read(out cdouble x) { readExact(&x, x.sizeof); fixBlockBO(&x,double.sizeof,2); }
2477-
override void read(out creal x) { readExact(&x, x.sizeof); fixBlockBO(&x,real.sizeof,2); }
24782448
override void read(out char x) { readExact(&x, x.sizeof); }
24792449
override void read(out wchar x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
24802450
override void read(out dchar x) { readExact(&x, x.sizeof); fixBO(&x,x.sizeof); }
@@ -2524,12 +2494,6 @@ class EndianStream : FilterStream {
25242494
override void write(float x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
25252495
override void write(double x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
25262496
override void write(real x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
2527-
override void write(ifloat x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
2528-
override void write(idouble x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
2529-
override void write(ireal x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
2530-
override void write(cfloat x) { fixBlockBO(&x,float.sizeof,2); writeExact(&x, x.sizeof); }
2531-
override void write(cdouble x) { fixBlockBO(&x,double.sizeof,2); writeExact(&x, x.sizeof); }
2532-
override void write(creal x) { fixBlockBO(&x,real.sizeof,2); writeExact(&x, x.sizeof); }
25332497
override void write(char x) { writeExact(&x, x.sizeof); }
25342498
override void write(wchar x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
25352499
override void write(dchar x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }

0 commit comments

Comments
 (0)