Skip to content

Commit

Permalink
+ guarding bad values
Browse files Browse the repository at this point in the history
  • Loading branch information
Hawkynt committed Mar 10, 2024
1 parent 03fd076 commit 31f4a14
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Corlib.Extensions/System/MemoryManipulation.T4.tt
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ void GenerateOneOperandArbitraryCountOperation(string name) {
public static unsafe void <#=name#>(byte* @this, int count) {
for (;;)
switch (count) {
case 0: return;
case <= 0: return;
<#+for(var blockSize = 1; blockSize <= MAX_SIZE; ++blockSize) {#>
case <#=blockSize#>: Block<#=blockSize#>.<#=name#>((Block<#=blockSize#>*)@this); return;
<#+}#>
Expand All @@ -473,7 +473,7 @@ void GenerateTwoOperandArbitraryCountEqual(string name) {
public static unsafe bool <#=name#>(byte* @this, byte* other, int count) {
for (;;)
switch (count) {
case 0: return true;
case <= 0: return true;
<#+for(var blockSize = 1; blockSize <= MAX_SIZE; ++blockSize) {#>
case <#=blockSize#>: return Block<#=blockSize#>.<#=name#>((Block<#=blockSize#>*)@this, (Block<#=blockSize#>*)other);
<#+}#>
Expand All @@ -498,7 +498,7 @@ void GenerateTwoOperandArbitraryCountFill(string name) {
public static unsafe void <#=name#>(byte* @this, byte value, int count) {
for (;;)
switch (count) {
case 0: return;
case <= 0: return;
<#+for(var blockSize = 1; blockSize <= MAX_SIZE; ++blockSize) {#>
case <#=blockSize#>: Block<#=blockSize#>.<#=name#>((Block<#=blockSize#>*)@this, value); return;
<#+}#>
Expand All @@ -520,7 +520,7 @@ void GenerateTwoOperandArbitraryCountOperation(string name) {
public static unsafe void <#=name#>(byte* @this, byte* operand, int count) {
for (;;)
switch (count) {
case 0: return;
case <= 0: return;
<#+for(var blockSize = 1; blockSize <= MAX_SIZE; ++blockSize) {#>
case <#=blockSize#>: Block<#=blockSize#>.<#=name#>((Block<#=blockSize#>*)@this, (Block<#=blockSize#>*)operand); return;
<#+}#>
Expand All @@ -543,7 +543,7 @@ void GenerateThreeOperandArbitraryCountOperation(string name) {
public static unsafe void <#=name#>(byte* @this, byte* operand, byte* target, int count) {
for (;;)
switch (count) {
case 0: return;
case <= 0: return;
<#+for(var blockSize = 1; blockSize <= MAX_SIZE; ++blockSize) {#>
case <#=blockSize#>: Block<#=blockSize#>.<#=name#>((Block<#=blockSize#>*)@this, (Block<#=blockSize#>*)operand, (Block<#=blockSize#>*)target); return;
<#+}#>
Expand Down

0 comments on commit 31f4a14

Please sign in to comment.