Mercurial > projects > ldc
diff dmd/expression.c @ 305:2b72433d5c8c trunk
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
Fixed problems with label collisions when using labels inside inline asm. LabelStatement is now easily reached given its
Identifier, which should be useful elsewhere too.
Enabled inline asm for building the lib/compiler/llvmdc runtime code, fixing branches out of asm makes this possible.
author | lindquist |
---|---|
date | Fri, 27 Jun 2008 22:04:35 +0200 |
parents | 297690b5d4a5 |
children | 7086a84ab3d6 |
line wrap: on
line diff
--- a/dmd/expression.c Wed Jun 25 23:42:38 2008 +0200 +++ b/dmd/expression.c Fri Jun 27 22:04:35 2008 +0200 @@ -405,7 +405,7 @@ size_t nparams = Argument::dim(tf->parameters); if (nargs > nparams && tf->varargs == 0) - error(loc, "expected %zu arguments, not %zu", nparams, nargs); + error(loc, "expected %"PRIuSIZE" arguments, not %"PRIuSIZE, nparams, nargs); n = (nargs > nparams) ? nargs : nparams; // n = max(nargs, nparams) @@ -429,7 +429,7 @@ { if (tf->varargs == 2 && i + 1 == nparams) goto L2; - error(loc, "expected %zu arguments, not %zu", nparams, nargs); + error(loc, "expected %"PRIuSIZE" arguments, not %"PRIuSIZE, nparams, nargs); break; } arg = p->defaultArg->copy(); @@ -443,7 +443,7 @@ if (arg->implicitConvTo(p->type)) { if (nargs != nparams) - error(loc, "expected %zu arguments, not %zu", nparams, nargs); + error(loc, "expected %"PRIuSIZE" arguments, not %"PRIuSIZE, nparams, nargs); goto L1; } L2: @@ -1050,8 +1050,7 @@ return Expression::toChars(); #else static char buffer[sizeof(value) * 3 + 1]; - - sprintf(buffer, "%jd", value); + sprintf(buffer, "%lld", value); return buffer; #endif } @@ -1228,11 +1227,11 @@ break; case Tint64: - buf->printf("%jdL", v); + buf->printf("%lldL", v); break; case Tuns64: - buf->printf("%juLU", v); + buf->printf("%lluLU", v); break; case Tbit: @@ -1254,17 +1253,17 @@ } } else if (v & 0x8000000000000000LL) - buf->printf("0x%jx", v); + buf->printf("0x%llx", v); else - buf->printf("%jd", v); + buf->printf("%lld", v); } void IntegerExp::toMangleBuffer(OutBuffer *buf) { if ((sinteger_t)value < 0) - buf->printf("N%jd", -value); + buf->printf("N%lld", -value); else - buf->printf("%jd", value); + buf->printf("%lld", value); } /******************************** RealExp **************************/ @@ -6469,7 +6468,7 @@ } else { - error("string slice [%ju .. %ju] is out of bounds", i1, i2); + error("string slice [%llu .. %llu] is out of bounds", i1, i2); e = e1; } return e; @@ -6828,9 +6827,9 @@ } else { - error("array index [%ju] is outside array bounds [0 .. %zu]", - index, length); - e = e1; + error("array index [%llu] is outside array bounds [0 .. %"PRIuSIZE"]", + index, length); + e = e1; } break; }