Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
peetw committed Jan 19, 2024
1 parent 2056a87 commit 5c8a953
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions NHibernate.Spatial.MySQL/Type/MySQLWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public class MySQLWriter : WKBWriter
{
public override byte[] Write(Geometry geometry)
{
byte[] bytes = new byte[SetByteStream(geometry)];
#pragma warning disable CS0618 // Type or member is obsolete
int size = SetByteStream(geometry) + sizeof(int);
#pragma warning restore CS0618 // Type or member is obsolete
byte[] bytes = new byte[size];
Write(geometry, new MemoryStream(bytes));
return bytes;
}
Expand All @@ -49,14 +52,11 @@ public override void Write(Geometry geometry, Stream stream)
}
}

protected override int SetByteStream(Geometry geometry)
{
return base.SetByteStream(geometry) + 4; // sizeof(int)
}

protected void WriteGeometryCollectionEmpty(Geometry geometry, BinaryWriter writer)
{
#pragma warning disable CS0618 // Type or member is obsolete
WriteByteOrder(writer);
#pragma warning restore CS0618 // Type or member is obsolete
if (geometry.Coordinate == null || double.IsNaN(geometry.Coordinate.Z))
{
writer.Write((int) WKBGeometryTypes.WKBGeometryCollection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ protected override Type[] Mappings
{
return new[]
{
#pragma warning disable 0436
typeof(NtsTestCase)
#pragma warning restore 0436
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ protected override Type[] Mappings
{
return new[]
{
#pragma warning disable 0436
typeof(LineStringEntity),
typeof(MultiLineStringEntity),
typeof(MultiPointEntity),
typeof(MultiPolygonEntity),
typeof(PointEntity),
typeof(PolygonEntity),
typeof(PolygonEntity)
#pragma warning restore 0436
};
}
}
Expand Down

0 comments on commit 5c8a953

Please sign in to comment.