From: Maik Fischer Date: Sun, 29 Oct 2017 21:48:39 +0000 (+0100) Subject: include guards: don't begin them with underscores X-Git-Tag: rgb2rv17~9^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d3fc3d458044401eeb1260076b4fccd64a4ec7b2;p=c128-kasse include guards: don't begin them with underscores see: https://www.securecoding.cert.org/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier --- diff --git a/include/c128time.h b/include/c128time.h index a53d268..c595280 100644 --- a/include/c128time.h +++ b/include/c128time.h @@ -1,5 +1,5 @@ -#ifndef TIME_H_ -#define TIME_H_ +#ifndef TIME_H +#define TIME_H void set_time(BYTE hrs, BYTE min, BYTE sec); char *get_time(void); #endif diff --git a/include/config.h b/include/config.h index 5a19e80..4dd7fcc 100644 --- a/include/config.h +++ b/include/config.h @@ -1,7 +1,7 @@ #include "general.h" -#ifndef CONFIG_H_ -#define CONFIG_H_ +#ifndef CONFIG_H +#define CONFIG_H #define MAX_ITEMS 32 #define MAX_ITEM_NAME_LENGTH 9 @@ -41,7 +41,7 @@ struct credits_array_t { struct credits_t credits[MAX_CREDIT_ITEMS]; }; -#ifndef _IS_CONFIG_C +#ifndef IS_CONFIG_C extern struct status_array_t status; extern struct credits_array_t credits; #endif @@ -54,4 +54,4 @@ void load_credits(void); void save_items(void); void save_credits(void); -#endif /*CONFIG_H_*/ +#endif /* CONFIG_H */ diff --git a/include/credit_manager.h b/include/credit_manager.h index dba26c7..79a4a57 100644 --- a/include/credit_manager.h +++ b/include/credit_manager.h @@ -1,6 +1,8 @@ -#ifndef CREDIT_MANAGER_H_ -#define CREDIT_MANAGER_H_ +#ifndef CREDIT_MANAGER_H +#define CREDIT_MANAGER_H + struct credits_t *find_credit(char *name); void deposit_credit(char *input); void credit_manager(void); -#endif + +#endif /* CREDIT_MANAGER_H */ diff --git a/include/general.h b/include/general.h index 0cd2844..df02244 100644 --- a/include/general.h +++ b/include/general.h @@ -1,5 +1,5 @@ -#ifndef GENERAL_H_ -#define GENERAL_H_ +#ifndef GENERAL_H +#define GENERAL_H #include #include @@ -78,4 +78,4 @@ extern BYTE _oserror; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) > (b) ? (b) : (a)) -#endif /*GENERAL_H_*/ +#endif /* GENERAL_H */ diff --git a/include/globals.h b/include/globals.h index 00fca09..8a64063 100644 --- a/include/globals.h +++ b/include/globals.h @@ -1,9 +1,9 @@ -#ifndef _GLOBALS_H_ -#define _GLOBALS_H_ +#ifndef GLOBALS_H +#define GLOBALS_H #include -#ifdef _IS_GLOBALS_C +#ifdef IS_GLOBALS_C #define GLOBAL #else #define GLOBAL extern @@ -13,4 +13,4 @@ void init_globals(void); GLOBAL uint8_t printing; -#endif // _GLOBALS_H_ +#endif /* GLOBALS_H */ diff --git a/include/kasse.h b/include/kasse.h index 43a67da..aac65da 100644 --- a/include/kasse.h +++ b/include/kasse.h @@ -1,5 +1,5 @@ -#ifndef _KASSE_H -#define _KASSE_H +#ifndef KASSE_H +#define KASSE_H void print_the_buffer(void); diff --git a/include/print.h b/include/print.h index 78d65d0..990e4df 100644 --- a/include/print.h +++ b/include/print.h @@ -1,5 +1,5 @@ -#ifndef _PRINT_H -#define _PRINT_H +#ifndef PRINT_H +#define PRINT_H void init_log(void); void print_the_buffer(void); @@ -7,7 +7,7 @@ void print_header(void); void log_file(const char *s); void log_flush(void); -#ifdef _IS_PRINT +#ifdef IS_PRINT_C char print_buffer[80 + 2 + 1]; unsigned char log_num = 0; #else diff --git a/include/vdc_patch_charset.h b/include/vdc_patch_charset.h index ff80c82..8b26b48 100644 --- a/include/vdc_patch_charset.h +++ b/include/vdc_patch_charset.h @@ -1,5 +1,5 @@ -#ifndef __VDC_PATCH_CHARSET_H_ -#define __VDC_PATCH_CHARSET_H_ +#ifndef VDC_PATCH_CHARSET_H +#define VDC_PATCH_CHARSET_H void vdc_patch_charset(void); @@ -12,4 +12,4 @@ void vdc_patch_charset(void); #define uUML "\xA9" #define szLIG "\xBF" -#endif // __VDC_PATCH_CHARSET_H_ +#endif /* VDC_PATCH_CHARSET_H */ diff --git a/include/vdc_util.h b/include/vdc_util.h index 2c10ccd..84c6e00 100644 --- a/include/vdc_util.h +++ b/include/vdc_util.h @@ -1,5 +1,5 @@ -#ifndef __VDC_UTIL_H_ -#define __VDC_UTIL_H_ +#ifndef VDC_UTIL_H +#define VDC_UTIL_H extern void __fastcall__ vdc_load_thinfont(void); extern unsigned char __fastcall__ vdc_read_reg(unsigned char reg); @@ -11,4 +11,4 @@ extern void __fastcall__ vdc_write_mem(unsigned dest, const void *src, unsigned n); extern void __fastcall__ vdc_load_thinfont(void); -#endif // __VDC_UTIL_H_ +#endif /* VDC_UTIL_H */ diff --git a/src/config.c b/src/config.c index 6f56124..6d447a7 100644 --- a/src/config.c +++ b/src/config.c @@ -4,7 +4,7 @@ * See LICENSE for license information * */ -#define _IS_CONFIG_C +#define IS_CONFIG_C #include #include diff --git a/src/globals.c b/src/globals.c index b759fe0..c1032e2 100644 --- a/src/globals.c +++ b/src/globals.c @@ -1,4 +1,4 @@ -#define _IS_GLOBALS_C +#define IS_GLOBALS_C #include "globals.h" void init_globals(void) { diff --git a/src/print.c b/src/print.c index dee1599..a0e63df 100644 --- a/src/print.c +++ b/src/print.c @@ -10,7 +10,7 @@ #include #include "general.h" -#define _IS_PRINT +#define IS_PRINT_C #include "print.h" #include "globals.h"