changeset 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 76e72fdef04d
children 152bd2c804d0
files dmd/access.c dmd/cast.c dmd/declaration.h dmd/doc.c dmd/dump.c dmd/expression.c dmd/func.c dmd/init.c dmd/init.h dmd/lstring.c dmd/mangle.c dmd/mars.c dmd/module.c dmd/mtype.c dmd/opover.c dmd/root.h dmd/statement.c
diffstat 17 files changed, 33 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/access.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/access.c	Mon Mar 23 20:26:33 2009 +0100
@@ -257,7 +257,7 @@
     }
 }
 
-/****************************************   
+/****************************************
  * Determine if this is the same or friend of cd.
  */
 
--- a/dmd/cast.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/cast.c	Mon Mar 23 20:26:33 2009 +0100
@@ -55,8 +55,8 @@
 	    }
 	    else
 	    {
-		warning("%s: implicit conversion of expression (%s) of type %s to %s can cause loss of data",
-		    loc.toChars(), toChars(), type->toChars(), t->toChars());
+		warning("implicit conversion of expression (%s) of type %s to %s can cause loss of data",
+		    toChars(), type->toChars(), t->toChars());
 	    }
 	}
 #if DMDV2
--- a/dmd/declaration.h	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/declaration.h	Mon Mar 23 20:26:33 2009 +0100
@@ -634,7 +634,7 @@
     void toDocBuffer(OutBuffer *buf);
 
 // LDC: give argument types to runtime functions
-    static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, char *name);
+    static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, const char *name);
     static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, Identifier *id);
 
     Symbol *toSymbol();
--- a/dmd/doc.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/doc.c	Mon Mar 23 20:26:33 2009 +0100
@@ -17,7 +17,6 @@
 #include <assert.h>
 
 #include "rmem.h"
-
 #include "root.h"
 
 #include "mars.h"
--- a/dmd/dump.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/dump.c	Mon Mar 23 20:26:33 2009 +0100
@@ -52,7 +52,7 @@
 void IntegerExp::dump(int i)
 {
     indent(i);
-    printf("%p %lld type=%s\n", this, (long long)value, type_print(type));
+    printf("%p %jd type=%s\n", this, (intmax_t)value, type_print(type));
 }
 
 void IdentifierExp::dump(int i)
--- a/dmd/expression.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/expression.c	Mon Mar 23 20:26:33 2009 +0100
@@ -708,7 +708,6 @@
 	    }
 #endif
 
-
 	    // Convert lazy argument to a delegate
 	    if (p->storageClass & STClazy)
 	    {
--- a/dmd/func.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/func.c	Mon Mar 23 20:26:33 2009 +0100
@@ -2043,7 +2043,7 @@
 // LDC: Adjusted to give argument info to the runtime function decl.
 //
 
-FuncDeclaration *FuncDeclaration::genCfunc(Arguments *args, Type *treturn, char *name)
+FuncDeclaration *FuncDeclaration::genCfunc(Arguments *args, Type *treturn, const char *name)
 {
     return genCfunc(args, treturn, Lexer::idPool(name));
 }
--- a/dmd/init.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/init.c	Mon Mar 23 20:26:33 2009 +0100
@@ -384,7 +384,7 @@
     }
     unsigned long amax = 0x80000000;
     if ((unsigned long) dim * t->next->size() >= amax)
-	error(loc, "array dimension %u exceeds max of %llu", dim, amax / t->next->size());
+	error(loc, "array dimension %u exceeds max of %ju", dim, amax / t->next->size());
     return this;
 }
 
--- a/dmd/init.h	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/init.h	Mon Mar 23 20:26:33 2009 +0100
@@ -26,7 +26,6 @@
 struct StructInitializer;
 struct ArrayInitializer;
 struct ExpInitializer;
-struct StructInitializer;
 #ifdef _DH
 struct HdrGenState;
 #endif
@@ -85,7 +84,7 @@
 
     dt_t *toDt();
 
-    StructInitializer  *isStructInitializer()  { return this; }
+    StructInitializer *isStructInitializer() { return this; }
 };
 
 struct ArrayInitializer : Initializer
--- a/dmd/lstring.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/lstring.c	Mon Mar 23 20:26:33 2009 +0100
@@ -14,7 +14,11 @@
 #include "rmem.h"
 #include "lstring.h"
 
+#ifdef _MSC_VER // prevent compiler internal crash
+Lstring Lstring::zero;
+#else
 Lstring Lstring::zero = LSTRING_EMPTY();
+#endif
 
 Lstring *Lstring::ctor(const dchar *p, unsigned length)
 {
--- a/dmd/mangle.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/mangle.c	Mon Mar 23 20:26:33 2009 +0100
@@ -155,11 +155,11 @@
 	if (isMain())
 	    return (char *)"_Dmain";
 
-    if (isWinMain() || isDllMain())
-        return ident->toChars();
+	if (isWinMain() || isDllMain())
+	    return ident->toChars();
 
-    assert(this);
-    return Declaration::mangle();
+	assert(this);
+	return Declaration::mangle();
     }
 
 char *StructDeclaration::mangle()
--- a/dmd/mars.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/mars.c	Mon Mar 23 20:26:33 2009 +0100
@@ -59,7 +59,7 @@
 
     copyright = "Copyright (c) 1999-2009 by Digital Mars and Tomas Lindquist Olsen";
     written = "written by Walter Bright and Tomas Lindquist Olsen";
-    version = "v1.039";
+    version = "v1.041";
     ldc_version = LDC_REV;
     llvm_version = LLVM_REV_STR;
     global.structalign = 8;
--- a/dmd/module.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/module.c	Mon Mar 23 20:26:33 2009 +0100
@@ -16,7 +16,7 @@
 #include <alloca.h>
 #endif
 
-#if _MSC_VER || __MINGW32__
+#if defined(_MSC_VER) || defined(__MINGW32__)
 #include <malloc.h>
 #endif
 
@@ -566,7 +566,7 @@
     }
 
 #ifdef IN_GCC
-    // dump utf-8 encoded source
+    // dump utf-8 encoded source 
     if (dump_source)
     {	// %% srcname could contain a path ...
 	d_gcc_dump_source(srcname, "utf-8", buf, buflen);
--- a/dmd/mtype.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/mtype.c	Mon Mar 23 20:26:33 2009 +0100
@@ -15,7 +15,7 @@
 #include <alloca.h>
 #endif
 
-#include <cmath>
+#include <math.h>
 
 #include <stdio.h>
 #include <assert.h>
@@ -1741,7 +1741,7 @@
     return sz;
 
 Loverflow:
-    error(loc, "index %lld overflow for static array", sz);
+    error(loc, "index %jd overflow for static array", sz);
     return 1;
 }
 
@@ -1809,7 +1809,7 @@
 	    sc = sc->pop();
 
 	    if (d >= td->objects->dim)
-	    {	error(loc, "tuple index %llu exceeds %u", d, td->objects->dim);
+	    {	error(loc, "tuple index %ju exceeds %u", d, td->objects->dim);
 		goto Ldefault;
 	    }
 	    Object *o = (Object *)td->objects->data[(size_t)d];
@@ -1863,7 +1863,7 @@
 	uinteger_t d = dim->toUInteger();
 
 	if (d >= sd->objects->dim)
-	{   error(loc, "tuple index %llu exceeds %u", d, sd->objects->dim);
+	{   error(loc, "tuple index %ju exceeds %u", d, sd->objects->dim);
 	    return Type::terror;
 	}
 	Object *o = (Object *)sd->objects->data[(size_t)d];
--- a/dmd/opover.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/opover.c	Mon Mar 23 20:26:33 2009 +0100
@@ -12,7 +12,11 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <assert.h>
+#if _MSC_VER
 #include <complex>
+#else
+#include <complex>
+#endif
 
 #ifdef __APPLE__
 #define integer_t dmd_integer_t
--- a/dmd/root.h	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/root.h	Mon Mar 23 20:26:33 2009 +0100
@@ -38,6 +38,12 @@
 
 #if _MSC_VER
 #include <float.h>  // for _isnan
+#include <malloc.h> // for alloca
+// According to VC 8.0 docs, long double is the same as double
+#define strtold strtod
+#define strtof  strtod
+#define isnan   _isnan
+
 typedef __int64 longlong;
 typedef unsigned __int64 ulonglong;
 #else
--- a/dmd/statement.c	Mon Mar 23 14:47:51 2009 +0100
+++ b/dmd/statement.c	Mon Mar 23 20:26:33 2009 +0100
@@ -1647,7 +1647,6 @@
             flde->type = fldeTy;
         }
 		exps->push(flde);
-
 		e = new CallExp(loc, ec, exps);
 		e->type = Type::tindex;	// don't run semantic() on e
 	    }
@@ -1712,7 +1711,6 @@
             flde->type = dgty;
         }
 		exps->push(flde);
-
 		e = new CallExp(loc, ec, exps);
 		e->type = Type::tindex;	// don't run semantic() on e
 	    }