
Property changes on: src
___________________________________________________________________
Added: svn:ignore
   + id.c
id.h
impcnvtab.c
cdxxx.c
debtab.c
elxxx.c
fltables.c
optab.c
tytab.c


Index: src/init.c
===================================================================
--- src/init.c	(revision 752)
+++ src/init.c	(working copy)
@@ -202,8 +202,8 @@
             if (s && (v = s->isVarDeclaration()) != NULL)
             {
                 val = val->semantic(sc, v->type);
-                value.data[i] = (void *)val;
-                vars.data[i] = (void *)v;
+                value.data[i] = val;
+                vars.data[i] = v;
             }
             else
             {   error(loc, "%s is not a field of %s", id ? id->toChars() : s->toChars(), ad->toChars());
@@ -376,7 +376,7 @@
 
         Initializer *val = (Initializer *)value.data[i];
         val = val->semantic(sc, t->nextOf());
-        value.data[i] = (void *)val;
+        value.data[i] = val;
         length++;
         if (length == 0)
         {   error(loc, "array dimension overflow");
Index: src/statement.c
===================================================================
--- src/statement.c	(revision 752)
+++ src/statement.c	(working copy)
@@ -1811,7 +1811,7 @@
                 {   // 'Promote' it to this scope, and replace with a return
                     cases->push(gs);
                     s = new ReturnStatement(0, new IntegerExp(cases->dim + 1));
-                    cs->statements->data[0] = (void *)s;
+                    cs->statements->data[0] = s;
                 }
             }
 
Index: src/backend/el.c
===================================================================
--- src/backend/el.c	(revision 752)
+++ src/backend/el.c	(working copy)
@@ -3028,7 +3028,7 @@
  */
 
 targ_ldouble el_toldouble(elem *e)
-{   targ_ldouble result;
+{   targ_ldouble result = 0;
 
     elem_debug(e);
     assert(cnst(e));
Index: src/backend/out.c
===================================================================
--- src/backend/out.c	(revision 752)
+++ src/backend/out.c	(working copy)
@@ -1277,6 +1277,7 @@
         blockopt(0);                    /* optimize                     */
     }
 
+#if SCPP
     if (CPP)
     {
         // Look for any blocks that return nothing.
@@ -1302,6 +1303,7 @@
                 func_noreturnvalue();
         }
     }
+#endif
     assert(funcsym_p == sfunc);
     if (eecontext.EEcompile != 1)
     {
Index: src/backend/os.c
===================================================================
--- src/backend/os.c	(revision 752)
+++ src/backend/os.c	(working copy)
@@ -40,7 +40,7 @@
 #include        <windows.h>
 #endif
 
-#if __DMC__ || __GNUC__
+#if __DMC__ || __GNUC__ || _MSC_VER
 static char __file__[] = __FILE__;      /* for tassert.h                */
 #include        "tassert.h"
 #else
@@ -678,7 +678,7 @@
 
 long os_file_size(int fd)
 {
-#if _WIN32
+#if _WIN32 && !defined(_MSC_VER)
     return GetFileSize(_osfhnd[fd],NULL);
 #else
     struct stat buf;
Index: src/backend/newman.c
===================================================================
--- src/backend/newman.c	(revision 752)
+++ src/backend/newman.c	(working copy)
@@ -194,7 +194,7 @@
  * Convert from identifier to operator
  */
 
-#if __GNUC__    // NOT DONE - FIX
+#if __GNUC__ || _MSC_VER   // NOT DONE - FIX
 char * unmangle_pt(const char **s)
 {
     return (char *)*s;
Index: src/backend/md5.h
===================================================================
--- src/backend/md5.h	(revision 752)
+++ src/backend/md5.h	(working copy)
@@ -48,10 +48,18 @@
   unsigned char digest[16];     /* actual digest after MD5Final call */
 } MD5_CTX;
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 void MD5Init (MD5_CTX *mdContext);
 void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned inLen);
 void MD5Final (MD5_CTX *mdContext);
 
+#ifdef  __cplusplus
+}
+#endif
+
 /*
  **********************************************************************
  ** End of md5.h                                                     **
Index: src/backend/cdef.h
===================================================================
--- src/backend/cdef.h	(revision 752)
+++ src/backend/cdef.h	(working copy)
@@ -228,7 +228,7 @@
 
 #if __GNUC__
 #define LONGLONG        1
-#elif __SC__ < 0x700 || _MSC_VER
+#elif defined(__SC__) && __SC__ < 0x700
 #define LONGLONG        0
 #else
 #define LONGLONG        1               // add in code to support 64 bit integral types
Index: src/backend/cgobj.c
===================================================================
--- src/backend/cgobj.c	(revision 752)
+++ src/backend/cgobj.c	(working copy)
@@ -1141,7 +1141,7 @@
 STATIC void obj_defaultlib()
 {
     char library[4];            // default library
-    static const char model[MEMMODELS] = "SMCLV";
+    static const char model[MEMMODELS + 1] = "SMCLV";
 
 #if MARS
     memcpy(library,"SM?",4);
@@ -1262,7 +1262,7 @@
 
 void obj_compiler()
 {
-    static const char compiler[] = "\0\xDBDigital Mars C/C++"
+    static const char compiler[] = "\0\xDB" "Digital Mars C/C++"
         VERSION
         ;       // compiled by ...
 
@@ -1290,7 +1290,7 @@
   int texti = 8;                                // index of _TEXT
 
   static char comment[] = {0,0x9D,'0','?','O'}; // memory model
-  static char model[MEMMODELS] = "smclv";
+  static char model[MEMMODELS + 1] = "smclv";
   static char exten[] = {0,0xA1,1,'C','V'};     // extended format
   static char pmdeb[] = {0x80,0xA1,1,'H','L','L',0};    // IBM PM debug format
 
@@ -1606,7 +1606,7 @@
 {
     // We need to always put out the segments in triples, so that the
     // linker will put them in the correct order.
-    static char lnames[4][5+4+5] =
+    static char lnames[4][5+4+5 +1] =
     {   "\03XIB\02XI\03XIE",            // near constructor
         "\03XCB\02XC\03XCE",            // near destructor
         "\04XIFB\03XIF\04XIFE",         // far constructor
@@ -2893,10 +2893,11 @@
  *      nbytes
  */
 
-unsigned obj_bytes(int seg,targ_size_t offset,unsigned nbytes, void *p)
+unsigned obj_bytes(int seg,targ_size_t offset,unsigned nbytes, void *_p)
 {   unsigned n = nbytes;
 
     //dbg_printf("obj_bytes(seg=%d, offset=x%lx, nbytes=x%x, p=%p)\n",seg,offset,nbytes,p);
+	char* p = (char*)_p;
  L1:
     if (
         (seg != obj.ledata->lseg ||                     // and segments don't match
@@ -2909,7 +2910,7 @@
         while (nbytes)
         {   obj_byte(seg,offset,*(char *)p);
             offset++;
-            ((char *)p)++;
+            ((char *)(p))++;
             nbytes--;
             if (obj.ledata->i + nbytes <= LEDATAMAX)
                 goto L1;
Index: src/backend/cod3.c
===================================================================
--- src/backend/cod3.c	(revision 752)
+++ src/backend/cod3.c	(working copy)
@@ -3996,7 +3996,7 @@
 
 #define GEN(c)          (*pgen++ = (c))
 #define GENP(n,p)       (memcpy(pgen,(p),(n)), pgen += (n))
-#if ELFOBJ || MACHOBJ
+#if ELFOBJ || MACHOBJ || _MSC_VER
 #define FLUSH()         if (pgen-bytes) cod3_flush()
 #else
 #define FLUSH()         ((pgen - bytes) && cod3_flush())
Index: src/backend/cc.h
===================================================================
--- src/backend/cc.h	(revision 752)
+++ src/backend/cc.h	(working copy)
@@ -1443,7 +1443,11 @@
 /* Format the identifier for presentation to the user   */
 char *cpp_prettyident (Symbol *s);
 
+#if SCPP
 inline char *prettyident(Symbol *s) { return CPP ? cpp_prettyident(s) : s->Sident; }
+#else
+inline char *prettyident(Symbol *s) { return s->Sident; }
+#endif
 
 /**********************************
  * Function parameters:
Index: src/util.c
===================================================================
--- src/util.c	(revision 752)
+++ src/util.c	(working copy)
@@ -81,7 +81,7 @@
 }
 
 
-#if _WIN32
+#if _WIN32 && !defined(_MSC_VER)
 
 volatile int controlc_saw;
 
@@ -131,7 +131,7 @@
 
 #endif
 
-#if linux || __APPLE__ || __FreeBSD__ || __sun&&__SVR4
+#if linux || __APPLE__ || __FreeBSD__ || __sun&&__SVR4 || _MSC_VER
 void util_progress()
 {
 }
@@ -237,7 +237,7 @@
  * If c is a power of 2, return that power else -1.
  */
 
-int ispow2(unsigned long long c)
+int ispow2(targ_ullong c)
 {       int i;
 
         if (c == 0 || (c & (c - 1)))
Index: src/expression.c
===================================================================
--- src/expression.c	(revision 752)
+++ src/expression.c	(working copy)
@@ -5123,7 +5123,7 @@
 
             Objects tiargs;
             tiargs.setDim(1);
-            tiargs.data[0] = (void *)targ;
+            tiargs.data[0] = targ;
 
             /* Declare trailing parameters
              */
Index: src/libomf.c
===================================================================
--- src/libomf.c	(revision 752)
+++ src/libomf.c	(working copy)
@@ -259,6 +259,7 @@
                 if (easyomf)
                     recTyp = COMDAT+1;          // convert to MS format
             case COMDAT+1:
+			{
                 int pickAny = 0;
 
                 if (*p++ & 5)           // if continuation or local comdat
@@ -290,6 +291,7 @@
 
                 //printf("[s] name='%s'\n",name);
                 addSymbol(om, (char *)names.data[idx],pickAny);
+			}
                 break;
 
             case ALIAS:
@@ -488,10 +490,12 @@
                     om->length = pnext - om->base;
                     om = NULL;
                 }
+				{
                 // Round up to next page
                 unsigned t = pnext - pstart;
                 t = (t + g_page_size - 1) & ~(unsigned)(g_page_size - 1);
                 pnext = pstart + t;
+				}
                 break;
 
             default:
Index: src/inline.c
===================================================================
--- src/inline.c	(revision 752)
+++ src/inline.c	(working copy)
@@ -811,7 +811,7 @@
     for (size_t i = 0; i < statements->dim; i++)
     {   Statement *s = (Statement *) statements->data[i];
         if (s)
-            statements->data[i] = (void *)s->inlineScan(iss);
+            statements->data[i] = s->inlineScan(iss);
     }
     return this;
 }
@@ -821,7 +821,7 @@
     for (size_t i = 0; i < statements->dim; i++)
     {   Statement *s = (Statement *) statements->data[i];
         if (s)
-            statements->data[i] = (void *)s->inlineScan(iss);
+            statements->data[i] = s->inlineScan(iss);
     }
     return this;
 }
Index: src/tocsym.c
===================================================================
--- src/tocsym.c	(revision 752)
+++ src/tocsym.c	(working copy)
@@ -86,8 +86,13 @@
         n += 2;
     }
 #endif
-    id = (char *) alloca(2 + nlen + sizeof(size_t) * 3 + strlen(prefix) + strlen(suffix) + 1);
-    sprintf(id,"_D%s%zu%s%s", n, strlen(prefix), prefix, suffix);
+	size_t	size = 2 + nlen + sizeof(size_t) * 3 + strlen(prefix) + strlen(suffix) + 1;
+    id = (char *) alloca(size);
+#ifdef _MSC_VER
+	sprintf(id,"_D%s%Iu%s%s", n, strlen(prefix), prefix, suffix);
+#else
+	sprintf(id,"_D%s%zu%s%s", n, strlen(prefix), prefix, suffix);
+#endif
 #if 0
     if (global.params.isWindows &&
         (type_mangle(t) == mTYman_c || type_mangle(t) == mTYman_std))
Index: src/module.h
===================================================================
--- src/module.h	(revision 752)
+++ src/module.h	(working copy)
@@ -21,7 +21,7 @@
 struct ModuleInfoDeclaration;
 struct ClassDeclaration;
 struct ModuleDeclaration;
-struct Macro;
+class Macro;
 struct Escape;
 struct VarDeclaration;
 struct Library;
Index: src/func.c
===================================================================
--- src/func.c	(revision 752)
+++ src/func.c	(working copy)
@@ -1059,7 +1059,7 @@
                         VarDeclaration *v = sc2->search(0, narg->ident, NULL)->isVarDeclaration();
                         assert(v);
                         Expression *e = new VarExp(v->loc, v);
-                        exps->data[j] = (void *)e;
+                        exps->data[j] = e;
                     }
                     assert(arg->ident);
                     TupleDeclaration *v = new TupleDeclaration(loc, arg->ident, exps);
Index: src/template.c
===================================================================
--- src/template.c	(revision 752)
+++ src/template.c	(working copy)
@@ -920,13 +920,13 @@
              */
             Tuple *t = new Tuple();
             assert(parameters->dim);
-            dedargs->data[parameters->dim - 1] = (void *)t;
+            dedargs->data[parameters->dim - 1] = t;
 
             tuple_dim = nargsi - n;
             t->objects.setDim(tuple_dim);
             for (size_t i = 0; i < tuple_dim; i++)
             {
-                t->objects.data[i] = (void *)targsi->data[n + i];
+                t->objects.data[i] = targsi->data[n + i];
             }
             declareParameter(paramscope, tp, t);
             tp_is_declared = 1;
@@ -982,7 +982,7 @@
                 goto L2;
             Tuple *t = new Tuple();
             //printf("t = %p\n", t);
-            dedargs->data[parameters->dim - 1] = (void *)t;
+            dedargs->data[parameters->dim - 1] = t;
             declareParameter(paramscope, tp, t);
             goto L2;
         }
@@ -1014,13 +1014,13 @@
                  * now form the tuple argument.
                  */
                 Tuple *t = new Tuple();
-                dedargs->data[parameters->dim - 1] = (void *)t;
+                dedargs->data[parameters->dim - 1] = t;
 
                 tuple_dim = nfargs - (nfparams - 1);
                 t->objects.setDim(tuple_dim);
                 for (i = 0; i < tuple_dim; i++)
                 {   Expression *farg = (Expression *)fargs->data[fptupindex + i];
-                    t->objects.data[i] = (void *)farg->type;
+                    t->objects.data[i] = farg->type;
                 }
                 declareParameter(paramscope, tp, t);
                 goto L2;
@@ -1258,7 +1258,7 @@
                      * the oded == oarg
                      */
                     Declaration *sparam;
-                    dedargs->data[i] = (void *)oded;
+                    dedargs->data[i] = oded;
                     MATCH m2 = tparam->matchArg(paramscope, dedargs, i, parameters, &dedtypes, &sparam, 0);
                     //printf("m2 = %d\n", m2);
                     if (!m2)
@@ -1284,7 +1284,7 @@
                 }
             }
             declareParameter(paramscope, tparam, oded);
-            dedargs->data[i] = (void *)oded;
+            dedargs->data[i] = oded;
         }
     }
 
@@ -1783,7 +1783,7 @@
                 // foo(U:U) wild(T)                        => wild(T)
                 // foo(U:U) wild(shared(T))                => wild(shared(T))
                 if (!at)
-                {   dedtypes->data[i] = (void *)tt;
+                {   dedtypes->data[i] = tt;
                     goto Lexact;
                 }
                 break;
@@ -1802,7 +1802,7 @@
                 // foo(U:wild(shared(U))  wild(shared(T)) => T
                 tt = mutableOf()->unSharedOf();
                 if (!at)
-                {   dedtypes->data[i] = (void *)tt;
+                {   dedtypes->data[i] = tt;
                     goto Lexact;
                 }
                 break;
@@ -1820,7 +1820,7 @@
                 // foo(U:const(U)) wild(shared(T))         => shared(T)
                 tt = mutableOf();
                 if (!at)
-                {   dedtypes->data[i] = (void *)tt;
+                {   dedtypes->data[i] = tt;
                     goto Lconst;
                 }
                 break;
@@ -1833,7 +1833,7 @@
                 // foo(U:shared(U)) wild(shared(T))        => wild(T)
                 tt = unSharedOf();
                 if (!at)
-                {   dedtypes->data[i] = (void *)tt;
+                {   dedtypes->data[i] = tt;
                     goto Lconst;
                 }
                 break;
@@ -2026,7 +2026,7 @@
                                     goto Lnomatch;
                             }
                             else
-                            {   dedtypes->data[i] = (void *)dim;
+                            {   dedtypes->data[i] = dim;
                             }
                             return next->deduceType(sc, tparam->nextOf(), parameters, dedtypes);
                         }
@@ -2139,9 +2139,9 @@
                 t->objects.setDim(tuple_dim);
                 for (size_t i = 0; i < tuple_dim; i++)
                 {   Parameter *arg = Parameter::getNth(this->parameters, nfparams - 1 + i);
-                    t->objects.data[i] = (void *)arg->type;
+                    t->objects.data[i] = arg->type;
                 }
-                dedtypes->data[tupi] = (void *)t;
+                dedtypes->data[tupi] = t;
             }
             nfparams--; // don't consider the last parameter for type deduction
             goto L2;
@@ -2310,7 +2310,7 @@
                 int vtdim = tempinst->tiargs->dim - i;
                 vt->objects.setDim(vtdim);
                 for (size_t k = 0; k < vtdim; k++)
-                    vt->objects.data[k] = (void *)tempinst->tiargs->data[i + k];
+                    vt->objects.data[k] = tempinst->tiargs->data[i + k];
 
                 Tuple *v = (Tuple *)dedtypes->data[j];
                 if (v)
@@ -3531,7 +3531,7 @@
         }
     }
     *psparam = new TupleDeclaration(loc, ident, &ovar->objects);
-    dedtypes->data[i] = (void *)ovar;
+    dedtypes->data[i] = ovar;
     return MATCHexact;
 }
 
