Skip to content

Commit

Permalink
Use camelCasing in all Type predicate members (dlang#16811)
Browse files Browse the repository at this point in the history
Other Type predicate functions already use these casing rules like isZeroInit and isClassHandle
  • Loading branch information
nordlow authored Aug 26, 2024
1 parent b531a71 commit b7f8639
Show file tree
Hide file tree
Showing 33 changed files with 351 additions and 351 deletions.
8 changes: 4 additions & 4 deletions compiler/src/dmd/argtypes_aarch64.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TypeTuple toArgTypes_aarch64(Type t)
return null;

Type tb = t.toBasetype();
const isAggregate = tb.ty == Tstruct || tb.ty == Tsarray || tb.ty == Tarray || tb.ty == Tdelegate || tb.iscomplex();
const isAggregate = tb.ty == Tstruct || tb.ty == Tsarray || tb.ty == Tarray || tb.ty == Tdelegate || tb.isComplex();
if (!isAggregate)
return new TypeTuple(t);

Expand Down Expand Up @@ -88,7 +88,7 @@ TypeTuple toArgTypes_aarch64(Type t)
bool isHFVA(Type t, int maxNumElements = 4, Type* rewriteType = null)
{
t = t.toBasetype();
if ((t.ty != Tstruct && t.ty != Tsarray && !t.iscomplex()) || !isPOD(t))
if ((t.ty != Tstruct && t.ty != Tsarray && !t.isComplex()) || !isPOD(t))
return false;

Type fundamentalType;
Expand Down Expand Up @@ -165,12 +165,12 @@ size_t getNestedHFVA(Type t, ref Type fundamentalType)
thisFundamentalType = t;
N = 1;
}
else if (t.isfloating()) // incl. imaginary and complex
else if (t.isFloating()) // incl. imaginary and complex
{
auto ftSize = t.size();
N = 1;

if (t.iscomplex())
if (t.isComplex())
{
ftSize /= 2;
N = 2;
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dmd/argtypes_x86.d
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ TypeTuple toArgTypes_x86(Type t)
if (t1.ty == Tfloat32 && t2.ty == Tfloat32 && offset2 == 4)
return Type.tfloat64;
// Merging floating and non-floating types produces the non-floating type
if (t1.isfloating())
if (t1.isFloating())
{
if (!t2.isfloating())
if (!t2.isFloating())
t1 = mergeFloatToInt(t1);
}
else if (t2.isfloating())
else if (t2.isFloating())
t2 = mergeFloatToInt(t2);
Type t;
// Pick type with larger size
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -3385,7 +3385,7 @@ struct ASTBase
}

// TypeBasic, TypeVector, TypePointer, TypeEnum override this method
bool isscalar()
bool isScalar()
{
return false;
}
Expand Down Expand Up @@ -3589,7 +3589,7 @@ struct ASTBase
merge();
}

override bool isscalar()
override bool isScalar()
{
return (flags & (TFlags.integral | TFlags.floating)) != 0;
}
Expand Down Expand Up @@ -4748,7 +4748,7 @@ struct ASTBase
{
super(loc, EXP.int64, __traits(classInstanceSize, IntegerExp));
assert(type);
if (!type.isscalar())
if (!type.isScalar())
{
if (type.ty != Terror)
error("integral constant must be scalar type, not %s", type.toChars());
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/builtin.d
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ BUILTIN determine_builtin(FuncDeclaration func)
// Only match pow(fp,fp) where fp is a floating point type
if (id3 == Id._pow)
{
if ((*fd.parameters)[0].type.isfloating() &&
(*fd.parameters)[1].type.isfloating())
if ((*fd.parameters)[0].type.isFloating() &&
(*fd.parameters)[1].type.isFloating())
return BUILTIN.pow;
return BUILTIN.unimp;
}
Expand Down
22 changes: 11 additions & 11 deletions compiler/src/dmd/chkformat.d
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ bool checkPrintfFormat(ref const Loc loc, scope const char[] format, scope Expre

case Format.lu: // unsigned long int
case Format.ld: // long int
if (!(t.isintegral() && t.size() == c_longsize))
if (!(t.isIntegral() && t.size() == c_longsize))
{
if (fmt == Format.lu)
errorMsg(null, e, (c_longsize == 4 ? "uint" : "ulong"), t);
else
errorMsg(null, e, (c_longsize == 4 ? "int" : "long"), t);
if (t.isintegral() && t.size() != c_longsize)
if (t.isIntegral() && t.size() != c_longsize)
eSink.errorSupplemental(e.loc, "C `long` is %d bytes on your system", c_longsize);
}
break;
Expand All @@ -203,12 +203,12 @@ bool checkPrintfFormat(ref const Loc loc, scope const char[] format, scope Expre
break;

case Format.zd: // size_t
if (!(t.isintegral() && t.size() == ptrsize))
if (!(t.isIntegral() && t.size() == ptrsize))
errorMsg(null, e, "size_t", t);
break;

case Format.td: // ptrdiff_t
if (!(t.isintegral() && t.size() == ptrsize))
if (!(t.isIntegral() && t.size() == ptrsize))
errorMsg(null, e, "ptrdiff_t", t);
break;

Expand All @@ -234,7 +234,7 @@ bool checkPrintfFormat(ref const Loc loc, scope const char[] format, scope Expre
break;

case Format.ln: // pointer to long int
if (!(t.ty == Tpointer && tnext.isintegral() && tnext.size() == c_longsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && tnext.size() == c_longsize))
errorMsg(null, e, (c_longsize == 4 ? "int*" : "long*"), t);
break;

Expand All @@ -259,12 +259,12 @@ bool checkPrintfFormat(ref const Loc loc, scope const char[] format, scope Expre
break;

case Format.zn: // pointer to size_t
if (!(t.ty == Tpointer && tnext.isintegral() && tnext.isunsigned() && tnext.size() == ptrsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && tnext.isUnsigned() && tnext.size() == ptrsize))
errorMsg(null, e, "size_t*", t);
break;

case Format.tn: // pointer to ptrdiff_t
if (!(t.ty == Tpointer && tnext.isintegral() && !tnext.isunsigned() && tnext.size() == ptrsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && !tnext.isUnsigned() && tnext.size() == ptrsize))
errorMsg(null, e, "ptrdiff_t*", t);
break;

Expand Down Expand Up @@ -414,7 +414,7 @@ bool checkScanfFormat(ref const Loc loc, scope const char[] format, scope Expres

case Format.ln:
case Format.ld: // pointer to long int
if (!(t.ty == Tpointer && tnext.isintegral() && !tnext.isunsigned() && tnext.size() == c_longsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && !tnext.isUnsigned() && tnext.size() == c_longsize))
errorMsg(null, e, (c_longsize == 4 ? "int*" : "long*"), t);
break;

Expand All @@ -432,13 +432,13 @@ bool checkScanfFormat(ref const Loc loc, scope const char[] format, scope Expres

case Format.zn:
case Format.zd: // pointer to size_t
if (!(t.ty == Tpointer && tnext.isintegral() && tnext.isunsigned() && tnext.size() == ptrsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && tnext.isUnsigned() && tnext.size() == ptrsize))
errorMsg(null, e, "size_t*", t);
break;

case Format.tn:
case Format.td: // pointer to ptrdiff_t
if (!(t.ty == Tpointer && tnext.isintegral() && !tnext.isunsigned() && tnext.size() == ptrsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && !tnext.isUnsigned() && tnext.size() == ptrsize))
errorMsg(null, e, "ptrdiff_t*", t);
break;

Expand All @@ -458,7 +458,7 @@ bool checkScanfFormat(ref const Loc loc, scope const char[] format, scope Expres
break;

case Format.lu: // pointer to unsigned long int
if (!(t.ty == Tpointer && tnext.isintegral() && tnext.isunsigned() && tnext.size() == c_longsize))
if (!(t.ty == Tpointer && tnext.isIntegral() && tnext.isUnsigned() && tnext.size() == c_longsize))
errorMsg(null, e, (c_longsize == 4 ? "uint*" : "ulong*"), t);
break;

Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/clone.d
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ bool needOpEquals(StructDeclaration sd)
if (needOpEquals(ts.sym))
goto Lneed;
}
if (tvbase.isfloating())
if (tvbase.isFloating())
{
// This is necessray for:
// 1. comparison of +0.0 and -0.0 should be true.
Expand Down Expand Up @@ -767,7 +767,7 @@ private bool needToHash(StructDeclaration sd)
if (needToHash(ts.sym))
goto Lneed;
}
if (tvbase.isfloating())
if (tvbase.isFloating())
{
/* This is necessary because comparison of +0.0 and -0.0 should be true,
* i.e. not a bit compare.
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 @@ -398,7 +398,7 @@ extern (C++) final class StaticForeach : RootObject
Expression aggr = void;
Type indexty = void;

if (rangefe && (indexty = ety).isintegral())
if (rangefe && (indexty = ety).isIntegral())
{
rangefe.lwr.type = indexty;
rangefe.upr.type = indexty;
Expand Down
Loading

0 comments on commit b7f8639

Please sign in to comment.