1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Remove embedded semicolon from String constant macros.

The embedded semicolon led to inconsistent semicolons when using the macro and is not our general convention.

Remove embedded semicolons from the macros and add semicolons in usage where they were not present.
This commit is contained in:
David Steele 2018-11-21 08:30:14 -05:00
parent bc25db5667
commit 53e3651cca
12 changed files with 28 additions and 24 deletions

View File

@ -27,6 +27,10 @@
<p>Add <code>ServiceError</code> for errors from a service that can be retried.</p>
</release-item>
<release-item>
<p>Remove embedded semicolon from <code>String</code> constant macros.</p>
</release-item>
<release-item>
<p>Reduce debug level for <code>infoIni()</code> to test.</p>
</release-item>

View File

@ -13,7 +13,7 @@ IO Size Filter
Filter type constant
***********************************************************************************************************************************/
#define SIZE_FILTER_TYPE "size"
STRING_STATIC(SIZE_FILTER_TYPE_STR, SIZE_FILTER_TYPE)
STRING_STATIC(SIZE_FILTER_TYPE_STR, SIZE_FILTER_TYPE);
/***********************************************************************************************************************************
Object type

View File

@ -79,15 +79,15 @@ By convention all string constant identifiers are appended with _STR.
// Used to declare string constants that will be externed using STRING_DECLARE(). Must be used in a .c file.
#define STRING_EXTERN(name, value) \
const String *name = STRING_CONST(value);
const String *name = STRING_CONST(value)
// Used to declare string constants that will be local to the .c file. Must be used in a .c file.
#define STRING_STATIC(name, value) \
static const String *name = STRING_CONST(value);
static const String *name = STRING_CONST(value)
// Used to extern string constants declared with STRING_EXTERN(. Must be used in a .h file.
#define STRING_DECLARE(name) \
extern const String *name;
extern const String *name
/***********************************************************************************************************************************
Constant strings that are generally useful

View File

@ -13,7 +13,7 @@ Command and Option Configuration Definition
/***********************************************************************************************************************************
Define global section name
***********************************************************************************************************************************/
STRING_EXTERN(CFGDEF_SECTION_GLOBAL_STR, CFGDEF_SECTION_GLOBAL)
STRING_EXTERN(CFGDEF_SECTION_GLOBAL_STR, CFGDEF_SECTION_GLOBAL);
/***********************************************************************************************************************************
Map command names to ids and vice versa.

View File

@ -23,7 +23,7 @@ typedef enum
Define global section name
***********************************************************************************************************************************/
#define CFGDEF_SECTION_GLOBAL "global"
STRING_DECLARE(CFGDEF_SECTION_GLOBAL_STR)
STRING_DECLARE(CFGDEF_SECTION_GLOBAL_STR);
/***********************************************************************************************************************************
Functions

View File

@ -22,7 +22,7 @@ Standard config file name and old default path and name
***********************************************************************************************************************************/
#define PGBACKREST_CONFIG_FILE PGBACKREST_BIN ".conf"
#define PGBACKREST_CONFIG_ORIG_PATH_FILE "/etc/" PGBACKREST_CONFIG_FILE
STRING_STATIC(PGBACKREST_CONFIG_ORIG_PATH_FILE_STR, PGBACKREST_CONFIG_ORIG_PATH_FILE)
STRING_STATIC(PGBACKREST_CONFIG_ORIG_PATH_FILE_STR, PGBACKREST_CONFIG_ORIG_PATH_FILE);
/***********************************************************************************************************************************
Prefix for environment variables

View File

@ -24,9 +24,9 @@ Filter type constant
/***********************************************************************************************************************************
Hash types
***********************************************************************************************************************************/
STRING_EXTERN(HASH_TYPE_MD5_STR, HASH_TYPE_MD5)
STRING_EXTERN(HASH_TYPE_SHA1_STR, HASH_TYPE_SHA1)
STRING_EXTERN(HASH_TYPE_SHA256_STR, HASH_TYPE_SHA256)
STRING_EXTERN(HASH_TYPE_MD5_STR, HASH_TYPE_MD5);
STRING_EXTERN(HASH_TYPE_SHA1_STR, HASH_TYPE_SHA1);
STRING_EXTERN(HASH_TYPE_SHA256_STR, HASH_TYPE_SHA256);
/***********************************************************************************************************************************
Object type

View File

@ -18,11 +18,11 @@ typedef struct CryptoHash CryptoHash;
Hash types
***********************************************************************************************************************************/
#define HASH_TYPE_MD5 "md5"
STRING_DECLARE(HASH_TYPE_MD5_STR)
STRING_DECLARE(HASH_TYPE_MD5_STR);
#define HASH_TYPE_SHA1 "sha1"
STRING_DECLARE(HASH_TYPE_SHA1_STR)
STRING_DECLARE(HASH_TYPE_SHA1_STR);
#define HASH_TYPE_SHA256 "sha256"
STRING_DECLARE(HASH_TYPE_SHA256_STR)
STRING_DECLARE(HASH_TYPE_SHA256_STR);
/***********************************************************************************************************************************
Constructor

View File

@ -19,11 +19,11 @@ Internal constants
***********************************************************************************************************************************/
#define INI_COPY_EXT ".copy"
#define INI_SECTION_BACKREST "backrest"
STRING_STATIC(INI_SECTION_BACKREST_STR, INI_SECTION_BACKREST)
STRING_STATIC(INI_SECTION_BACKREST_STR, INI_SECTION_BACKREST);
#define INI_KEY_FORMAT "backrest-format"
STRING_STATIC(INI_KEY_FORMAT_STR, INI_KEY_FORMAT)
STRING_STATIC(INI_KEY_FORMAT_STR, INI_KEY_FORMAT);
#define INI_KEY_CHECKSUM "backrest-checksum"
STRING_STATIC(INI_KEY_CHECKSUM_STR, INI_KEY_CHECKSUM)
STRING_STATIC(INI_KEY_CHECKSUM_STR, INI_KEY_CHECKSUM);
/***********************************************************************************************************************************
Object type

View File

@ -25,19 +25,19 @@ Internal constants
***********************************************************************************************************************************/
#define INFO_SECTION_DB "db"
#define INFO_SECTION_DB_HISTORY INFO_SECTION_DB ":history"
STRING_STATIC(INFO_SECTION_DB_HISTORY_STR, INFO_SECTION_DB_HISTORY)
STRING_STATIC(INFO_SECTION_DB_HISTORY_STR, INFO_SECTION_DB_HISTORY);
#define INFO_SECTION_DB_MANIFEST "backup:" INFO_SECTION_DB
#define INFO_KEY_DB_ID "db-id"
STRING_STATIC(INFO_KEY_DB_ID_STR, INFO_KEY_DB_ID)
STRING_STATIC(INFO_KEY_DB_ID_STR, INFO_KEY_DB_ID);
#define INFO_KEY_DB_CATALOG_VERSION "db-catalog-version"
STRING_STATIC(INFO_KEY_DB_CATALOG_VERSION_STR, INFO_KEY_DB_CATALOG_VERSION)
STRING_STATIC(INFO_KEY_DB_CATALOG_VERSION_STR, INFO_KEY_DB_CATALOG_VERSION);
#define INFO_KEY_DB_CONTROL_VERSION "db-control-version"
STRING_STATIC(INFO_KEY_DB_CONTROL_VERSION_STR, INFO_KEY_DB_CONTROL_VERSION)
STRING_STATIC(INFO_KEY_DB_CONTROL_VERSION_STR, INFO_KEY_DB_CONTROL_VERSION);
#define INFO_KEY_DB_SYSTEM_ID "db-system-id"
STRING_STATIC(INFO_KEY_DB_SYSTEM_ID_STR, INFO_KEY_DB_SYSTEM_ID)
STRING_STATIC(INFO_KEY_DB_SYSTEM_ID_STR, INFO_KEY_DB_SYSTEM_ID);
#define INFO_KEY_DB_VERSION "db-version"
STRING_STATIC(INFO_KEY_DB_VERSION_STR, INFO_KEY_DB_VERSION)
STRING_STATIC(INFO_KEY_DB_VERSION_STR, INFO_KEY_DB_VERSION);
/***********************************************************************************************************************************
Object type

View File

@ -23,7 +23,7 @@ Posix Storage Driver
/***********************************************************************************************************************************
Driver type constant string
***********************************************************************************************************************************/
STRING_EXTERN(STORAGE_DRIVER_POSIX_TYPE_STR, STORAGE_DRIVER_POSIX_TYPE)
STRING_EXTERN(STORAGE_DRIVER_POSIX_TYPE_STR, STORAGE_DRIVER_POSIX_TYPE);
/***********************************************************************************************************************************
Object type

View File

@ -22,7 +22,7 @@ typedef struct StorageDriverPosix StorageDriverPosix;
Driver type constant
***********************************************************************************************************************************/
#define STORAGE_DRIVER_POSIX_TYPE "posix"
STRING_DECLARE(STORAGE_DRIVER_POSIX_TYPE_STR)
STRING_DECLARE(STORAGE_DRIVER_POSIX_TYPE_STR);
/***********************************************************************************************************************************
Constructor