Formatting .c/.h files and fix memory leakage issues
Signed-off-by: John Chung <john.chung@arm.com>
Change-Id: Id8328f412c2724992d80c0b3f895c8f85bc4ae68
diff --git a/sections/cper-section-generic.h b/sections/cper-section-generic.h
index 95ba66e..765794e 100644
--- a/sections/cper-section-generic.h
+++ b/sections/cper-section-generic.h
@@ -4,22 +4,65 @@
#include <json.h>
#include "../edk/Cper.h"
-#define GENERIC_PROC_TYPES_KEYS (int []){0, 1, 2}
-#define GENERIC_PROC_TYPES_VALUES (const char*[]){"IA32/X64", "IA64", "ARM"}
-#define GENERIC_ISA_TYPES_KEYS (int []){0, 1, 2, 3, 4}
-#define GENERIC_ISA_TYPES_VALUES (const char*[]){"IA32", "IA64", "X64", "ARM A32/T32", "ARM A64"}
-#define GENERIC_ERROR_TYPES_KEYS (int []){0, 1, 2, 4, 8}
-#define GENERIC_ERROR_TYPES_VALUES (const char*[]){"Unknown", "Cache Error", "TLB Error", "Bus Error", "Micro-Architectural Error"}
-#define GENERIC_OPERATION_TYPES_KEYS (int []){0, 1, 2, 3}
-#define GENERIC_OPERATION_TYPES_VALUES (const char*[]){"Unknown or Generic", "Data Read", "Data Write", "Instruction Execution"}
-#define GENERIC_VALIDATION_BITFIELD_NAMES (const char*[]) \
- {"processorTypeValid", "processorISAValid", "processorErrorTypeValid", "operationValid", "flagsValid", \
- "levelValid", "cpuVersionValid", "cpuBrandInfoValid", "cpuIDValid", "targetAddressValid", "requestorIDValid", \
- "responderIDValid", "instructionIPValid"}
-#define GENERIC_FLAGS_BITFIELD_NAMES (const char*[]) \
- {"restartable", "preciseIP", "overflow", "corrected"}
+#define GENERIC_PROC_TYPES_KEYS \
+ (int[]) \
+ { \
+ 0, 1, 2 \
+ }
+#define GENERIC_PROC_TYPES_VALUES \
+ (const char *[]) \
+ { \
+ "IA32/X64", "IA64", "ARM" \
+ }
+#define GENERIC_ISA_TYPES_KEYS \
+ (int[]) \
+ { \
+ 0, 1, 2, 3, 4 \
+ }
+#define GENERIC_ISA_TYPES_VALUES \
+ (const char *[]) \
+ { \
+ "IA32", "IA64", "X64", "ARM A32/T32", "ARM A64" \
+ }
+#define GENERIC_ERROR_TYPES_KEYS \
+ (int[]) \
+ { \
+ 0, 1, 2, 4, 8 \
+ }
+#define GENERIC_ERROR_TYPES_VALUES \
+ (const char *[]) \
+ { \
+ "Unknown", "Cache Error", "TLB Error", "Bus Error", \
+ "Micro-Architectural Error" \
+ }
+#define GENERIC_OPERATION_TYPES_KEYS \
+ (int[]) \
+ { \
+ 0, 1, 2, 3 \
+ }
+#define GENERIC_OPERATION_TYPES_VALUES \
+ (const char *[]) \
+ { \
+ "Unknown or Generic", "Data Read", "Data Write", \
+ "Instruction Execution" \
+ }
+#define GENERIC_VALIDATION_BITFIELD_NAMES \
+ (const char *[]) \
+ { \
+ "processorTypeValid", "processorISAValid", \
+ "processorErrorTypeValid", "operationValid", \
+ "flagsValid", "levelValid", "cpuVersionValid", \
+ "cpuBrandInfoValid", "cpuIDValid", \
+ "targetAddressValid", "requestorIDValid", \
+ "responderIDValid", "instructionIPValid" \
+ }
+#define GENERIC_FLAGS_BITFIELD_NAMES \
+ (const char *[]) \
+ { \
+ "restartable", "preciseIP", "overflow", "corrected" \
+ }
-json_object* cper_section_generic_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
-void ir_section_generic_to_cper(json_object* section, FILE* out);
+json_object *cper_section_generic_to_ir(void *section);
+void ir_section_generic_to_cper(json_object *section, FILE *out);
-#endif
\ No newline at end of file
+#endif