Skip to content

Commit

Permalink
Switch to pragma once
Browse files Browse the repository at this point in the history
  • Loading branch information
jepenven-silabs committed Nov 9, 2020
1 parent ce60ab9 commit 4c673d0
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 57 deletions.
7 changes: 2 additions & 5 deletions src/app/zap-templates/af-structs.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_AF_STRUCTS__
#define __ZAP_AF_STRUCTS__
// Prevent multiple inclusion
#pragma once

#include <stdint.h>
#include "enums.h"
Expand All @@ -16,5 +15,3 @@ typedef struct _{{asType label}} {
{{/zcl_struct_items}}
} {{asUnderlyingType label}};
{{/zcl_structs}}

#endif // __ZAP_AF_STRUCTS__
7 changes: 2 additions & 5 deletions src/app/zap-templates/att-storage.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_ATT_STORAGE__
#define __ZAP_ATT_STORAGE__
// Prevent multiple inclusion
#pragma once

// Attribute masks modify how attributes are used by the framework
//
Expand Down Expand Up @@ -52,5 +51,3 @@
#define COMMAND_MASK_INCOMING_SERVER (0x08)
// Is this command manufacturer specific?
#define COMMAND_MASK_MANUFACTURER_SPECIFIC (0x10)

#endif // __ZAP_ATT_STORAGE__
7 changes: 2 additions & 5 deletions src/app/zap-templates/attribute-id.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_EMBER_ATTRIBUTE_ID__
#define __ZAP_EMBER_ATTRIBUTE_ID__
// Prevent multiple inclusion
#pragma once

{{#zcl_clusters}}
// Attribute ids for cluster: {{label}}
Expand All @@ -26,5 +25,3 @@
{{/last}}
{{/zcl_attributes_server}}
{{/zcl_clusters}}

#endif // __ZAP_EMBER_ATTRIBUTE_ID__
7 changes: 2 additions & 5 deletions src/app/zap-templates/attribute-type.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_ATTRIBUTE_TYPE__
#define __ZAP_ATTRIBUTE_TYPE__
// Prevent multiple inclusion
#pragma once

// ZCL attribute types
enum {
Expand All @@ -19,5 +18,3 @@ enum {
{{/if}}
{{/zcl_atomics}}
}

#endif // __ZAP_ATTRIBUTE_TYPE__
7 changes: 2 additions & 5 deletions src/app/zap-templates/call-command-handler.zapt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_CALL_COMMAND_HANDLER__
#define __ZAP_CALL_COMMAND_HANDLER__
// Prevent multiple inclusion
#pragma once

#include "af-types.h"

#endif //__ZAP_CALL_COMMAND_HANDLER__
7 changes: 2 additions & 5 deletions src/app/zap-templates/callback.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_CALLBACK__
#define __ZAP_CALLBACK__
// Prevent multiple inclusion
#pragma once

#include "af-structs.h"
#include "af-types.h"
Expand Down Expand Up @@ -52,5 +51,3 @@ bool emberAf{{asCamelCased parent.name false}}Cluster{{asCamelCased name false}}
{{/all_user_cluster_commands}}
{{/if}}
{{/all_user_clusters}}

#endif //__ZAP_CALLBACK__
3 changes: 3 additions & 0 deletions src/app/zap-templates/client-command-macro.zapt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{chip_header}}

// Prevent multiple inclusion
#pragma once

// TODO issue #3637
7 changes: 2 additions & 5 deletions src/app/zap-templates/cluster-id.zapt
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_CLUSTER_ID__
#define __ZAP_CLUSTER_ID__
// Prevent multiple inclusion
#pragma once

{{#zcl_clusters}}

// Definitions for cluster: {{label}}
#define ZCL_{{asDelimitedMacro define}}_ID ({{asHex code 4}})

{{/zcl_clusters}}

#endif // __ZAP_CLUSTER_ID__
7 changes: 2 additions & 5 deletions src/app/zap-templates/command-id.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_GEN_ID__
#define __ZAP_GEN_ID__
// Prevent multiple inclusion
#pragma once

// Global, non-cluster-specific commands
{{#zcl_global_commands}}
Expand All @@ -18,5 +17,3 @@
#define ZCL_{{asDelimitedMacro label}}_COMMAND_ID ({{asHex code 2}})
{{/zcl_commands}}
{{/zcl_clusters}}

#endif // __ZAP_GEN_ID__
3 changes: 3 additions & 0 deletions src/app/zap-templates/endpoint_config.zapt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{chip_header}}

// Prevent multiple inclusion
#pragma once

// TODO issue #3637
7 changes: 2 additions & 5 deletions src/app/zap-templates/enums.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_EMBER_ENUMS__
#define __ZAP_EMBER_ENUMS__
// Prevent multiple inclusion
#pragma once

// ZCL enums

Expand All @@ -22,5 +21,3 @@ typedef enum {
#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}}_OFFSET ({{asOffset mask}})
{{/zcl_bitmap_items}}
{{/zcl_bitmaps}}

#endif //__ZAP_EMBER_ENUMS__
7 changes: 2 additions & 5 deletions src/app/zap-templates/gen_config.zapt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_GEN_CONFIG__
#define __ZAP_GEN_CONFIG__
// Prevent multiple inclusion
#pragma once

// User options for plugin Binding Table Library
#define EMBER_BINDING_TABLE_SIZE 10
Expand All @@ -17,5 +16,3 @@
{{#all_user_clusters}}
#define EMBER_AF_{{asDelimitedMacro define}}_{{asDelimitedMacro side}}_ENDPOINT_COUNT ({{user_endpoint_count_by_cluster id side}})
{{/all_user_clusters}}

#endif // __ZAP_GEN_CONFIG__
9 changes: 2 additions & 7 deletions src/app/zap-templates/print-cluster.zapt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{{chip_header}}

// Enclosing macro to prevent multiple inclusion
#ifndef __ZAP_PRINT_CLUSTER__
#define __ZAP_PRINT_CLUSTER__

// Prevent multiple inclusion
#pragma once

// This is the mapping of IDs to cluster names assuming a format according
// to the "EmberAfClusterName" defined in the ZCL header.
Expand All @@ -24,6 +22,3 @@
{{/zcl_clusters}}

#define MAX_CLUSTER_NAME_LENGTH {{zcl_cluster_largest_label_length}}

// Enclosing macro to prevent multiple inclusion
#endif // __ZAP_PRINT_CLUSTER__

0 comments on commit 4c673d0

Please sign in to comment.