Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[src] Expand multi-field single statements into multiple statements. #20489

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/AVFoundation/AVEdgeWidths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ namespace AVFoundation {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVEdgeWidths {
public nfloat /* CGFloat */ Left, Top, Right, Bottom;
public nfloat /* CGFloat */ Left;
public nfloat /* CGFloat */ Top;
public nfloat /* CGFloat */ Right;
public nfloat /* CGFloat */ Bottom;

public AVEdgeWidths (nfloat left, nfloat top, nfloat right, nfloat bottom)
{
Expand Down
17 changes: 12 additions & 5 deletions src/AVFoundation/AVTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ namespace AVFoundation {
[StructLayout (LayoutKind.Sequential)]
public struct AVAudio3DVectorOrientation {
#if !COREBUILD
public Vector3 Forward, Up;
public Vector3 Forward;
public Vector3 Up;

public AVAudio3DVectorOrientation (Vector3 forward, Vector3 up)
{
Expand Down Expand Up @@ -78,7 +79,9 @@ public override int GetHashCode ()
[StructLayout (LayoutKind.Sequential)]
public struct AVAudio3DAngularOrientation {

public float Yaw, Pitch, Roll;
public float Yaw;
public float Pitch;
public float Roll;

public override string ToString ()
{
Expand Down Expand Up @@ -126,7 +129,9 @@ public override int GetHashCode ()
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptureWhiteBalanceGains {
public float RedGain, GreenGain, BlueGain;
public float RedGain;
public float GreenGain;
public float BlueGain;

public AVCaptureWhiteBalanceGains (float redGain, float greenGain, float blueGain)
{
Expand Down Expand Up @@ -181,7 +186,8 @@ public override int GetHashCode ()
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptureWhiteBalanceChromaticityValues {
public float X, Y;
public float X;
public float Y;

public AVCaptureWhiteBalanceChromaticityValues (float x, float y)
{
Expand Down Expand Up @@ -231,7 +237,8 @@ public override int GetHashCode ()
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptureWhiteBalanceTemperatureAndTintValues {
public float Temperature, Tint;
public float Temperature;
public float Tint;

public AVCaptureWhiteBalanceTemperatureAndTintValues (float temperature, float tint)
{
Expand Down
37 changes: 28 additions & 9 deletions src/Accelerate/vImageTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ public int Height {
[StructLayout (LayoutKind.Sequential)]
public struct vImageAffineTransformFloat {
// all defined as 'float'
public float a, b, c, d;
public float tx, ty;
public float a;
public float b;
public float c;
public float d;
public float tx;
public float ty;

// TODO: constructor from CGAffineTransform, vImageAffineTransformDouble
}
Expand All @@ -109,8 +113,12 @@ public struct vImageAffineTransformFloat {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct vImageAffineTransformDouble {
public double a, b, c, d;
public double tx, ty;
public double a;
public double b;
public double c;
public double d;
public double tx;
public double ty;

// TODO: constructor from CGAffineTransform, vImageAffineTransformFloat
}
Expand Down Expand Up @@ -189,8 +197,10 @@ public enum vImageFlags : uint {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct PixelFFFF {
// all defined as 'float'
public float A, R, G, B;
public float A;
public float R;
public float G;
public float B;
public readonly static PixelFFFF Zero;
}

Expand All @@ -202,7 +212,10 @@ public struct PixelFFFF {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct Pixel8888 {
public byte A, R, G, B;
public byte A;
public byte R;
public byte G;
public byte B;
public readonly static Pixel8888 Zero;
}

Expand All @@ -214,7 +227,10 @@ public struct Pixel8888 {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct PixelARGB16U {
public Pixel16U A, R, G, B;
public Pixel16U A;
public Pixel16U R;
public Pixel16U G;
public Pixel16U B;
public readonly static PixelARGB16U Zero;
}

Expand All @@ -226,7 +242,10 @@ public struct PixelARGB16U {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct PixelARGB16S {
public Pixel16S A, R, G, B;
public Pixel16S A;
public Pixel16S R;
public Pixel16S G;
public Pixel16S B;
public readonly static PixelARGB16S Zero;
}

Expand Down
5 changes: 4 additions & 1 deletion src/AppKit/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ namespace AppKit {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct NSEdgeInsets {
public nfloat Top, Left, Bottom, Right;
public nfloat Top;
public nfloat Left;
public nfloat Bottom;
public nfloat Right;

public NSEdgeInsets (nfloat top, nfloat left, nfloat bottom, nfloat right)
{
Expand Down
4 changes: 3 additions & 1 deletion src/AudioToolbox/AudioFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ public class AudioPanningInfo {
struct Layout {
public PanningMode PanningMode;
public AudioChannelFlags CoordinateFlags;
public float Coord0, Coord1, Coord2;
public float Coord0;
public float Coord1;
public float Coord2;
public float GainScale;
public IntPtr OutputChannelMapWeak;
}
Expand Down
3 changes: 2 additions & 1 deletion src/AudioToolbox/AudioQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,8 @@ public unsafe AudioQueueStatus EnqueueBuffer (AudioQueueBuffer* buffer)
[SupportedOSPlatform ("tvos")]
#endif
public class AudioQueueTimeline : IDisposable {
internal protected IntPtr timelineHandle, queueHandle;
internal protected IntPtr timelineHandle;
internal protected IntPtr queueHandle;

internal AudioQueueTimeline (IntPtr queueHandle, IntPtr timelineHandle)
{
Expand Down
3 changes: 2 additions & 1 deletion src/AudioToolbox/MusicTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public abstract class MidiData {
#else
public abstract class _MidiData {
#endif
protected int len, start;
protected int len;
protected int start;
protected byte []? data;
protected IntPtr buffer;

Expand Down
4 changes: 3 additions & 1 deletion src/AudioUnit/AudioUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,9 @@ public AURenderEvent? Next {
//
// public byte Cable;
//
// public byte Data_1, Data_2, Data_3;
// public byte Data_1;
// public byte Data_2;
// public byte Data_3;
// }

#if NET
Expand Down
20 changes: 16 additions & 4 deletions src/CoreAnimation/CATransform3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ namespace CoreAnimation {
[StructLayout (LayoutKind.Sequential)]
public struct CATransform3D {
#if NET
public nfloat M11, M12, M13, M14;
public nfloat M21, M22, M23, M24;
public nfloat M31, M32, M33, M34;
public nfloat M41, M42, M43, M44;
public nfloat M11;
public nfloat M12;
public nfloat M13;
public nfloat M14;
public nfloat M21;
public nfloat M22;
public nfloat M23;
public nfloat M24;
public nfloat M31;
public nfloat M32;
public nfloat M33;
public nfloat M34;
public nfloat M41;
public nfloat M42;
public nfloat M43;
public nfloat M44;
#else
[Obsolete ("Use 'M11' instead.")]
public nfloat m11;
Expand Down
3 changes: 2 additions & 1 deletion src/CoreGraphics/CGVector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ namespace CoreGraphics {
#endif
// CGGeometry.h
public struct CGVector {
public /* CGFloat */ nfloat dx, dy;
public /* CGFloat */ nfloat dx;
public /* CGFloat */ nfloat dy;

public CGVector (nfloat dx, nfloat dy)
{
Expand Down
4 changes: 3 additions & 1 deletion src/CoreMotion/CMMagnetometer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ namespace CoreMotion {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct CMMagneticField {
public double X, Y, Z;
public double X;
public double Y;
public double Z;

public override string ToString ()
{
Expand Down
21 changes: 16 additions & 5 deletions src/CoreMotion/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ namespace CoreMotion {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct CMAcceleration {
public double X, Y, Z;
public double X;
public double Y;
public double Z;

public CMAcceleration (double x, double y, double z)
{
Expand All @@ -44,9 +46,15 @@ public override string ToString ()
#endif
[StructLayout (LayoutKind.Sequential)]
public struct CMRotationMatrix {
public double m11, m12, m13;
public double m21, m22, m23;
public double m31, m32, m33;
public double m11;
public double m12;
public double m13;
public double m21;
public double m22;
public double m23;
public double m31;
public double m32;
public double m33;
}

// CMAttitude.h
Expand All @@ -57,7 +65,10 @@ public struct CMRotationMatrix {
#endif
[StructLayout (LayoutKind.Sequential)]
public struct CMQuaternion {
public double x, y, z, w;
public double x;
public double y;
public double z;
public double w;

public CMQuaternion (double x, double y, double z, double w)
{
Expand Down
9 changes: 8 additions & 1 deletion src/Foundation/NSDecimal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ public struct NSDecimal
// unsigned int
public int fields;
// unsigned short [8]
public short m1, m2, m3, m4, m5, m6, m7, m8;
public short m1;
public short m2;
public short m3;
public short m4;
public short m5;
public short m6;
public short m7;
public short m8;

#if !COREBUILD
[DllImport (Constants.FoundationLibrary)]
Expand Down
4 changes: 3 additions & 1 deletion src/Foundation/NSOperatingSystemVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ namespace Foundation {
#endif

public struct NSOperatingSystemVersion : IEquatable<NSOperatingSystemVersion>, IComparable {
public nint Major, Minor, PatchVersion;
public nint Major;
public nint Minor;
public nint PatchVersion;

public NSOperatingSystemVersion (nint major, nint minor, nint patchVersion)
{
Expand Down
6 changes: 4 additions & 2 deletions src/MapKit/MapKit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public override string ToString ()
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MKMapPoint {
public double X, Y;
public double X;
public double Y;

[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapPointForCoordinate")]
public extern static MKMapPoint FromCoordinate (CLLocationCoordinate2D coordinate);
Expand Down Expand Up @@ -161,7 +162,8 @@ public override string ToString ()
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MKMapSize {
public double Width, Height;
public double Width;
public double Height;

// MKMapSizeMake
public MKMapSize (double width, double height)
Expand Down
27 changes: 22 additions & 5 deletions src/Metal/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ namespace Metal {
[SupportedOSPlatform ("tvos")]
#endif
public struct MTLOrigin {
public nint X, Y, Z;
public nint X;
public nint Y;
public nint Z;

public MTLOrigin (nint x, nint y, nint z)
{
X = x;
Expand All @@ -46,7 +49,9 @@ public override string ToString ()
[SupportedOSPlatform ("tvos")]
#endif
public struct MTLSize {
public nint Width, Height, Depth;
public nint Width;
public nint Height;
public nint Depth;

public MTLSize (nint width, nint height, nint depth)
{
Expand Down Expand Up @@ -95,7 +100,10 @@ public static MDLVertexFormat ToModelVertexFormat (this MTLVertexFormat vertexFo
[SupportedOSPlatform ("tvos")]
#endif
public struct MTLScissorRect {
public nuint X, Y, Width, Height;
public nuint X;
public nuint Y;
public nuint Width;
public nuint Height;

public MTLScissorRect (nuint x, nuint y, nuint width, nuint height)
{
Expand All @@ -118,7 +126,13 @@ public override string ToString ()
[SupportedOSPlatform ("tvos")]
#endif
public struct MTLViewport {
public double OriginX, OriginY, Width, Height, ZNear, ZFar;
public double OriginX;
public double OriginY;
public double Width;
public double Height;
public double ZNear;
public double ZFar;

public MTLViewport (double originX, double originY, double width, double height, double znear, double zfar)
{
OriginX = originX;
Expand Down Expand Up @@ -162,7 +176,10 @@ public MTLSamplePosition (float x, float y)
[SupportedOSPlatform ("tvos")]
#endif
public struct MTLClearColor {
public double Red, Green, Blue, Alpha;
public double Red;
public double Green;
public double Blue;
public double Alpha;

public MTLClearColor (double red, double green, double blue, double alpha)
{
Expand Down
Loading
Loading