mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-05-12 03:22:08 +00:00
Suppressed unused field warnings. The code is like that on purpose.
This commit is contained in:
parent
5ed98455d9
commit
f0dd1370d8
|
@ -1,44 +1,46 @@
|
||||||
// This code is in the Public Domain. It is provided "as is"
|
// This code is in the Public Domain. It is provided "as is"
|
||||||
// without express or implied warranty of any kind.
|
// without express or implied warranty of any kind.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace Examples.Tests
|
#pragma warning disable 0649 // Do not warn about unitialized fields, this is on purpose
|
||||||
{
|
|
||||||
struct Simple { public int Value; }
|
namespace Examples.Tests
|
||||||
struct Generic<T> { public T Value; }
|
{
|
||||||
enum Enum { First, Second }
|
struct Simple { public int Value; }
|
||||||
struct Complex { public Simple Value; }
|
struct Generic<T> { public T Value; }
|
||||||
struct Complex<T> { public Generic<T> Value; }
|
enum Enum { First, Second }
|
||||||
struct Complex2 { public Enum Value; }
|
struct Complex { public Simple Value; }
|
||||||
struct Complex3 { public Class Value; }
|
struct Complex<T> { public Generic<T> Value; }
|
||||||
struct Complex4 : Interface { public Class Value; }
|
struct Complex2 { public Enum Value; }
|
||||||
class Class { public int Value; }
|
struct Complex3 { public Class Value; }
|
||||||
class Class<T> { public T Value; }
|
struct Complex4 : Interface { public Class Value; }
|
||||||
interface Interface { }
|
class Class { public int Value; }
|
||||||
|
class Class<T> { public T Value; }
|
||||||
[Example("Blittable Value Types", ExampleCategory.OpenTK, "Test", Documentation="BlittableValueTypes")]
|
interface Interface { }
|
||||||
public class BlittableValueTypes
|
|
||||||
{
|
[Example("Blittable Value Types", ExampleCategory.OpenTK, "Test", Documentation="BlittableValueTypes")]
|
||||||
public static void Main()
|
public class BlittableValueTypes
|
||||||
{
|
{
|
||||||
TestType(new Simple());
|
public static void Main()
|
||||||
TestType(new Generic<Simple>());
|
{
|
||||||
TestType(new Generic<Enum>());
|
TestType(new Simple());
|
||||||
TestType(new Complex());
|
TestType(new Generic<Simple>());
|
||||||
TestType(new Complex<Enum>());
|
TestType(new Generic<Enum>());
|
||||||
TestType(new Complex2());
|
TestType(new Complex());
|
||||||
TestType(new Complex3());
|
TestType(new Complex<Enum>());
|
||||||
TestType(new Complex4());
|
TestType(new Complex2());
|
||||||
TestType(new Class());
|
TestType(new Complex3());
|
||||||
TestType(new Class<Simple>());
|
TestType(new Complex4());
|
||||||
}
|
TestType(new Class());
|
||||||
|
TestType(new Class<Simple>());
|
||||||
// Tests whether specified type is blittable and prints its marshalled size if so.
|
}
|
||||||
static void TestType<T>(T instance)
|
|
||||||
|
// Tests whether specified type is blittable and prints its marshalled size if so.
|
||||||
|
static void TestType<T>(T instance)
|
||||||
{
|
{
|
||||||
PrintType<T>();
|
PrintType<T>();
|
||||||
|
|
||||||
|
@ -52,9 +54,9 @@ namespace Examples.Tests
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Trace.Write(String.Format("({0})", e.GetType().Name));
|
Trace.Write(String.Format("({0})", e.GetType().Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
Trace.WriteLine("");
|
Trace.WriteLine("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints a simple description for the type.
|
// Prints a simple description for the type.
|
||||||
|
@ -71,6 +73,6 @@ namespace Examples.Tests
|
||||||
|
|
||||||
Trace.Write(typename.Substring(typename.LastIndexOf('.') + 1));
|
Trace.Write(typename.Substring(typename.LastIndexOf('.') + 1));
|
||||||
Trace.Write(" } ");
|
Trace.Write(" } ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue