Skip to content

Commit

Permalink
Fix formatting of unknown IDs in MTRClusterNames bits. (#35922)
Browse files Browse the repository at this point in the history
IDs are unsigned; we should not be formatting them with %d, because for
vendor-prefixed ones that might make them look negative.
  • Loading branch information
bzbarsky-apple authored Oct 4, 2024
1 parent cc28e0a commit 213bf23
Show file tree
Hide file tree
Showing 2 changed files with 492 additions and 492 deletions.
14 changes: 7 additions & 7 deletions src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NSString * MTRClusterNameForID(MTRClusterIDType clusterID)
{{/zcl_clusters}}

default:
result = [NSString stringWithFormat:@"<Unknown clusterID %d>", clusterID];
result = [NSString stringWithFormat:@"<Unknown clusterID %u>", clusterID];
break;
}

Expand Down Expand Up @@ -72,15 +72,15 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType

{{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}}
default:
result = [NSString stringWithFormat:@"<Unknown attributeID %d>", attributeID];
result = [NSString stringWithFormat:@"<Unknown attributeID %u>", attributeID];
break;
}
break;
{{/if}}

{{/zcl_clusters}}
default:
result = [NSString stringWithFormat:@"<Unknown clusterID %d>", clusterID];
result = [NSString stringWithFormat:@"<Unknown clusterID %u>", clusterID];
break;
}

Expand Down Expand Up @@ -119,15 +119,15 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType
{{> commandIDs clusterName=label}}

default:
result = [NSString stringWithFormat:@"<Unknown commandID %d>", commandID];
result = [NSString stringWithFormat:@"<Unknown commandID %u>", commandID];
break;
}
break;
{{/if}}

{{/zcl_clusters}}
default:
result = [NSString stringWithFormat:@"<Unknown clusterID %d>", clusterID];
result = [NSString stringWithFormat:@"<Unknown clusterID %u>", clusterID];
break;
}

Expand Down Expand Up @@ -183,15 +183,15 @@ NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID)

{{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}}
default:
result = [NSString stringWithFormat:@"<Unknown eventID %d>", eventID];
result = [NSString stringWithFormat:@"<Unknown eventID %u>", eventID];
break;
}
break;
{{/if}}

{{/zcl_clusters}}
default:
result = [NSString stringWithFormat:@"<Unknown clusterID %d>", clusterID];
result = [NSString stringWithFormat:@"<Unknown clusterID %u>", clusterID];
break;
}

Expand Down
Loading

0 comments on commit 213bf23

Please sign in to comment.