diff --git a/src/core/bitop.d b/src/core/bitop.d index 81db5945961..16c03689d90 100644 --- a/src/core/bitop.d +++ b/src/core/bitop.d @@ -89,7 +89,7 @@ int bt(in size_t* p, size_t bitnum) pure @system /// @system pure unittest { - size_t array[2]; + size_t[2] array; array[0] = 2; array[1] = 0x100; @@ -129,7 +129,7 @@ int bts(size_t* p, size_t bitnum) pure @system; /// @system pure unittest { - size_t array[2]; + size_t[2] array; array[0] = 2; array[1] = 0x100; diff --git a/src/core/demangle.d b/src/core/demangle.d index 3fc4b69f8d7..f9ad3ba75f4 100644 --- a/src/core/demangle.d +++ b/src/core/demangle.d @@ -231,7 +231,7 @@ private struct Demangle char[] putAsHex( size_t val, int width = 0 ) { - char tmp[20]; + char[20] tmp; int pos = tmp.length; while( val ) diff --git a/src/core/stdc/stdio.d b/src/core/stdc/stdio.d index 4a48aa014b9..965d7c29407 100644 --- a/src/core/stdc/stdio.d +++ b/src/core/stdc/stdio.d @@ -844,9 +844,9 @@ version(CRuntime_DigitalMars) private enum _MAX_SEMAPHORES = 10 + _NFILE; private enum _semIO = 3; - private extern __gshared short _iSemLockCtrs[_MAX_SEMAPHORES]; - private extern __gshared int _iSemThreadIds[_MAX_SEMAPHORES]; - private extern __gshared int _iSemNestCount[_MAX_SEMAPHORES]; + private extern __gshared short[_MAX_SEMAPHORES] _iSemLockCtrs; + private extern __gshared int[_MAX_SEMAPHORES] _iSemThreadIds; + private extern __gshared int[_MAX_SEMAPHORES] _iSemNestCount; private extern __gshared HANDLE[_NFILE] _osfhnd; private extern __gshared ubyte[_NFILE] __fhnd_info; diff --git a/src/core/sys/freebsd/dlfcn.d b/src/core/sys/freebsd/dlfcn.d index ad59625226d..24a563bca3f 100644 --- a/src/core/sys/freebsd/dlfcn.d +++ b/src/core/sys/freebsd/dlfcn.d @@ -81,7 +81,7 @@ static if (__BSD_VISIBLE) struct Dl_serinfo { size_t dls_size; /* total buffer size */ uint dls_cnt; /* number of path entries */ - Dl_serpath dls_serpath[1]; /* there may be more than one */ + Dl_serpath[1] dls_serpath; /* there may be more than one */ }; } diff --git a/src/core/sys/freebsd/sys/elf32.d b/src/core/sys/freebsd/sys/elf32.d index 29b8ae60730..4a55a0c001c 100644 --- a/src/core/sys/freebsd/sys/elf32.d +++ b/src/core/sys/freebsd/sys/elf32.d @@ -25,7 +25,7 @@ alias Elf32_Sword Elf32_Ssize; struct Elf32_Ehdr { - char e_ident[EI_NIDENT]; + char[EI_NIDENT] e_ident; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; diff --git a/src/core/sys/freebsd/sys/elf64.d b/src/core/sys/freebsd/sys/elf64.d index 815951b16f3..d3c189ebd60 100644 --- a/src/core/sys/freebsd/sys/elf64.d +++ b/src/core/sys/freebsd/sys/elf64.d @@ -27,7 +27,7 @@ alias Elf64_Sxword Elf64_Ssize; struct Elf64_Ehdr { - char e_ident[EI_NIDENT]; + char[EI_NIDENT] e_ident; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; diff --git a/src/core/sys/linux/elf.d b/src/core/sys/linux/elf.d index 81bcfafa6ff..2dd7068d196 100644 --- a/src/core/sys/linux/elf.d +++ b/src/core/sys/linux/elf.d @@ -42,7 +42,7 @@ enum EI_NIDENT = 16; struct Elf32_Ehdr { - char e_ident[EI_NIDENT]; + char[EI_NIDENT] e_ident; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; @@ -60,7 +60,7 @@ struct Elf32_Ehdr struct Elf64_Ehdr { - char e_ident[EI_NIDENT]; + char[EI_NIDENT] e_ident; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; @@ -1192,7 +1192,7 @@ union Elf32_gptab struct Elf32_RegInfo { Elf32_Word ri_gprmask; - Elf32_Word ri_cprmask[4]; + Elf32_Word[4] ri_cprmask; Elf32_Sword ri_gp_value; } diff --git a/src/core/sys/posix/setjmp.d b/src/core/sys/posix/setjmp.d index 85ff602a6ea..05182153825 100644 --- a/src/core/sys/posix/setjmp.d +++ b/src/core/sys/posix/setjmp.d @@ -82,7 +82,7 @@ version( linux ) { void * __pc; void * __sp; - int __regs[8]; + int[8] __regs; void * __fp; void * __gp; } @@ -90,15 +90,15 @@ version( linux ) { long __pc; long __sp; - long __regs[8]; + long[8] __regs; long __fp; long __gp; } int __fpc_csr; version (MIPS_N64) - double __fpregs[8]; + double[8] __fpregs; else - double __fpregs[6]; + double[6] __fpregs; } } else version (MIPS64) @@ -107,14 +107,14 @@ version( linux ) { long __pc; long __sp; - long __regs[8]; + long[8] __regs; long __fp; long __gp; int __fpc_csr; version (MIPS_N64) - double __fpregs[8]; + double[8] __fpregs; else - double __fpregs[6]; + double[6] __fpregs; } } else diff --git a/src/core/sys/posix/signal.d b/src/core/sys/posix/signal.d index d8268c49f84..52249379101 100644 --- a/src/core/sys/posix/signal.d +++ b/src/core/sys/posix/signal.d @@ -611,7 +611,7 @@ version( linux ) union _sifields_t { - int _pad[__SI_PAD_SIZE]; + int[__SI_PAD_SIZE] _pad; // kill() struct _kill_t @@ -725,7 +725,7 @@ else version( OSX ) void* si_addr; sigval si_value; int si_band; - uint pad[7]; + uint[7] pad; } enum SI_USER = 0x10001; @@ -750,7 +750,7 @@ else version( FreeBSD ) { struct sigset_t { - uint __bits[4]; + uint[4] __bits; } struct siginfo_t @@ -816,7 +816,7 @@ else version (Solaris) struct sigset_t { - uint __bits[4]; + uint[4] __bits; } struct siginfo_t @@ -831,9 +831,9 @@ else version (Solaris) union ___data { version (D_LP64) - int si_pad[(256 / int.sizeof) - 4]; + int[(256 / int.sizeof) - 4] si_pad; else - int si_pad[(128 / int.sizeof) - 3]; + int[(128 / int.sizeof) - 3] si_pad; struct ___proc { @@ -890,8 +890,8 @@ else version (Solaris) short __syscall; char __nsysarg; char __fault; - c_long __sysarg[8]; - int __mstate[10]; + c_long[8] __sysarg; + int[10] __mstate; } ___prof __prof; diff --git a/src/core/sys/posix/sys/select.d b/src/core/sys/posix/sys/select.d index 03157b69e56..15ea2b07c39 100644 --- a/src/core/sys/posix/sys/select.d +++ b/src/core/sys/posix/sys/select.d @@ -181,7 +181,7 @@ else version( FreeBSD ) struct fd_set { - __fd_mask __fds_bits[(FD_SETSIZE + (_NFDBITS - 1)) / _NFDBITS]; + __fd_mask[(FD_SETSIZE + (_NFDBITS - 1)) / _NFDBITS] __fds_bits; } extern (D) __fd_mask __fdset_mask(uint n) diff --git a/src/core/sys/posix/sys/stat.d b/src/core/sys/posix/sys/stat.d index 43f07e3a035..f63338de6b7 100644 --- a/src/core/sys/posix/sys/stat.d +++ b/src/core/sys/posix/sys/stat.d @@ -172,7 +172,7 @@ version( linux ) time_t st_ctime; ulong_t st_ctimensec; } - slong_t __unused[3]; + slong_t[3] __unused; } } else version (MIPS_O32) @@ -613,7 +613,7 @@ else version( OSX ) uint st_flags; uint st_gen; int st_lspare; - long st_qspare[2]; + long[2] st_qspare; } enum S_IRUSR = 0x100; // octal 0400 diff --git a/src/core/sys/posix/sys/statvfs.d b/src/core/sys/posix/sys/statvfs.d index 98565a5e70f..4266fcea065 100644 --- a/src/core/sys/posix/sys/statvfs.d +++ b/src/core/sys/posix/sys/statvfs.d @@ -37,7 +37,7 @@ version(linux) { } c_ulong f_flag; c_ulong f_namemax; - int __f_spare[6]; + int[6] __f_spare; } /* Definitions for the flag in `f_flag'. These definitions should be kept in sync with the definitions in . */ diff --git a/src/core/sys/posix/sys/types.d b/src/core/sys/posix/sys/types.d index 74edaec0a82..9a0595c88f3 100644 --- a/src/core/sys/posix/sys/types.d +++ b/src/core/sys/posix/sys/types.d @@ -477,7 +477,7 @@ version (linux) union pthread_attr_t { - byte __size[__SIZEOF_PTHREAD_ATTR_T]; + byte[__SIZEOF_PTHREAD_ATTR_T] __size; c_long __align; } @@ -493,13 +493,13 @@ version (linux) union pthread_cond_t { - byte __size[__SIZEOF_PTHREAD_COND_T]; + byte[__SIZEOF_PTHREAD_COND_T] __size; long __align; } union pthread_condattr_t { - byte __size[__SIZEOF_PTHREAD_CONDATTR_T]; + byte[__SIZEOF_PTHREAD_CONDATTR_T] __size; int __align; } @@ -507,13 +507,13 @@ version (linux) union pthread_mutex_t { - byte __size[__SIZEOF_PTHREAD_MUTEX_T]; + byte[__SIZEOF_PTHREAD_MUTEX_T] __size; c_long __align; } union pthread_mutexattr_t { - byte __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + byte[__SIZEOF_PTHREAD_MUTEXATTR_T] __size; int __align; } @@ -521,13 +521,13 @@ version (linux) struct pthread_rwlock_t { - byte __size[__SIZEOF_PTHREAD_RWLOCK_T]; + byte[__SIZEOF_PTHREAD_RWLOCK_T] __size; c_long __align; } struct pthread_rwlockattr_t { - byte __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + byte[__SIZEOF_PTHREAD_RWLOCKATTR_T] __size; c_long __align; } @@ -797,13 +797,13 @@ version( linux ) { struct pthread_barrier_t { - byte __size[__SIZEOF_PTHREAD_BARRIER_T]; + byte[__SIZEOF_PTHREAD_BARRIER_T] __size; c_long __align; } struct pthread_barrierattr_t { - byte __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + byte[__SIZEOF_PTHREAD_BARRIERATTR_T] __size; int __align; } } diff --git a/src/core/sys/posix/sys/utsname.d b/src/core/sys/posix/sys/utsname.d index 2f13b21df37..2a5f28d4603 100644 --- a/src/core/sys/posix/sys/utsname.d +++ b/src/core/sys/posix/sys/utsname.d @@ -10,14 +10,14 @@ extern (C) struct utsname { - char sysname[utsNameLength]; - char nodename[utsNameLength]; - char release[utsNameLength]; + char[utsNameLength] sysname; + char[utsNameLength] nodename; + char[utsNameLength] release; // The field name is version but version is a keyword in D. - char update[utsNameLength]; - char machine[utsNameLength]; + char[utsNameLength] update; + char[utsNameLength] machine; - char __domainname[utsNameLength]; + char[utsNameLength] __domainname; } int uname(utsname* __name); @@ -28,12 +28,12 @@ extern (C) struct utsname { - char sysname[utsNameLength]; - char nodename[utsNameLength]; - char release[utsNameLength]; + char[utsNameLength] sysname; + char[utsNameLength] nodename; + char[utsNameLength] release; // The field name is version but version is a keyword in D. - char update[utsNameLength]; - char machine[utsNameLength]; + char[utsNameLength] update; + char[utsNameLength] machine; } int uname(utsname* __name); @@ -44,12 +44,12 @@ extern (C) struct utsname { - char sysname[utsNameLength]; - char nodename[utsNameLength]; - char release[utsNameLength]; + char[utsNameLength] sysname; + char[utsNameLength] nodename; + char[utsNameLength] release; // The field name is version but version is a keyword in D. - char update[utsNameLength]; - char machine[utsNameLength]; + char[utsNameLength] update; + char[utsNameLength] machine; } int uname(utsname* __name); diff --git a/src/core/sys/posix/ucontext.d b/src/core/sys/posix/ucontext.d index c7f15f81c8c..cf5b35a64d1 100644 --- a/src/core/sys/posix/ucontext.d +++ b/src/core/sys/posix/ucontext.d @@ -523,12 +523,12 @@ version( linux ) struct sigcontext { ulong fault_address; /* AArch64 registers */ - ulong regs[31]; + ulong[31] regs; ulong sp; ulong pc; ulong pstate; /* 4K reserved for FP/SIMD state and future expansion */ - align(16) ubyte __reserved[4096]; + align(16) ubyte[4096] __reserved; } alias sigcontext mcontext_t; @@ -591,12 +591,12 @@ else version( FreeBSD ) long mc_ownedfp; align(16) - long mc_fpstate[64]; + long[64] mc_fpstate; __register_t mc_fsbase; __register_t mc_gsbase; - long mc_spare[6]; + long[6] mc_spare; } } else version( X86 ) diff --git a/src/gc/gc.d b/src/gc/gc.d index 4f319c9c2e8..9b8959b0f60 100644 --- a/src/gc/gc.d +++ b/src/gc/gc.d @@ -1384,8 +1384,8 @@ struct Root } -immutable uint binsize[B_MAX] = [ 16,32,64,128,256,512,1024,2048,4096 ]; -immutable size_t notbinsize[B_MAX] = [ ~(16-1),~(32-1),~(64-1),~(128-1),~(256-1), +immutable uint[B_MAX] binsize = [ 16,32,64,128,256,512,1024,2048,4096 ]; +immutable size_t[B_MAX] notbinsize = [ ~(16-1),~(32-1),~(64-1),~(128-1),~(256-1), ~(512-1),~(1024-1),~(2048-1),~(4096-1) ]; /* ============================ Gcx =============================== */ @@ -1418,7 +1418,7 @@ struct Gcx size_t npools; Pool **pooltable; - List *bucket[B_MAX]; // free list for each size + List*[B_MAX]bucket; // free list for each size void initialize() diff --git a/src/rt/deh_win32.d b/src/rt/deh_win32.d index 47396614f87..a6e04cc52bc 100644 --- a/src/rt/deh_win32.d +++ b/src/rt/deh_win32.d @@ -321,7 +321,7 @@ struct DHandlerTable void *fptr; // pointer to start of function uint espoffset; // offset of ESP from EBP uint retoffset; // offset from start of function to return code - DHandlerInfo handler_info[1]; + DHandlerInfo[1] handler_info; }; struct DCatchBlock @@ -335,7 +335,7 @@ struct DCatchBlock struct DCatchInfo { uint ncatches; // number of catch blocks - DCatchBlock catch_block[1]; // data for each catch block + DCatchBlock[1] catch_block; // data for each catch block }; // Macro to make our own exception code diff --git a/src/rt/deh_win64_posix.d b/src/rt/deh_win64_posix.d index ee5c9737cb3..2efe3b41098 100644 --- a/src/rt/deh_win64_posix.d +++ b/src/rt/deh_win64_posix.d @@ -50,7 +50,7 @@ struct DHandlerTable uint espoffset; // offset of ESP from EBP uint retoffset; // offset from start of function to return code size_t nhandlers; // dimension of handler_info[] (use size_t to set alignment of handler_info[]) - DHandlerInfo handler_info[1]; + DHandlerInfo[1] handler_info; } struct DCatchBlock @@ -64,7 +64,7 @@ struct DCatchBlock struct DCatchInfo { size_t ncatches; // number of catch blocks - DCatchBlock catch_block[1]; // data for each catch block + DCatchBlock[1] catch_block; // data for each catch block } // One of these is generated for each function with try-catch or try-finally diff --git a/src/rt/minfo.d b/src/rt/minfo.d index 2a8bc2497a6..286c2127ae3 100644 --- a/src/rt/minfo.d +++ b/src/rt/minfo.d @@ -412,7 +412,7 @@ unittest } immutable ModuleInfo mi; - size_t pad[8]; + size_t[8] pad; alias mi this; } diff --git a/src/rt/qsort.d b/src/rt/qsort.d index a1915cec3fc..aaaeb68ffaf 100644 --- a/src/rt/qsort.d +++ b/src/rt/qsort.d @@ -85,7 +85,7 @@ unittest { debug(qsort) printf("array.sort.unittest()\n"); - int a[] = new int[10]; + int[] a = new int[10]; a[0] = 23; a[1] = 1;