diff --git a/internal/arraydouble.d b/internal/arraydouble.d index 917a63600..2a5e09b92 100644 --- a/internal/arraydouble.d +++ b/internal/arraydouble.d @@ -91,7 +91,7 @@ body } else { - foreach (i; 0 .. a.length) + for (int i = 0; i < a.length; i++) a[i] = b[i] + c[i]; } return a; @@ -134,7 +134,7 @@ unittest T[dim] b; T[dim] c; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { a[i] = i; b[i] = i + 7; c[i] = i * 2; @@ -142,7 +142,7 @@ unittest c[] = a[] + b[]; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { assert(c[i] == a[i] + b[i]); } @@ -223,7 +223,7 @@ body } else { - foreach (i; 0 .. a.length) + for (int i = 0; i < a.length; i++) a[i] = b[i] - c[i]; } return a; @@ -241,7 +241,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. c.length) + for (int i = 0; i < c.length; i++) { assert(c[i] == a[i] - b[i]); } @@ -253,7 +253,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. c.length) + for (int i = 0; i < c.length; i++) { assert(c[i] == a[i] - b[i]); } @@ -264,7 +264,7 @@ unittest T[dim] b; T[dim] c; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { a[i] = i; b[i] = i + 7; c[i] = i * 2; @@ -272,7 +272,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { assert(c[i] == a[i] - b[i]); } diff --git a/internal/arrayfloat.d b/internal/arrayfloat.d index dbf06e30b..16410816a 100644 --- a/internal/arrayfloat.d +++ b/internal/arrayfloat.d @@ -130,7 +130,7 @@ body } else { - foreach (i; 0 .. a.length) + for (int i = 0; i < a.length; i++) a[i] = b[i] + c[i]; } return a; @@ -173,7 +173,7 @@ unittest T[dim] b; T[dim] c; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { a[i] = i; b[i] = i + 7; c[i] = i * 2; @@ -181,7 +181,7 @@ unittest c[] = a[] + b[]; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { assert(c[i] == a[i] + b[i]); } @@ -301,7 +301,7 @@ body } else { - foreach (i; 0 .. a.length) + for (int i = 0; i < a.length; i++) a[i] = b[i] - c[i]; } return a; @@ -319,7 +319,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. c.length) + for (int i = 0; i < c.length; i++) { assert(c[i] == a[i] - b[i]); } @@ -331,7 +331,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. c.length) + for (int i = 0; i < c.length; i++) { assert(c[i] == a[i] - b[i]); } @@ -342,7 +342,7 @@ unittest T[dim] b; T[dim] c; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { a[i] = i; b[i] = i + 7; c[i] = i * 2; @@ -350,7 +350,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { assert(c[i] == a[i] - b[i]); } diff --git a/internal/arrayreal.d b/internal/arrayreal.d index 2782cff5e..744afb208 100644 --- a/internal/arrayreal.d +++ b/internal/arrayreal.d @@ -33,7 +33,7 @@ in } body { - foreach (i; 0 .. a.length) + for (int i = 0; i < a.length; i++) a[i] = b[i] + c[i]; return a; } @@ -75,7 +75,7 @@ unittest T[dim] b; T[dim] c; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { a[i] = i; b[i] = i + 7; c[i] = i * 2; @@ -83,7 +83,7 @@ unittest c[] = a[] + b[]; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { assert(c[i] == a[i] + b[i]); } @@ -107,7 +107,7 @@ in } body { - foreach (i; 0 .. a.length) + for (int i = 0; i < a.length; i++) a[i] = b[i] - c[i]; return a; } @@ -124,7 +124,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. c.length) + for (int i = 0; i < c.length; i++) { assert(c[i] == a[i] - b[i]); } @@ -136,7 +136,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. c.length) + for (int i = 0; i < c.length; i++) { assert(c[i] == a[i] - b[i]); } @@ -147,7 +147,7 @@ unittest T[dim] b; T[dim] c; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { a[i] = i; b[i] = i + 7; c[i] = i * 2; @@ -155,7 +155,7 @@ unittest c[] = a[] - b[]; - foreach (i; 0 .. dim) + for (int i = 0; i < dim; i++) { assert(c[i] == a[i] - b[i]); } diff --git a/std/boxer.d b/std/boxer.d index 99665d693..b02dba338 100644 --- a/std/boxer.d +++ b/std/boxer.d @@ -193,7 +193,6 @@ struct Box default: return TypeClass.Other; } } - assert(0); } /** Return whether this value could be unboxed as the given type without throwing. */ diff --git a/std/demangle.d b/std/demangle.d index ea8d11bb6..ef9181fa7 100644 --- a/std/demangle.d +++ b/std/demangle.d @@ -324,7 +324,6 @@ string demangle(string name) p = name[i .. length]; goto L1; } - assert(0); } string parseTemplateInstanceName() diff --git a/std/socket.d b/std/socket.d index 81ed1d4cc..d76329368 100644 --- a/std/socket.d +++ b/std/socket.d @@ -46,6 +46,9 @@ version(linux) version(Win32) { + + pragma (lib, "wsock32.lib"); + private import std.c.windows.windows, std.c.windows.winsock; private alias std.c.windows.winsock.timeval _ctimeval; diff --git a/std/windows/registry.d b/std/windows/registry.d index a971630f9..ee796f159 100644 --- a/std/windows/registry.d +++ b/std/windows/registry.d @@ -43,6 +43,8 @@ module std.windows.registry; +pragma(lib, "advapi32.lib"); + /* ///////////////////////////////////////////////////////////////////////////// * Imports */ @@ -354,7 +356,6 @@ private REG_VALUE_TYPE _RVT_from_Endian(Endian endian) default: throw new RegistryException("Invalid Endian specified"); } - assert(0); } private uint swap(in uint i) @@ -1736,8 +1737,6 @@ public: else { throw new RegistryException("Key name enumeration incomplete", res); - - break; } } @@ -1883,8 +1882,6 @@ public: else { throw new RegistryException("Key enumeration incomplete", res); - - break; } } @@ -2010,8 +2007,6 @@ public: else { throw new RegistryException("Value name enumeration incomplete", res); - - break; } } @@ -2137,8 +2132,6 @@ public: else { throw new RegistryException("Value enumeration incomplete", res); - - break; } } diff --git a/std/zip.d b/std/zip.d index a96da1268..55aaa5371 100644 --- a/std/zip.d +++ b/std/zip.d @@ -455,7 +455,6 @@ class ZipArchive default: throw new ZipException("unsupported compression method"); } - assert(0); } /* ============ Utility =================== */ diff --git a/win32.mak b/win32.mak index a79db921d..970871902 100644 --- a/win32.mak +++ b/win32.mak @@ -45,10 +45,7 @@ DOC=..\..\html\d\phobos .asm.obj: $(CC) -c $* -targets : unittest gcstub.obj - -unittest : unittest.exe - unittest +targets : phobos.lib gcstub.obj test : test.exe @@ -58,40 +55,81 @@ test.obj : test.d test.exe : test.obj phobos.lib $(DMD) test.obj -g -L/map -unittest.exe : unittest.d phobos.lib - $(DMD) unittest -g - dmc unittest.obj -g - -OBJS= asserterror.obj deh.obj switch.obj complex.obj gcstats.obj \ - critical.obj object.obj monitor.obj arraycat.obj invariant.obj \ - dmain2.obj outofmemory.obj aaA.obj adi.obj aApply.obj file.obj \ - compiler.obj system.obj moduleinit.obj md5.obj base64.obj \ - cast.obj syserror.obj path.obj string.obj memset.obj math.obj \ - outbuffer.obj ctype.obj regexp.obj random.obj windows.obj stat.obj \ - stream.obj switcherr.obj com.obj array.obj mmfile.obj \ - qsort.obj math2.obj date.obj dateparse.obj thread.obj obj.obj \ - iunknown.obj crc32.obj conv.obj arraycast.obj utf.obj uri.obj \ - Czlib.obj Dzlib.obj zip.obj process.obj registry.obj \ - socket.obj socketstream.obj loader.obj stdarg.obj format.obj stdio.obj \ - perf.obj openrj.obj uni.obj winsock.obj oldsyserror.obj \ - errno.obj boxer.obj cstream.obj charset.obj metastrings.obj \ - gamma.obj demangle.obj cover.obj bitarray.obj aApplyR.obj \ - signals.obj cpuid.obj typetuple.obj traits.obj bind.obj \ - ti_Ag.obj ti_C.obj ti_int.obj ti_char.obj \ - ti_wchar.obj ti_uint.obj ti_short.obj ti_ushort.obj \ - ti_byte.obj ti_ubyte.obj ti_long.obj ti_ulong.obj ti_ptr.obj \ - ti_float.obj ti_double.obj ti_real.obj ti_delegate.obj \ - ti_creal.obj ti_ireal.obj \ - ti_cfloat.obj ti_ifloat.obj \ - ti_cdouble.obj ti_idouble.obj \ - ti_AC.obj ti_Ashort.obj \ - ti_Aint.obj ti_Along.obj \ - ti_Afloat.obj ti_Adouble.obj ti_Areal.obj \ - ti_Acfloat.obj ti_Acdouble.obj ti_Acreal.obj \ - ti_dchar.obj ti_void.obj +OBJS= deh.obj complex.obj gcstats.obj \ + critical.obj object.obj monitor.obj \ + math2.obj \ + crc32.obj \ + Czlib.obj Dzlib.obj process.obj \ + oldsyserror.obj \ + errno.obj metastrings.obj # ti_bit.obj ti_Abit.obj +SRCS= std\math.d std\stdio.d std\dateparse.d std\date.d std\uni.d std\string.d \ + std\base64.d std\md5.d std\regexp.d \ + std\compiler.d std\cpuid.d std\format.d std\demangle.d \ + std\path.d std\file.d std\outbuffer.d std\utf.d std\uri.d \ + std\ctype.d std\random.d std\array.d std\mmfile.d \ + std\bitarray.d \ + std\signals.d std\typetuple.d std\traits.d std\bind.d \ + std\switcherr.d \ + std\thread.d std\moduleinit.d std\boxer.d \ + std\asserterror.d std\outofmemory.d std\system.d \ + std\stream.d std\socket.d std\socketstream.d \ + std\perf.d std\openrj.d std\conv.d std\cover.d \ + std\zip.d std\cstream.d std\loader.d \ + internal\aaA.d internal\adi.d \ + internal\aApply.d internal\aApplyR.d internal\memset.d \ + internal\arraycast.d internal\arraycat.d \ + internal\switch.d internal\qsort.d internal\invariant.d \ + internal\dmain2.d internal\cast.d internal\obj.d \ + internal\arrayfloat.d internal\arraydouble.d internal\arrayreal.d \ + etc\gamma.d \ + std\c\stdarg.d \ + std\c\windows\com.d \ + std\c\windows\stat.d \ + std\c\windows\windows.d \ + std\c\windows\winsock.d \ + std\windows\charset.d \ + std\windows\iunknown.d \ + std\windows\registry.d \ + std\windows\syserror.d \ + std\typeinfo\ti_ptr.d \ + std\typeinfo\ti_delegate.d \ + std\typeinfo\ti_void.d \ + std\typeinfo\ti_C.d \ + std\typeinfo\ti_byte.d \ + std\typeinfo\ti_ubyte.d \ + std\typeinfo\ti_short.d \ + std\typeinfo\ti_ushort.d \ + std\typeinfo\ti_int.d \ + std\typeinfo\ti_uint.d \ + std\typeinfo\ti_long.d \ + std\typeinfo\ti_ulong.d \ + std\typeinfo\ti_char.d \ + std\typeinfo\ti_wchar.d \ + std\typeinfo\ti_dchar.d \ + std\typeinfo\ti_cdouble.d \ + std\typeinfo\ti_double.d \ + std\typeinfo\ti_idouble.d \ + std\typeinfo\ti_cfloat.d \ + std\typeinfo\ti_float.d \ + std\typeinfo\ti_ifloat.d \ + std\typeinfo\ti_creal.d \ + std\typeinfo\ti_real.d \ + std\typeinfo\ti_ireal.d \ + std\typeinfo\ti_AC.d \ + std\typeinfo\ti_Ag.d \ + std\typeinfo\ti_Ashort.d \ + std\typeinfo\ti_Aint.d \ + std\typeinfo\ti_Along.d \ + std\typeinfo\ti_Afloat.d \ + std\typeinfo\ti_Adouble.d \ + std\typeinfo\ti_Areal.d \ + std\typeinfo\ti_Acfloat.d \ + std\typeinfo\ti_Acdouble.d \ + std\typeinfo\ti_Acreal.d + DOCS= $(DOC)\std_path.html $(DOC)\std_math.html $(DOC)\std_outbuffer.html \ $(DOC)\std_stream.html $(DOC)\std_string.html $(DOC)\std_base64.html \ $(DOC)\object.html $(DOC)\std_compiler.html $(DOC)\std_format.html \ @@ -247,10 +285,27 @@ SRC_GC= internal\gc\gc.d \ internal\gc\win32.mak \ internal\gc\linux.mak -phobos.lib : $(OBJS) minit.obj internal\gc\dmgc.lib etc\c\zlib\zlib.lib \ - win32.mak - lib -c -p32 phobos.lib $(OBJS) minit.obj internal\gc\dmgc.lib \ - etc\c\zlib\zlib.lib +phobos.lib : $(OBJS) $(SRCS) minit.obj internal\gc\dmgc.lib \ + etc\c\zlib\zlib.lib win32.mak +# lib -c -p32 phobos.lib $(OBJS) minit.obj internal\gc\dmgc.lib \ +# etc\c\zlib\zlib.lib + $(DMD) -lib -ofphobos.lib $(DFLAGS) $(SRCS) $(OBJS) minit.obj \ + internal\gc\dmgc.lib etc\c\zlib\zlib.lib + +unittest : $(SRCS) phobos.lib + $(DMD) $(DFLAGS) -unittest unittest.d $(SRCS) phobos.lib + unittest + +#unittest : unittest.exe +# unittest +# +#unittest.exe : unittest.d phobos.lib +# $(DMD) unittest -g +# dmc unittest.obj -g + +cov : $(SRCS) phobos.lib + $(DMD) -cov -unittest -ofcov.exe unittest.d $(SRCS) phobos.lib + cov html : $(DOCS)