mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Warn on deprecated brace initializer syntax
This commit is contained in:
parent
ffee0a2aa3
commit
4369e07a55
12 changed files with 36 additions and 34 deletions
|
@ -83,7 +83,7 @@ namespace System
|
|||
|
||||
protected virtual void* AllocLarge(int size, int align)
|
||||
{
|
||||
return new uint8[size]* {?};
|
||||
return new uint8[size]* (?);
|
||||
}
|
||||
|
||||
protected virtual void FreeLarge(void* ptr)
|
||||
|
@ -95,7 +95,7 @@ namespace System
|
|||
{
|
||||
int poolSize = (mPools != null) ? mPools.Count : 0;
|
||||
int allocSize = Math.Clamp((int)Math.Pow(poolSize, 1.5) * 4*1024, 4*1024, 64*1024);
|
||||
return Span<uint8>(new uint8[allocSize]* {?}, allocSize);
|
||||
return Span<uint8>(new uint8[allocSize]* (?), allocSize);
|
||||
}
|
||||
|
||||
protected virtual void FreePool(Span<uint8> span)
|
||||
|
|
|
@ -59,10 +59,10 @@ namespace System
|
|||
private const int32 DatePartMonth = 2;
|
||||
private const int32 DatePartDay = 3;
|
||||
|
||||
private static readonly int32[] DaysToMonth365 = new int32[]{
|
||||
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365} ~ delete _;
|
||||
private static readonly int32[] DaysToMonth366 = new int32[]{
|
||||
0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} ~ delete _;
|
||||
private static readonly int32[] DaysToMonth365 = new int32[](
|
||||
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365) ~ delete _;
|
||||
private static readonly int32[] DaysToMonth366 = new int32[](
|
||||
0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366) ~ delete _;
|
||||
|
||||
public static readonly DateTime MinValue = DateTime(MinTicks, DateTimeKind.Unspecified);
|
||||
public static readonly DateTime MaxValue = DateTime(MaxTicks, DateTimeKind.Unspecified);
|
||||
|
|
|
@ -210,7 +210,7 @@ namespace System.Globalization
|
|||
else
|
||||
{
|
||||
// For all others just use the an empty string (doesn't matter we'll never ask for it for other calendars)
|
||||
this.saAbbrevEnglishEraNames = new String[] { "" };
|
||||
this.saAbbrevEnglishEraNames = new String[] ( "" );
|
||||
}
|
||||
|
||||
// Japanese is the only thing with > 1 era. Its current era # is how many ever
|
||||
|
|
|
@ -126,18 +126,18 @@ namespace System {
|
|||
static readonly TimeSpan NullOffset = TimeSpan.MinValue;
|
||||
|
||||
static char8[] allStandardFormats = new char8[]
|
||||
{
|
||||
(
|
||||
'd', 'D', 'f', 'F', 'g', 'G',
|
||||
'm', 'M', 'o', 'O', 'r', 'R',
|
||||
's', 't', 'T', 'u', 'U', 'y', 'Y',
|
||||
} ~ delete _;
|
||||
) ~ delete _;
|
||||
|
||||
const String RoundtripFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK";
|
||||
const String RoundtripDateTimeUnfixed = "yyyy'-'MM'-'ddTHH':'mm':'ss zzz";
|
||||
|
||||
private const int DEFAULT_ALL_DATETIMES_SIZE = 132;
|
||||
|
||||
static String[] fixedNumberFormats = new String[] {
|
||||
static String[] fixedNumberFormats = new String[] (
|
||||
"0",
|
||||
"00",
|
||||
"000",
|
||||
|
@ -145,7 +145,7 @@ namespace System {
|
|||
"00000",
|
||||
"000000",
|
||||
"0000000",
|
||||
} ~ delete _;
|
||||
) ~ delete _;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
|
@ -54,14 +54,14 @@ namespace System.Globalization {
|
|||
GregorianCalendarTypes m_type;
|
||||
|
||||
static readonly int[] DaysToMonth365 = new int[]
|
||||
{
|
||||
(
|
||||
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
|
||||
} ~ delete _;
|
||||
) ~ delete _;
|
||||
|
||||
static readonly int[] DaysToMonth366 = new int[]
|
||||
{
|
||||
(
|
||||
0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366
|
||||
} ~ delete _;
|
||||
) ~ delete _;
|
||||
|
||||
private static volatile Calendar s_defaultInstance;
|
||||
|
||||
|
@ -426,7 +426,7 @@ namespace System.Globalization {
|
|||
{
|
||||
get
|
||||
{
|
||||
return (new int[] {ADEra} );
|
||||
return (new int[] (ADEra) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,9 +90,9 @@ namespace System.Globalization {
|
|||
// DO NOT UPDATE THIS WITHOUT UPDATING THAT STRUCTURE. IF YOU ADD BOOL, ADD THEM AT THE END.
|
||||
// ALSO MAKE SURE TO UPDATE mscorlib.h in the VM directory to check field offsets.
|
||||
// READTHIS READTHIS READTHIS
|
||||
protected int32[] numberGroupSizes = new int32[] {3} ~ delete _;
|
||||
protected int32[] currencyGroupSizes = new int32[] {3} ~ delete _;
|
||||
protected int32[] percentGroupSizes = new int32[] {3} ~ delete _;
|
||||
protected int32[] numberGroupSizes = new int32[] (3) ~ delete _;
|
||||
protected int32[] currencyGroupSizes = new int32[] (3) ~ delete _;
|
||||
protected int32[] percentGroupSizes = new int32[] (3) ~ delete _;
|
||||
protected OwnedString positiveSign = .("+") ~ _.Dispose();
|
||||
protected OwnedString negativeSign = .("-") ~ _.Dispose();
|
||||
protected OwnedString numberDecimalSeparator = .(".") ~ _.Dispose();
|
||||
|
@ -112,7 +112,7 @@ namespace System.Globalization {
|
|||
protected OwnedString percentSymbol = .("%") ~ _.Dispose();
|
||||
protected OwnedString perMilleSymbol = .("\u{2030}") ~ _.Dispose();
|
||||
|
||||
protected String[] nativeDigits = new .[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} ~ DeleteNativeDigits();
|
||||
protected String[] nativeDigits = new .[] ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") ~ DeleteNativeDigits();
|
||||
|
||||
protected int32 numberDecimalDigits = 2;
|
||||
protected int32 currencyDecimalDigits = 2;
|
||||
|
|
|
@ -375,7 +375,7 @@ namespace System.IO
|
|||
}
|
||||
else
|
||||
{
|
||||
buf = new char16[123]* { ? };
|
||||
buf = new char16[123]* ( ? );
|
||||
defer:mixin delete buf;
|
||||
}
|
||||
buf
|
||||
|
|
|
@ -139,7 +139,7 @@ namespace System.Reflection
|
|||
if (!methodInfo.IsInitialized)
|
||||
return .Err;
|
||||
|
||||
void* data = new [Align(16)] uint8[mInstSize]* {?};
|
||||
void* data = new [Align(16)] uint8[mInstSize]* (?);
|
||||
|
||||
if (methodInfo.Invoke(data) case .Err)
|
||||
{
|
||||
|
|
|
@ -321,7 +321,7 @@ namespace System
|
|||
|
||||
protected virtual void* Alloc(int size, int align)
|
||||
{
|
||||
return new char8[size]* {?};
|
||||
return new char8[size]* (?);
|
||||
}
|
||||
|
||||
protected virtual void Free(void* ptr)
|
||||
|
@ -2196,11 +2196,11 @@ namespace System
|
|||
char16* buf;
|
||||
if (encodedLen < 128)
|
||||
{
|
||||
buf = scope:mixin char16[encodedLen]* { ? };
|
||||
buf = scope:mixin char16[encodedLen]* ( ? );
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = new char16[encodedLen]* { ? };
|
||||
buf = new char16[encodedLen]* ( ? );
|
||||
defer:mixin delete buf;
|
||||
}
|
||||
|
||||
|
@ -3212,11 +3212,11 @@ namespace System
|
|||
char16* buf;
|
||||
if (encodedLen < 128)
|
||||
{
|
||||
buf = scope:mixin char16[encodedLen]* { ? };
|
||||
buf = scope:mixin char16[encodedLen]* ( ? );
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = new char16[encodedLen]* { ? };
|
||||
buf = new char16[encodedLen]* ( ? );
|
||||
defer:mixin delete buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,11 +208,11 @@ static
|
|||
void* data;
|
||||
if (size <= 128)
|
||||
{
|
||||
data = scope:mixin [Align(align)] uint8[size]* { ? };
|
||||
data = scope:mixin [Align(align)] uint8[size]* ( ? );
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new [Align(align)] uint8[size]* { ? };
|
||||
data = new [Align(align)] uint8[size]* ( ? );
|
||||
defer:mixin delete data;
|
||||
}
|
||||
data
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace System.Text
|
|||
class UTF8
|
||||
{
|
||||
public static int8* sTrailingBytesForUTF8 = new int8[]*
|
||||
{
|
||||
(
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
|
@ -12,13 +12,13 @@ namespace System.Text
|
|||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
|
||||
} ~ delete _;
|
||||
) ~ delete _;
|
||||
|
||||
public static uint32* sOffsetsFromUTF8 = new uint32[]*
|
||||
{
|
||||
0x00000000, 0x00003080, 0x000E2080,
|
||||
(
|
||||
0x00000000, 0x00003080, 0x000E2080,
|
||||
0x03C82080, 0xFA082080, 0x82082080
|
||||
} ~ delete _;
|
||||
) ~ delete _;
|
||||
|
||||
public static int GetEncodedLength(char32 c)
|
||||
{
|
||||
|
|
|
@ -7512,6 +7512,8 @@ BfObjectCreateExpression* BfReducer::CreateObjectCreateExpression(BfAstNode* all
|
|||
|
||||
if (auto block = BfNodeDynCast<BfBlock>(mVisitorPos.GetNext()))
|
||||
{
|
||||
mPassInstance->Warn(0, "Expected '('", block->mOpenBrace);
|
||||
|
||||
mVisitorPos.MoveNext();
|
||||
MEMBER_SET(objectCreateExpr, mOpenToken, block->mOpenBrace);
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue