Skip to content

Commit

Permalink
Make some stuff read only.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Aug 1, 2024
1 parent 85c1043 commit c259302
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public sealed record AnnotationDefaultAttributeRecord(ElementValueRecord DefaultValue) : AttributeRecord
public sealed record class AnnotationDefaultAttributeRecord(ElementValueRecord DefaultValue) : AttributeRecord
{

public static bool TryReadAnnotationDefaultAttribute(ref ClassFormatReader reader, out AttributeRecord attribute)
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/AnnotationRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct AnnotationRecord(Utf8ConstantHandle Type, ElementValuePairRecord[] Elements)
public readonly record struct AnnotationRecord(Utf8ConstantHandle Type, ElementValuePairRecord[] Elements)
{

public static bool TryReadAnnotation(ref ClassFormatReader reader, out AnnotationRecord annotation)
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/AttributeInfoRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct AttributeInfoRecord(Utf8ConstantHandle Name, byte[] Data)
public readonly record struct AttributeInfoRecord(Utf8ConstantHandle Name, byte[] Data)
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct BootstrapMethodsAttributeMethodRecord(MethodrefConstantHandle Methodref, ConstantHandle[] Arguments)
public readonly record struct BootstrapMethodsAttributeMethodRecord(MethodrefConstantHandle Methodref, ConstantHandle[] Arguments)
{

public static bool TryReadBootstrapMethod(ref ClassFormatReader reader, out BootstrapMethodsAttributeMethodRecord method)
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ClassRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ClassRecord(ushort MinorVersion, ushort MajorVersion, ConstantRecord[] Constants, AccessFlag AccessFlags, ClassConstantHandle ThisClass, ClassConstantHandle SuperClass, InterfaceRecord[] Interfaces, FieldRecord[] Fields, MethodRecord[] Methods, AttributeInfoRecord[] Attributes)
public readonly record struct ClassRecord(ushort MinorVersion, ushort MajorVersion, ConstantRecord[] Constants, AccessFlag AccessFlags, ClassConstantHandle ThisClass, ClassConstantHandle SuperClass, InterfaceRecord[] Interfaces, FieldRecord[] Fields, MethodRecord[] Methods, AttributeInfoRecord[] Attributes)
{

public const uint MAGIC = 0xCAFEBABE;
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ElementValuePairRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ElementValuePairRecord(Utf8ConstantHandle Name, ElementValueRecord Value)
public readonly record struct ElementValuePairRecord(Utf8ConstantHandle Name, ElementValueRecord Value)
{

public static bool TryRead(ref ClassFormatReader reader, out ElementValuePairRecord record)
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ElementValueRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ElementValueRecord(ElementValueTag Tag, ElementValueValueRecord Value)
public readonly record struct ElementValueRecord(ElementValueTag Tag, ElementValueValueRecord Value)
{

public static bool TryRead(ref ClassFormatReader reader, out ElementValueRecord record)
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ExceptionHandlerRecord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ExceptionHandlerRecord(ushort StartOffset, ushort EndOffset, ushort HandlerOffset, ClassConstantHandle CatchType);
public readonly record struct ExceptionHandlerRecord(ushort StartOffset, ushort EndOffset, ushort HandlerOffset, ClassConstantHandle CatchType);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct InnerClassesAttributeItemRecord(ClassConstantHandle InnerClass, ClassConstantHandle OuterClass, Utf8ConstantHandle InnerName, AccessFlag InnerClassAccessFlags);
public readonly record struct InnerClassesAttributeItemRecord(ClassConstantHandle InnerClass, ClassConstantHandle OuterClass, Utf8ConstantHandle InnerName, AccessFlag InnerClassAccessFlags);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct LineNumberTableAttributeItemRecord(ushort CodeOffset, ushort LineNumber);
public readonly record struct LineNumberTableAttributeItemRecord(ushort CodeOffset, ushort LineNumber);

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct LocalVariableTargetTableItemRecord(ushort Offset, ushort Length, ushort Index)
public readonly record struct LocalVariableTargetTableItemRecord(ushort Offset, ushort Length, ushort Index)
{

public static bool TryRead(ref ClassFormatReader reader, out LocalVariableTargetTableItemRecord record)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct LocalVariableTypeTableAttributeItemRecord(ushort CodeOffset, ushort CodeLength, Utf8ConstantHandle Name, Utf8ConstantHandle Signature, ushort Index);
public readonly record struct LocalVariableTypeTableAttributeItemRecord(ushort CodeOffset, ushort CodeLength, Utf8ConstantHandle Name, Utf8ConstantHandle Signature, ushort Index);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct MethodParametersAttributeParameterRecord(Utf8ConstantHandle Name, AccessFlag AccessFlags);
public readonly record struct MethodParametersAttributeParameterRecord(Utf8ConstantHandle Name, AccessFlag AccessFlags);

}
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/MethodRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct MethodRecord(AccessFlag AccessFlags, Utf8ConstantHandle Name, Utf8ConstantHandle Descriptor, AttributeInfoRecord[] Attributes)
public readonly record struct MethodRecord(AccessFlag AccessFlags, Utf8ConstantHandle Name, Utf8ConstantHandle Descriptor, AttributeInfoRecord[] Attributes)
{

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ModuleAttributeExportsRecord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ModuleAttributeExportsRecord(ushort Index, ModuleExportsFlag Flags, ushort[] Modules);
public readonly record struct ModuleAttributeExportsRecord(ushort Index, ModuleExportsFlag Flags, ushort[] Modules);

}
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ModuleAttributeOpensRecord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ModuleAttributeOpensRecord(ushort Index, ModuleOpensFlag Flags, ushort[] Modules);
public readonly record struct ModuleAttributeOpensRecord(ushort Index, ModuleOpensFlag Flags, ushort[] Modules);

}
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ModuleAttributeProvidesRecord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ModuleAttributeProvidesRecord(ushort Index, ushort[] Modules);
public readonly record struct ModuleAttributeProvidesRecord(ushort Index, ushort[] Modules);

}
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ModuleAttributeRequiresRecord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ModuleAttributeRequiresRecord(ushort Index, ModuleRequiresFlag Flag, ushort VersionIndex);
public readonly record struct ModuleAttributeRequiresRecord(ushort Index, ModuleRequiresFlag Flag, ushort VersionIndex);

}
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/ParameterAnnotationRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct ParameterAnnotationRecord(AnnotationRecord[] Annotations)
public readonly record struct ParameterAnnotationRecord(AnnotationRecord[] Annotations)
{

public static bool TryReadParameterAnnotation(ref ClassFormatReader reader, out ParameterAnnotationRecord record)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace IKVM.ByteCode.Parsing
{

public record struct RecordAttributeComponentRecord(Utf8ConstantHandle Name, Utf8ConstantHandle Descriptor, AttributeInfoRecord[] Attributes);
public readonly record struct RecordAttributeComponentRecord(Utf8ConstantHandle Name, Utf8ConstantHandle Descriptor, AttributeInfoRecord[] Attributes);

}
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/TypePathItemRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct TypePathItemRecord(TypePathKind Kind, byte ArgumentIndex)
public readonly record struct TypePathItemRecord(TypePathKind Kind, byte ArgumentIndex)
{

public static bool TryRead(ref ClassFormatReader reader, out TypePathItemRecord record)
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Parsing/TypePathRecord.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace IKVM.ByteCode.Parsing
{

public record struct TypePathRecord(params TypePathItemRecord[] Path)
public readonly record struct TypePathRecord(params TypePathItemRecord[] Path)
{

public static bool TryRead(ref ClassFormatReader reader, out TypePathRecord typePath)
Expand Down

0 comments on commit c259302

Please sign in to comment.