Skip to content

Commit 823485b

Browse files
authored
[3.0] Apply MaybeBool transformation to fields/properties (#2574)
* Update docs for TransformProperties to prepare for my boolean transformation change * Adjust doc wording * Cleanup and add missing file header * Change TransformFunctions.Configuration.BoolTypes to be non-nullable for simplicity The performance difference is negligible. * Add MaybeBool transformation to fields and properties * Update generator.json to use TransformProperties.BoolTypes * Add stdbool condition from BoolTransformer Not actually sure if this is ever going to be used, but I guess it will at least be consistent in behavior with BoolTransformer * Regenerate OpenAL, OpenGL, SDL, Vulkan using Windows * Add test: TransformPropertiesTests.Transforms_MaybeBool_FieldsAndProperties * Add test: TransformPropertiesTests.Transforms_Utf8String_StaticConstProperties * Add note on the bitfield case * Remove unused ModUtils.MemberIdentifiers() This was used by the syntax-based renamer (extremely old at this point) * Add MaybeBoolUtils.MaybeBoolType() factory method
1 parent 0080d4f commit 823485b

412 files changed

Lines changed: 1225 additions & 1051 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.silktouch/openal-clangsharp.stout

2 Bytes
Binary file not shown.

.silktouch/opengl-clangsharp.stout

0 Bytes
Binary file not shown.

.silktouch/sdl-clangsharp.stout

0 Bytes
Binary file not shown.

.silktouch/vulkan-clangsharp.stout

-12.6 KB
Binary file not shown.

generator.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
"SDL_bool": null
6969
}
7070
},
71+
"TransformProperties": {
72+
"BoolTypes": {
73+
"SDL_bool": null
74+
}
75+
},
7176
"IdentifySharedPrefixes": {
7277
"GlobalPrefixHints": ["SDL"]
7378
},
@@ -224,6 +229,11 @@
224229
"GLboolean": null
225230
}
226231
},
232+
"TransformProperties": {
233+
"BoolTypes": {
234+
"GLboolean": null
235+
}
236+
},
227237
"StripAttributes": {
228238
"Remove": [
229239
"NativeTypeName",
@@ -361,6 +371,12 @@
361371
},
362372
"BenefitOfTheDoubtArrayTransformation": true
363373
},
374+
"TransformProperties": {
375+
"BoolTypes": {
376+
"ALboolean": null,
377+
"ALCboolean": null
378+
}
379+
},
364380
"TransformHandles": {
365381
"UseDsl": true
366382
},
@@ -434,6 +450,11 @@
434450
"VkBool32": null
435451
}
436452
},
453+
"TransformProperties": {
454+
"BoolTypes": {
455+
"VkBool32": null
456+
}
457+
},
437458
"TransformHandles": {
438459
"UseDsl": true
439460
},

sources/SDL/SDL/SDL3/AssertData.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Silk.NET.SDL;
1111
public unsafe partial struct AssertData
1212
{
1313
[NativeName("always_ignore")]
14-
public byte AlwaysIgnore;
14+
public MaybeBool<byte> AlwaysIgnore;
1515

1616
[NativeName("trigger_count")]
1717
public uint TriggerCount;

sources/SDL/SDL/SDL3/AudioDeviceEvent.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public partial struct AudioDeviceEvent
2323
public uint Which;
2424

2525
[NativeName("recording")]
26-
public byte Recording;
26+
public MaybeBool<byte> Recording;
2727

2828
[NativeName("padding1")]
2929
public byte Padding1;

sources/SDL/SDL/SDL3/ClipboardEvent.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public unsafe partial struct ClipboardEvent
2020
public ulong Timestamp;
2121

2222
[NativeName("owner")]
23-
public byte Owner;
23+
public MaybeBool<byte> Owner;
2424

2525
[NativeName("num_mime_types")]
2626
public int NumMimeTypes;

sources/SDL/SDL/SDL3/GamepadButtonEvent.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public partial struct GamepadButtonEvent
2626
public byte Button;
2727

2828
[NativeName("down")]
29-
public byte Down;
29+
public MaybeBool<byte> Down;
3030

3131
[NativeName("padding1")]
3232
public byte Padding1;

sources/SDL/SDL/SDL3/GpuBlitInfo.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public partial struct GpuBlitInfo
2929
public GpuFilter Filter;
3030

3131
[NativeName("cycle")]
32-
public byte Cycle;
32+
public MaybeBool<byte> Cycle;
3333

3434
[NativeName("padding1")]
3535
public byte Padding1;

0 commit comments

Comments
 (0)