You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-10-23 21:28:56 +03:00
Cast unused interface parameters to void rather than logging them.
The read drivers ignore block because ioReadInternal() loops until the output buffer is full and stops early itself when block is false. Object store path removal ignores recurse because there are no paths to recurse into. Logging these parameters implies they have an effect on the function. Cast them to void instead, which is the pattern already used for the unused param structs in the storage drivers, and which allows a build with FUNCTION_LOG_PARAM*() compiled out to report parameters that no code touches.
This commit is contained in:
@@ -39,7 +39,7 @@ ioBufferRead(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(IO_BUFFER_READ, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -109,7 +109,7 @@ httpResponseRead(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(HTTP_RESPONSE, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -39,7 +39,7 @@ ioLimitRead(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(IO_LIMIT_READ, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -96,7 +96,7 @@ storageReadAzure(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_AZURE, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -925,7 +925,7 @@ storageAzurePathRemove(THIS_VOID, const String *const path, const bool recurse,
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug);
|
||||
FUNCTION_LOG_PARAM(STORAGE_AZURE, this);
|
||||
FUNCTION_LOG_PARAM(STRING, path);
|
||||
FUNCTION_LOG_PARAM(BOOL, recurse);
|
||||
(void)recurse; // There are no paths so removal is always recursive
|
||||
(void)param; // No parameters are used
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ storageReadGcs(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_GCS, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -1111,7 +1111,7 @@ storageGcsPathRemove(THIS_VOID, const String *const path, const bool recurse, co
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug);
|
||||
FUNCTION_LOG_PARAM(STORAGE_GCS, this);
|
||||
FUNCTION_LOG_PARAM(STRING, path);
|
||||
FUNCTION_LOG_PARAM(BOOL, recurse);
|
||||
(void)recurse; // There are no paths so removal is always recursive
|
||||
(void)param; // No parameters are used
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ storageReadPosix(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_POSIX, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL && this->fd != -1);
|
||||
|
||||
@@ -159,7 +159,7 @@ storageReadMultiDefault(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_MULTI_DEFAULT, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -158,7 +158,7 @@ storageReadRemote(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_REMOTE, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -172,7 +172,7 @@ storageReadMultiRemote(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_MULTI_REMOTE, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -97,7 +97,7 @@ storageReadS3(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_S3, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
@@ -1227,7 +1227,7 @@ storageS3PathRemove(THIS_VOID, const String *const path, const bool recurse, con
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug);
|
||||
FUNCTION_LOG_PARAM(STORAGE_S3, this);
|
||||
FUNCTION_LOG_PARAM(STRING, path);
|
||||
FUNCTION_LOG_PARAM(BOOL, recurse);
|
||||
(void)recurse; // There are no paths so removal is always recursive
|
||||
(void)param; // No parameters are used
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ storageReadSftp(THIS_VOID, Buffer *const buffer, const bool block)
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(STORAGE_READ_SFTP, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, buffer);
|
||||
FUNCTION_LOG_PARAM(BOOL, block);
|
||||
(void)block; // Blocking is handled by the caller
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(this != NULL && this->sftpHandle != NULL);
|
||||
|
||||
Reference in New Issue
Block a user