if (e == str + 1 || e == str + len - 1)
return e + 1;
#endif
+ /* falls through */
default:
if (e == str)
break;
int result;
dw = GetFileAttributesA(name);
- if (dw == -1L)
+ if (dw == INVALID_FILE_ATTRIBUTES)
result = 0;
else if (dw & FILE_ATTRIBUTE_DIRECTORY)
result = 2;
size_t len = strlen(path);
if ((len > 2 && p[-1] == ':' && strcmp(path + 2, p) == 0) ||
len == strlen(p))
- { mem.xfree(const_cast<void *>(p));
+ { mem.xfree(const_cast<char *>(p));
return 0;
}
#endif
DWORD result = GetFullPathNameA(name, 0, NULL, NULL);
if (result)
{
- char *buf = (char *)malloc(result);
+ char *buf = (char *)mem.xmalloc(result);
result = GetFullPathNameA(name, result, buf, NULL);
if (result == 0)
{
assert(&t.Bottom < &t.foo2);
assert(TRECT6.foo1.offsetof == 0);
-version (Win32)
-{
- assert(TRECT6.Left.offsetof == 8);
- assert(TRECT6.Top.offsetof == 12);
- assert(TRECT6.Right.offsetof == 16);
- assert(TRECT6.Bottom.offsetof == 20);
- assert(TRECT6.TopLeft.offsetof == 8);
- assert(TRECT6.BottomRight.offsetof == 16);
- assert(TRECT6.foo2.offsetof == 24);
-}
-else version (X86_64)
-{
- assert(TRECT6.Left.offsetof == 8);
- assert(TRECT6.Top.offsetof == 12);
- assert(TRECT6.Right.offsetof == 16);
- assert(TRECT6.Bottom.offsetof == 20);
- assert(TRECT6.TopLeft.offsetof == 8);
- assert(TRECT6.BottomRight.offsetof == 16);
- assert(TRECT6.foo2.offsetof == 24);
-}
-else version(ARM)
-{
- assert(TRECT6.Left.offsetof == 8);
- assert(TRECT6.Top.offsetof == 12);
- assert(TRECT6.Right.offsetof == 16);
- assert(TRECT6.Bottom.offsetof == 20);
- assert(TRECT6.TopLeft.offsetof == 8);
- assert(TRECT6.BottomRight.offsetof == 16);
- assert(TRECT6.foo2.offsetof == 24);
-}
-else
-{
- assert(TRECT6.Left.offsetof == 4);
- assert(TRECT6.Top.offsetof == 8);
- assert(TRECT6.Right.offsetof == 12);
- assert(TRECT6.Bottom.offsetof == 16);
- assert(TRECT6.TopLeft.offsetof == 4);
- assert(TRECT6.BottomRight.offsetof == 12);
- assert(TRECT6.foo2.offsetof == 20);
-}
+ static if (long.alignof == 8)
+ {
+ assert(TRECT6.Left.offsetof == 8);
+ assert(TRECT6.Top.offsetof == 12);
+ assert(TRECT6.Right.offsetof == 16);
+ assert(TRECT6.Bottom.offsetof == 20);
+ assert(TRECT6.TopLeft.offsetof == 8);
+ assert(TRECT6.BottomRight.offsetof == 16);
+ assert(TRECT6.foo2.offsetof == 24);
+ }
+ else
+ {
+ assert(TRECT6.Left.offsetof == 4);
+ assert(TRECT6.Top.offsetof == 8);
+ assert(TRECT6.Right.offsetof == 12);
+ assert(TRECT6.Bottom.offsetof == 16);
+ assert(TRECT6.TopLeft.offsetof == 4);
+ assert(TRECT6.BottomRight.offsetof == 12);
+ assert(TRECT6.foo2.offsetof == 20);
+ }
}
/* ================================ */