Skip to content

Commit

Permalink
Fix C codegen to put Enum inside parent object namespace (#13047)
Browse files Browse the repository at this point in the history
* Fix C codegen to put Enum inside parent object namespace

* scripts/tools/zap_regen_all.py

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Mar 9, 2022
1 parent c548636 commit c9a8f54
Show file tree
Hide file tree
Showing 2 changed files with 699 additions and 648 deletions.
12 changes: 6 additions & 6 deletions src/app/zap-templates/templates/app/cluster-objects.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ namespace {{asUpperCamelCase label}} {
{{! forceNotOptional=true because the optionality is on the attribute
itself, but we want just the type of the attribute. }}
{{#if entryType}}
using Type = {{zapTypeToEncodableClusterObjectType entryType forceNotOptional=true}};
using DecodableType = {{zapTypeToDecodableClusterObjectType entryType forceNotOptional=true}};
using DecodableArgType = {{zapTypeToDecodableClusterObjectType entryType forceNotOptional=true isArgument=true}};
using Type = {{zapTypeToEncodableClusterObjectType entryType ns=parent.name forceNotOptional=true}};
using DecodableType = {{zapTypeToDecodableClusterObjectType entryType ns=parent.name forceNotOptional=true}};
using DecodableArgType = {{zapTypeToDecodableClusterObjectType entryType ns=parent.name forceNotOptional=true isArgument=true}};
{{else}}
using Type = {{zapTypeToEncodableClusterObjectType type forceNotOptional=true}};
using DecodableType = {{zapTypeToDecodableClusterObjectType type forceNotOptional=true}};
using DecodableArgType = {{zapTypeToDecodableClusterObjectType type forceNotOptional=true isArgument=true}};
using Type = {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}};
using DecodableType = {{zapTypeToDecodableClusterObjectType type ns=parent.name forceNotOptional=true}};
using DecodableArgType = {{zapTypeToDecodableClusterObjectType type ns=parent.name forceNotOptional=true isArgument=true}};
{{/if}}

static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; }
Expand Down
Loading

0 comments on commit c9a8f54

Please sign in to comment.