Compare commits

...
3 Commits
Author SHA1 Message Date
korenkonder 3c13856667 Release v0.4.10.18
Fixed incorrect reading of `byte` and `short` in `JSON`
2023-07-04 05:32:14 +03:00
korenkonder 00d25ff67b Release v0.4.10.17
JSON
2023-06-03 23:57:42 +03:00
korenkonder a1c18941a1 Patch for release v0.4.10.16 2023-05-29 22:53:10 +03:00
3 changed files with 11 additions and 13 deletions
+7 -9
View File
@@ -46,9 +46,9 @@ namespace KKdMainLib.IO
{
buf.first = 1;
buf.data[0] = buf.data[buf.data.Length - 1];
byte[] temp = _IO.RBy(buf.data.Length - 1);
buf.length = temp.Length;
Array.Copy(temp, 0, buf.data, 1, temp.Length);
byte[] temp = new byte[buf.data.Length];
buf.length = _IO.RBy(buf.data.Length - 1, temp);
Array.Copy(temp, 0, buf.data, 1, buf.length);
}
if (buf.length < 1)
@@ -173,10 +173,8 @@ namespace KKdMainLib.IO
else
ReadDigit(ref buf, ref c, dig_buf, ref buf_pos, buf_end);
bool f = false;
if (c == '.')
{
f = true;
dig_buf[buf_pos++] = (byte)c;
if ((c = ReadChar(ref buf)) == -1)
return null;
@@ -194,7 +192,7 @@ namespace KKdMainLib.IO
SeekOne(ref buf);
return obj;
}
else if (c != 'e' && c != 'E' && !f)
else if (c != 'e' && c != 'E' && !fraction)
{
string temp = dig_buf.ToUTF8();
int null_term = temp.IndexOf('\0');
@@ -206,11 +204,11 @@ namespace KKdMainLib.IO
object obj;
unchecked
{
if (val >= 0x00 && val < 0xFF)
if (val >= 0x00 && val <= 0xFF)
obj = (byte)val;
else if (val >= (sbyte)0x80 && val <= (sbyte)0x7F)
obj = (sbyte)val;
else if (val >= 0x0000 && val < 0xFFFF)
else if (val >= 0x0000 && val <= 0xFFFF)
obj = (ushort)val;
else if (val >= (short)0x8000 && val <= (short)0x7FFF)
obj = (short)val;
@@ -243,7 +241,7 @@ namespace KKdMainLib.IO
int fnull_term = ftemp.IndexOf('\0');
if (fnull_term >= 0)
ftemp = ftemp.Substring(0, fnull_term);
if (!double.TryParse(ftemp, out double fval))
if (!ftemp.ToF64(out double fval))
return null;
object fobj;
+2 -2
View File
@@ -6,12 +6,12 @@
<Configuration></Configuration>
<Copyright>korenkonder (C) 2018-2023</Copyright>
<Description>A simple library for working with Project Diva AC/DT/F/AFT/F2/X/XHD/FT/VRFL/M39 files</Description>
<FileVersion>0.4.10.16</FileVersion>
<FileVersion>0.4.10.18</FileVersion>
<PackageId>KKdMainLib</PackageId>
<Product>KKdMainLib</Product>
<TargetFramework>net461</TargetFramework>
<Title>KKdMainLib</Title>
<Version>0.4.10.16</Version>
<Version>0.4.10.18</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("7B5D5A3A-A6F8-4813-C97D-ACFC98F7397E")]
[assembly: AssemblyVersion("0.4.10.16")]
[assembly: AssemblyFileVersion("0.4.10.16")]
[assembly: AssemblyVersion("0.4.10.18")]
[assembly: AssemblyFileVersion("0.4.10.18")]