ITimeZoneService rewrite (#722)

* Clean up ITimeZoneService

Add error codes and simplify parsing

* Add accurate timezone logic

TOOD: LoadTimeZoneRule and location name cmds.

* Integrate the new TimeZone logic

* SCREAMING_UNIX_CASE => PascalCase

* Address comments

* Reduce use of pointer in the LoadTimeZoneRule logic

* Address comments

* Realign tzIfStream logic in LoadTimeZoneRule

* Address gdk's comments
This commit is contained in:
Thomas Guillemard 2019-07-04 17:20:40 +02:00 committed by Ac_K
parent 789cdba8b5
commit 708620252e
9 changed files with 2296 additions and 160 deletions

View file

@ -95,5 +95,31 @@ namespace Ryujinx.HLE.Utilities
return Encoding.UTF8.GetString(ms.ToArray());
}
}
public static unsafe int CompareCStr(char* s1, char* s2)
{
int s1Index = 0;
int s2Index = 0;
while (s1[s1Index] != 0 && s2[s2Index] != 0 && s1[s1Index] == s2[s2Index])
{
s1Index += 1;
s2Index += 1;
}
return s2[s2Index] - s1[s1Index];
}
public static unsafe int LengthCstr(char* s)
{
int i = 0;
while (s[i] != '\0')
{
i++;
}
return i;
}
}
}