Mercurial > projects > ldc
comparison tests/mini/vararg6.d @ 968:a9feaed801d7
Fix {,w,d}char handling in tests/mini/vararg6.d:print()
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Mon, 16 Feb 2009 19:31:10 +0100 |
parents | cc40db549aea |
children | 0a5f7890f327 |
comparison
equal
deleted
inserted
replaced
967:926c1d06c7ec | 968:a9feaed801d7 |
---|---|
144 printf("%f", *cast(double*)arg); | 144 printf("%f", *cast(double*)arg); |
145 else if (ti == typeid(real)) | 145 else if (ti == typeid(real)) |
146 printf("%llf", *cast(real*)arg); | 146 printf("%llf", *cast(real*)arg); |
147 | 147 |
148 else if (ti == typeid(char)) | 148 else if (ti == typeid(char)) |
149 printf("%.*s", 1, arg); | 149 printf("%c", *cast(char*)arg); |
150 else if (ti == typeid(wchar)) | 150 else if (ti == typeid(wchar)) |
151 printf("%.*s", 2, arg); | 151 foreach (char c; (cast(wchar*)arg)[0..1]) |
152 printf("%c", c); | |
152 else if (ti == typeid(dchar)) | 153 else if (ti == typeid(dchar)) |
153 printf("%.*s", 4, arg); | 154 foreach (char c; (cast(dchar*)arg)[0..1]) |
155 printf("%c", c); | |
154 | 156 |
155 else if (ti == typeid(char[])) | 157 else if (ti == typeid(char[])) |
156 { | 158 { |
157 char[] str = *cast(char[]*)arg; | 159 char[] str = *cast(char[]*)arg; |
158 printf("%.*s", str.length, str.ptr); | 160 printf("%.*s", str.length, str.ptr); |