Skip to content

Commit

Permalink
Replace C pointer syntax with D (#20799)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorpel authored Jan 28, 2025
1 parent 17ad9f9 commit 9709375
Show file tree
Hide file tree
Showing 28 changed files with 675 additions and 675 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dmd/access.d
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private bool hasPackageAccess(Module mod, Dsymbol s)
/****************************************
* Determine if scope sc has protected level access to cd.
*/
private bool hasProtectedAccess(Scope *sc, Dsymbol s)
private bool hasProtectedAccess(Scope* sc, Dsymbol s)
{
if (auto cd = s.isClassMember()) // also includes interfaces
{
Expand Down Expand Up @@ -273,7 +273,7 @@ bool symbolIsVisible(Dsymbol origin, Dsymbol s)
* s = symbol to check for visibility
* Returns: true if s is visible by origin
*/
bool symbolIsVisible(Scope *sc, Dsymbol s)
bool symbolIsVisible(Scope* sc, Dsymbol s)
{
s = mostVisibleOverload(s);
return checkSymbolAccess(sc, s);
Expand All @@ -288,7 +288,7 @@ bool symbolIsVisible(Scope *sc, Dsymbol s)
* s = symbol to check for visibility
* Returns: true if s is visible by origin
*/
bool checkSymbolAccess(Scope *sc, Dsymbol s)
bool checkSymbolAccess(Scope* sc, Dsymbol s)
{
final switch (s.visible().kind)
{
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ struct ASTBase
{
Dsymbols* decl;

final extern (D) this(Dsymbols *decl)
final extern (D) this(Dsymbols* decl)
{
this.decl = decl;
}
Expand Down Expand Up @@ -1672,7 +1672,7 @@ struct ASTBase
{
TypeQualified tqual;

extern (D) this(const ref Loc loc, Identifier ident, TypeQualified tqual, Objects *tiargs)
extern (D) this(const ref Loc loc, Identifier ident, TypeQualified tqual, Objects* tiargs)
{
super(loc,
tqual.idents.length ? cast(Identifier)tqual.idents[tqual.idents.length - 1] : (cast(TypeIdentifier)tqual).ident,
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/compiler.d
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ extern (C++) struct Compiler
* semantic analysis of a statement when importing DMD as a library
*/
__gshared OnStatementSemanticStart onStatementSemanticStart
= function void(Statement s, Scope *sc) {};
= function void(Statement s, Scope* sc) {};

/**
* Used to insert functionality after the end of the
* semantic analysis of a statement when importing DMD as a library
*/
__gshared OnStatementSemanticDone onStatementSemanticDone
= function void(Statement s, Scope *sc) {};
= function void(Statement s, Scope* sc) {};
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ extern (C++) final class StaticForeach : RootObject
return;
}

Expressions *es;
Expressions* es;
if (auto ale = aggr.isArrayLiteralExp())
{
// Directly use the elements of the array for the TupleExp creation
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/console.d
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private final class WindowsConsole : Console
HANDLE handle;
FILE* _fp;

static HANDLE getStdHandle(FILE *fp)
static HANDLE getStdHandle(FILE* fp)
{
/* Determine if stream fp is a console
*/
Expand Down
8 changes: 4 additions & 4 deletions compiler/src/dmd/cxxfrontend.d
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ const(char)* parametersTypeToChars(ParameterList pl)
/***********************************************************
* iasm.d
*/
Statement asmSemantic(AsmStatement s, Scope *sc)
Statement asmSemantic(AsmStatement s, Scope* sc)
{
import dmd.iasm;
return dmd.iasm.asmSemantic(s, sc);
}

void asmSemantic(CAsmDeclaration d, Scope *sc)
void asmSemantic(CAsmDeclaration d, Scope* sc)
{
import dmd.iasm;
return dmd.iasm.asmSemantic(d, sc);
Expand All @@ -353,13 +353,13 @@ void asmSemantic(CAsmDeclaration d, Scope *sc)
/***********************************************************
* iasmgcc.d
*/
Statement gccAsmSemantic(GccAsmStatement s, Scope *sc)
Statement gccAsmSemantic(GccAsmStatement s, Scope* sc)
{
import dmd.iasmgcc;
return dmd.iasmgcc.gccAsmSemantic(s, sc);
}

void gccAsmSemantic(CAsmDeclaration d, Scope *sc)
void gccAsmSemantic(CAsmDeclaration d, Scope* sc)
{
import dmd.iasmgcc;
return dmd.iasmgcc.gccAsmSemantic(d, sc);
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/dcast.d
Original file line number Diff line number Diff line change
Expand Up @@ -3920,7 +3920,7 @@ LmodCompare:
return convert(e1, t2);

/// Covers array operations for user-defined types
Type checkArrayOpType(Expression e1, Expression e2, EXP op, Scope *sc)
Type checkArrayOpType(Expression e1, Expression e2, EXP op, Scope* sc)
{
// scalar op scalar - we shouldn't be here
if (e1.type.ty != Tarray && e1.type.ty != Tsarray && e2.type.ty != Tarray && e2.type.ty != Tsarray)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/doc.d
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@ Parameter isFunctionParameter(Dsymbols* a, const(char)[] p) @safe

/****************************************************
*/
Parameter isEponymousFunctionParameter(Dsymbols *a, const(char)[] p) @safe
Parameter isEponymousFunctionParameter(Dsymbols* a, const(char)[] p) @safe
{
foreach (Dsymbol dsym; *a)
{
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import dmd.visitor;
import dmd.common.outbuffer;

/***************************************
* Calls dg(Dsymbol *sym) for each Dsymbol.
* Calls dg(Dsymbol* sym) for each Dsymbol.
* If dg returns !=0, stops and returns that value else returns 0.
* Params:
* symbols = Dsymbols
Expand Down Expand Up @@ -84,7 +84,7 @@ int foreachDsymbol(Dsymbols* symbols, scope int delegate(Dsymbol) dg)
}

/***************************************
* Calls dg(Dsymbol *sym) for each Dsymbol.
* Calls dg(Dsymbol* sym) for each Dsymbol.
* Params:
* symbols = Dsymbols
* dg = delegate to call for each Dsymbol
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/dsymbolsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private bool checkDeprecatedAliasThis(AliasThis at, const ref Loc loc, Scope* sc
}

// Save the scope and defer semantic analysis on the Dsymbol.
void deferDsymbolSemantic(Scope* sc, Dsymbol s, Scope *scx)
void deferDsymbolSemantic(Scope* sc, Dsymbol s, Scope* scx)
{
s._scope = scx ? scx : sc.copy();
s._scope.setNoFree();
Expand Down
Loading

0 comments on commit 9709375

Please sign in to comment.