Skip to content

Commit 48726c8

Browse files
authored
Merge pull request #8562 from wilzbach/dscanner-alias
alias_syntax_check: remove uses of the old alias syntax merged-on-behalf-of: Jacob Carlborg <jacob-carlborg@users.noreply.github.com>
2 parents 7e6492e + f66cf21 commit 48726c8

8 files changed

Lines changed: 27 additions & 27 deletions

File tree

src/.dscanner.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ incorrect_infinite_range_check="enabled"
6666
; Checks for asserts that are always true
6767
useless_assert_check="enabled"
6868
; Check for uses of the old-style alias syntax
69-
alias_syntax_check="disabled"
69+
alias_syntax_check="enabled"
7070
; Checks for else if that should be else static if
7171
static_if_else_check="enabled"
7272
; Check for unclear lambda syntax

src/dmd/backend/cc.d

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ version (HTOD)
254254

255255
//#include "token.h"
256256

257-
alias uint stflags_t;
257+
alias stflags_t = uint;
258258
enum
259259
{
260260
PFLpreprocessor = 1, // in preprocessor
@@ -278,7 +278,7 @@ enum
278278
PFLmfc = 0x10000, // something will affect MFC compatibility
279279
}
280280

281-
alias char sthflags_t;
281+
alias sthflags_t = char;
282282
enum
283283
{
284284
FLAG_INPLACE = 0, // in place hydration
@@ -417,7 +417,7 @@ enum
417417
//char symbol_isintab(Symbol *s) { return sytab[s.Sclass] & SCSS; }
418418

419419
//version (Windows)
420-
alias char enum_SC;
420+
alias enum_SC = char;
421421
//else
422422
// alias SC enum_SC;
423423

@@ -428,9 +428,9 @@ enum
428428
* in a function. startblock heads the list.
429429
*/
430430

431-
alias void* ClassDeclaration_;
432-
alias void* Declaration_;
433-
alias void* Module_;
431+
alias ClassDeclaration_ = void*;
432+
alias Declaration_ = void*;
433+
alias Module_ = void*;
434434

435435
struct Blockx
436436
{
@@ -454,7 +454,7 @@ struct Blockx
454454
}
455455
}
456456

457-
alias ushort bflags_t;
457+
alias bflags_t = ushort;
458458
enum
459459
{
460460
BFLvisited = 1, // set if block is visited
@@ -704,7 +704,7 @@ struct symtab_t
704704
Symbol **tab; // local Symbol table
705705
}
706706

707-
alias uint func_flags_t;
707+
alias func_flags_t = uint;
708708
enum
709709
{
710710
Fpending = 1, // if function has been queued for being written
@@ -739,7 +739,7 @@ enum
739739
Fsurrogate = 0x4000000, // surrogate call function
740740
}
741741

742-
alias uint func_flags3_t;
742+
alias func_flags3_t = uint;
743743
enum
744744
{
745745
Fvtblgen = 1, // generate vtbl[] when this function is defined
@@ -846,7 +846,7 @@ struct meminit_t
846846
// called for it
847847
}
848848

849-
alias uint baseclass_flags_t;
849+
alias baseclass_flags_t = uint;
850850
enum
851851
{
852852
BCFpublic = 1, // base class is public
@@ -896,7 +896,7 @@ void baseclass_free(baseclass_t *b) { }
896896
* For virtual tables.
897897
*/
898898

899-
alias char mptr_flags_t;
899+
alias mptr_flags_t = char;
900900
enum
901901
{
902902
MPTRvirtual = 1, // it's an offset to a virtual base
@@ -1030,7 +1030,7 @@ struct template_t
10301030
* Special information for enums.
10311031
*/
10321032

1033-
alias uint enum_flags_t;
1033+
alias enum_flags_t = uint;
10341034
enum
10351035
{
10361036
SENnotagname = 1, // no tag name for enum
@@ -1050,7 +1050,7 @@ struct enum_t
10501050
* Special information for structs.
10511051
*/
10521052

1053-
alias uint struct_flags_t;
1053+
alias struct_flags_t = uint;
10541054
enum
10551055
{
10561056
STRanonymous = 1, // set for unions with no tag names
@@ -1541,7 +1541,7 @@ version (MARS)
15411541
* Psym SCtemplate for template-template-argument
15421542
*/
15431543

1544-
alias uint pflags_t;
1544+
alias pflags_t = uint;
15451545
enum
15461546
{
15471547
PFexplicit = 1, // this template argument was explicit, i.e. in < >
@@ -1753,7 +1753,7 @@ extern __gshared EEcontext eecontext;
17531753

17541754

17551755
// Different goals for el_optimize()
1756-
alias uint goal_t;
1756+
alias goal_t = uint;
17571757
enum
17581758
{
17591759
GOALnone = 0, // evaluate for side effects only

src/dmd/backend/cgcv.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern (C++):
2323
@nogc:
2424
nothrow:
2525

26-
alias LIST* symlist_t;
26+
alias symlist_t = LIST*;
2727

2828
extern char* ftdbname;
2929

@@ -37,7 +37,7 @@ uint cv4_struct(Classsym*, int);
3737

3838
/* =================== Added for MARS compiler ========================= */
3939

40-
alias uint idx_t; // type of type index
40+
alias idx_t = uint; // type of type index
4141

4242
/* Data structure for a type record */
4343

src/dmd/backend/dlist.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ struct LIST
4242
}
4343
}
4444

45-
alias LIST* list_t; /* pointer to a list entry */
45+
alias list_t = LIST*; /* pointer to a list entry */
4646

4747
/* FPNULL is a null function pointer designed to be an argument to
4848
* list_free().
4949
*/
5050

51-
alias void function(void*) @nogc nothrow list_free_fp;
51+
alias list_free_fp = void function(void*) @nogc nothrow;
5252

5353
enum FPNULL = cast(list_free_fp)null;
5454

src/dmd/backend/dvec.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ extern (C):
2323
nothrow:
2424
@nogc:
2525

26-
alias size_t vec_base_t; // base type of vector
27-
alias vec_base_t* vec_t;
26+
alias vec_base_t = size_t; // base type of vector
27+
alias vec_t = vec_base_t*;
2828

2929
enum VECBITS = vec_base_t.sizeof * 8; // # of bits per entry
3030
enum VECMASK = VECBITS - 1; // mask for bit position

src/dmd/backend/el.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ nothrow:
2626

2727
/* Routines to handle elems. */
2828

29-
alias ubyte eflags_t;
29+
alias eflags_t = ubyte;
3030
enum
3131
{
3232
EFLAGS_variadic = 1, // variadic function call
3333
}
3434

35-
alias uint pef_flags_t;
35+
alias pef_flags_t = uint;
3636
enum
3737
{
3838
PEFnotlvalue = 1, // although elem may look like
@@ -44,7 +44,7 @@ enum
4444
PEFmember = 0x100, // was a class member access
4545
}
4646

47-
alias ubyte nflags_t;
47+
alias nflags_t = ubyte;
4848
enum
4949
{
5050
NFLli = 1, // loop invariant

src/dmd/backend/iasm.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ else
169169
// Operand flags - usOp1, usOp2, usOp3
170170
//
171171

172-
alias uint opflag_t;
172+
alias opflag_t = uint;
173173

174174
// Operand flags for normal opcodes
175175
enum

src/dmd/backend/oper.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern (C++):
1717
@nogc:
1818
nothrow:
1919

20-
alias int OPER;
20+
alias OPER = int;
2121
enum
2222
{
2323
OPunde, // place holder for undefined operator

0 commit comments

Comments
 (0)