Mercurial > projects > ldc
comparison dmd/mtype.c @ 1133:eeb8b95ea92e
Cleanup DMD 1.041 merge.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Mon, 23 Mar 2009 20:26:33 +0100 |
parents | e7f0c2b48047 |
children | 1860414bf3b7 |
comparison
equal
deleted
inserted
replaced
1132:76e72fdef04d | 1133:eeb8b95ea92e |
---|---|
13 | 13 |
14 #if (defined (__SVR4) && defined (__sun)) | 14 #if (defined (__SVR4) && defined (__sun)) |
15 #include <alloca.h> | 15 #include <alloca.h> |
16 #endif | 16 #endif |
17 | 17 |
18 #include <cmath> | 18 #include <math.h> |
19 | 19 |
20 #include <stdio.h> | 20 #include <stdio.h> |
21 #include <assert.h> | 21 #include <assert.h> |
22 #include <float.h> | 22 #include <float.h> |
23 | 23 |
1739 sz = n2; | 1739 sz = n2; |
1740 } | 1740 } |
1741 return sz; | 1741 return sz; |
1742 | 1742 |
1743 Loverflow: | 1743 Loverflow: |
1744 error(loc, "index %lld overflow for static array", sz); | 1744 error(loc, "index %jd overflow for static array", sz); |
1745 return 1; | 1745 return 1; |
1746 } | 1746 } |
1747 | 1747 |
1748 unsigned TypeSArray::alignsize() | 1748 unsigned TypeSArray::alignsize() |
1749 { | 1749 { |
1807 uinteger_t d = dim->toUInteger(); | 1807 uinteger_t d = dim->toUInteger(); |
1808 | 1808 |
1809 sc = sc->pop(); | 1809 sc = sc->pop(); |
1810 | 1810 |
1811 if (d >= td->objects->dim) | 1811 if (d >= td->objects->dim) |
1812 { error(loc, "tuple index %llu exceeds %u", d, td->objects->dim); | 1812 { error(loc, "tuple index %ju exceeds %u", d, td->objects->dim); |
1813 goto Ldefault; | 1813 goto Ldefault; |
1814 } | 1814 } |
1815 Object *o = (Object *)td->objects->data[(size_t)d]; | 1815 Object *o = (Object *)td->objects->data[(size_t)d]; |
1816 if (o->dyncast() == DYNCAST_DSYMBOL) | 1816 if (o->dyncast() == DYNCAST_DSYMBOL) |
1817 { | 1817 { |
1861 dim = semanticLength(sc, sd, dim); | 1861 dim = semanticLength(sc, sd, dim); |
1862 dim = dim->optimize(WANTvalue | WANTinterpret); | 1862 dim = dim->optimize(WANTvalue | WANTinterpret); |
1863 uinteger_t d = dim->toUInteger(); | 1863 uinteger_t d = dim->toUInteger(); |
1864 | 1864 |
1865 if (d >= sd->objects->dim) | 1865 if (d >= sd->objects->dim) |
1866 { error(loc, "tuple index %llu exceeds %u", d, sd->objects->dim); | 1866 { error(loc, "tuple index %ju exceeds %u", d, sd->objects->dim); |
1867 return Type::terror; | 1867 return Type::terror; |
1868 } | 1868 } |
1869 Object *o = (Object *)sd->objects->data[(size_t)d]; | 1869 Object *o = (Object *)sd->objects->data[(size_t)d]; |
1870 if (o->dyncast() != DYNCAST_TYPE) | 1870 if (o->dyncast() != DYNCAST_TYPE) |
1871 { error(loc, "%s is not a type", toChars()); | 1871 { error(loc, "%s is not a type", toChars()); |