Skip to content

Commit

Permalink
Merge pull request CosmosOS#2294 from CosmosOS/fix/ordinal-plug
Browse files Browse the repository at this point in the history
Fix plugs
  • Loading branch information
MishaTy authored Jun 13, 2022
2 parents 3f181f7 + a6ff577 commit e371285
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 90 deletions.
3 changes: 0 additions & 3 deletions source/Cosmos.Core_Plugs/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[*.cs]
indent_size = 4

[System/MulticastDelegateImpl.cs]
indent_size = 2
2 changes: 1 addition & 1 deletion source/Cosmos.Core_Plugs/Interop/GlobalizationImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static unsafe void ChangeCaseInvariant(char* aChar, int aInt, char* aChar
{
throw new NotImplementedException();
}
[PlugMethod(Signature = "System_Void__Interop_Globalization_InitOrdinalCasingPage_System_Int32__System_Char__")]
[PlugMethod(Signature = "System_Void__Interop_Globalization_InitOrdinalCasingPage_System_Int32__System_Char#_")]
public static void InitOrdinalCasingPage()
{
throw new NotImplementedException();
Expand Down
12 changes: 7 additions & 5 deletions source/Cosmos.Core_Plugs/System/Globalization/OrdinalImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@

namespace Cosmos.Core_Plugs.System.Globalization
{
[Plug(TargetName = "Interop+Globalization, System.Private.CoreLib")]
class OrdinalImpl
{
[PlugMethod(IsOptional =false, PlugRequired =true)]
[PlugMethod(Signature = "System_Int32__System_Globalization_Ordinal_CompareStringIgnoreCaseNonAscii__System_Char__System_Int32___System_Char__System_Int32_", PlugRequired = true, IsOptional =false)]
public static unsafe int CompareStringIgnoreCaseNonAscii(char* aStrA, int aLengthA, char* aStrB, int aLengthB)
{
if(aLengthA < aLengthB)
if (aLengthA < aLengthB)
{
return -1;
} else if(aLengthA > aLengthB)
}
else if (aLengthA > aLengthB)
{
return 1;
}
for (int i = 0; i < aLengthA; i++)
{
if(aStrA[i] < aStrB[i])
if (aStrA[i] < aStrB[i])
{
return -1;
}
else if(aStrA[i] < aStrB[i])
else if (aStrA[i] < aStrB[i])
{
return 1;
}
Expand Down
29 changes: 7 additions & 22 deletions source/Cosmos.Core_Plugs/System/MulticastDelegateImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@

namespace Cosmos.Core_Plugs.System
{

[Plug(Target = typeof(MulticastDelegate))]
public class MulticastDelegateImpl
{
public static bool Equals(MulticastDelegate aThis, object aThat)
[Plug(Target = typeof(MulticastDelegate))]
public class MulticastDelegateImpl
{
// todo: implement MulticastDelegate.Equals(MulticastDelegate)
return false;
}

public static bool TrySetSlot(MulticastDelegate multicastDelegate, object[] a, int index, object o)
{
if (a[index] == null)
{
a[index] = o;
}

if (a[index] != null)
{
return false;
}
return false;
public static bool Equals(MulticastDelegate aThis, object aThat)
{
// todo: implement MulticastDelegate.Equals(MulticastDelegate)
return false;
}
}
}
}
5 changes: 0 additions & 5 deletions source/Cosmos.Core_Plugs/System/TimeZoneInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,5 @@ public static TimeSpan GetLocalUtcOffset(DateTime aDateTime, TimeZoneInfoOptions
{
throw new NotImplementedException();
}

public static string TryGetLocalizedNameByMuiNativeResource(string aString)
{
throw new NotImplementedException();
}
}
}
4 changes: 0 additions & 4 deletions source/Cosmos.System2_Plugs/System/DateTimeImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ public static class DateTimeImpl
// TODO: get timezone
public static DateTime UtcNow => Now;



public static long GetSystemTimeAsFileTime() => Now.Ticks;

private static readonly string[] DaysOfWeekStrings = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
private static readonly string[] MonthsStrings = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };

Expand Down
12 changes: 0 additions & 12 deletions source/Cosmos.System2_Plugs/System/RandomImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ public static void Ctor(Random aThis, int seed)
seed = 1;
}

public static int GenerateGlobalSeed()
{
counter++;

if (counter == Int32.MaxValue - 1)
{
counter = 0;
}

return counter + RTC.Second * 1000;
}

private static double Sample()
{
//Including this division at the end gives us significantly improved
Expand Down

This file was deleted.

20 changes: 0 additions & 20 deletions source/Cosmos.System2_Plugs/System/Threading/ThreadImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public static int GetCurrentProcessorNumber()
throw new NotImplementedException();
}

public static int GetOptimalMaxSpinWaitsPerSpinIterationInternal()
{
throw new NotImplementedException();
}

public static Thread GetCurrentThreadNative()
{
return null;
Expand All @@ -53,21 +48,6 @@ public static void SetBackgroundNative(Thread aThis, bool aBool)
throw new NotImplementedException();
}

public static void StartupSetApartmentStateInternal(Thread aThis)
{
throw new NotImplementedException();
}

public static void StartInternal(Thread aThis)
{
throw new NotImplementedException();
}

public static void SetStart(Thread aThis, Delegate aDelegate, int aInt)
{
throw new NotImplementedException();
}

public static void SpinWait(int aInt)
{
throw new NotImplementedException();
Expand Down

0 comments on commit e371285

Please sign in to comment.