pgbackrest.git / summary / log / commit / refs

commit    55ca41e13784ef5fdafdb02444969ceb1a699744
Author:   David Steele <david@pgmasters.net>
Date:     Mon Jul 22 05:43:54 2024 +0000

    Update protocol and storage/remote modules to recent coding standards.
    
    Add const as appropriate.


src/protocol/client.c | 4 +-- src/protocol/helper.c | 57 +++++++++++++++++++-------------------- src/protocol/parallel.c | 12 ++++----- src/protocol/parallelJob.c | 8 +++--- src/protocol/server.c | 8 +++--- src/storage/remote/protocol.c | 30 ++++++++++----------- src/storage/remote/read.c | 2 +- src/storage/remote/storage.c | 14 +++++----- src/storage/remote/write.c | 6 ++--- test/src/common/harnessProtocol.c | 6 +++-- 10 files changed, 73 insertions(+), 74 deletions(-) diff --git a/src/protocol/client.c b/src/protocol/client.c index 125080f18..9e57f3ed2 100644 --- a/src/protocol/client.c +++ b/src/protocol/client.c @@ -312,7 +312,7 @@ protocolClientFreeResource(THIS_VOID) /**********************************************************************************************************************************/ FN_EXTERN ProtocolClient * -protocolClientNew(const String *name, const String *service, IoRead *read, IoWrite *write) +protocolClientNew(const String *const name, const String *const service, IoRead *const read, IoWrite *const write) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(STRING, name); @@ -424,7 +424,7 @@ protocolClientRequest(ProtocolClient *const this, const StringId command, const /**********************************************************************************************************************************/ FN_EXTERN void -protocolClientNoOp(ProtocolClient *this) +protocolClientNoOp(ProtocolClient *const this) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_CLIENT, this); diff --git a/src/protocol/helper.c b/src/protocol/helper.c index 78b313995..aae6e4726 100644 --- a/src/protocol/helper.c +++ b/src/protocol/helper.c @@ -76,7 +76,7 @@ protocolHelperInit(void) /**********************************************************************************************************************************/ FN_EXTERN bool -repoIsLocal(unsigned int repoIdx) +repoIsLocal(const unsigned int repoIdx) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(UINT, repoIdx); @@ -98,7 +98,7 @@ repoIsLocalVerify(void) /**********************************************************************************************************************************/ FN_EXTERN void -repoIsLocalVerifyIdx(unsigned int repoIdx) +repoIsLocalVerifyIdx(const unsigned int repoIdx) { FUNCTION_TEST_VOID(); @@ -110,7 +110,7 @@ repoIsLocalVerifyIdx(unsigned int repoIdx) /**********************************************************************************************************************************/ FN_EXTERN bool -pgIsLocal(unsigned int pgIdx) +pgIsLocal(const unsigned int pgIdx) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(UINT, pgIdx); @@ -135,7 +135,7 @@ pgIsLocalVerify(void) Get the command line required for local protocol execution ***********************************************************************************************************************************/ static StringList * -protocolLocalParam(ProtocolStorageType protocolStorageType, unsigned int hostIdx, unsigned int processId) +protocolLocalParam(const ProtocolStorageType protocolStorageType, const unsigned int hostIdx, const unsigned int processId) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(STRING_ID, protocolStorageType); @@ -148,7 +148,7 @@ protocolLocalParam(ProtocolStorageType protocolStorageType, unsigned int hostIdx MEM_CONTEXT_TEMP_BEGIN() { // Option replacements - KeyValue *optionReplace = kvNew(); + KeyValue *const optionReplace = kvNew(); // Add the process id -- used when more than one process will be called kvPut(optionReplace, VARSTRDEF(CFGOPT_PROCESS), VARUINT(processId)); @@ -187,7 +187,8 @@ protocolLocalParam(ProtocolStorageType protocolStorageType, unsigned int hostIdx // Helper to execute the local process. This is a separate function solely so that it can be shimmed during testing. static void protocolLocalExec( - ProtocolHelperClient *helper, ProtocolStorageType protocolStorageType, unsigned int hostIdx, unsigned int processId) + ProtocolHelperClient *const helper, const ProtocolStorageType protocolStorageType, const unsigned int hostIdx, + const unsigned int processId) { FUNCTION_TEST_BEGIN(); FUNCTION_TEST_PARAM_P(VOID, helper); @@ -233,7 +234,7 @@ protocolLocalExec( } FN_EXTERN ProtocolClient * -protocolLocalGet(ProtocolStorageType protocolStorageType, unsigned int hostIdx, unsigned int processId) +protocolLocalGet(const ProtocolStorageType protocolStorageType, const unsigned int hostIdx, const unsigned int processId) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(STRING_ID, protocolStorageType); @@ -282,7 +283,7 @@ Free the protocol client and underlying exec'd process. Log any errors as warnin while closing a local/remote that has already completed its work. The warning will be an indication that something is not right. ***********************************************************************************************************************************/ static void -protocolHelperClientFree(ProtocolHelperClient *protocolHelperClient) +protocolHelperClientFree(ProtocolHelperClient *const protocolHelperClient) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM_P(VOID, protocolHelperClient); @@ -327,7 +328,7 @@ protocolHelperClientFree(ProtocolHelperClient *protocolHelperClient) /**********************************************************************************************************************************/ FN_EXTERN void -protocolLocalFree(unsigned int processId) +protocolLocalFree(const unsigned int processId) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(UINT, processId); @@ -475,7 +476,7 @@ protocolServer(IoServer *const tlsServer, IoSession *const socketSession) Get the command line required for remote protocol execution ***********************************************************************************************************************************/ static StringList * -protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int hostIdx) +protocolRemoteParam(const ProtocolStorageType protocolStorageType, const unsigned int hostIdx) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(STRING_ID, protocolStorageType); @@ -487,26 +488,26 @@ protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int hostId MEM_CONTEXT_TEMP_BEGIN() { // Is this a repo remote? - bool isRepo = protocolStorageType == protocolStorageTypeRepo; + const bool isRepo = protocolStorageType == protocolStorageTypeRepo; // Option replacements - KeyValue *optionReplace = kvNew(); + KeyValue *const optionReplace = kvNew(); // Replace config options with the host versions - unsigned int optConfig = isRepo ? cfgOptRepoHostConfig : cfgOptPgHostConfig; + const unsigned int optConfig = isRepo ? cfgOptRepoHostConfig : cfgOptPgHostConfig; kvPut( optionReplace, VARSTRDEF(CFGOPT_CONFIG), cfgOptionIdxSource(optConfig, hostIdx) != cfgSourceDefault ? VARSTR(cfgOptionIdxStr(optConfig, hostIdx)) : NULL); - unsigned int optConfigIncludePath = isRepo ? cfgOptRepoHostConfigIncludePath : cfgOptPgHostConfigIncludePath; + const unsigned int optConfigIncludePath = isRepo ? cfgOptRepoHostConfigIncludePath : cfgOptPgHostConfigIncludePath; kvPut( optionReplace, VARSTRDEF(CFGOPT_CONFIG_INCLUDE_PATH), cfgOptionIdxSource(optConfigIncludePath, hostIdx) != cfgSourceDefault ? VARSTR(cfgOptionIdxStr(optConfigIncludePath, hostIdx)) : NULL); - unsigned int optConfigPath = isRepo ? cfgOptRepoHostConfigPath : cfgOptPgHostConfigPath; + const unsigned int optConfigPath = isRepo ? cfgOptRepoHostConfigPath : cfgOptPgHostConfigPath; kvPut( optionReplace, VARSTRDEF(CFGOPT_CONFIG_PATH), @@ -633,12 +634,12 @@ protocolRemoteParamSsh(const ProtocolStorageType protocolStorageType, const unsi FUNCTION_LOG_PARAM(UINT, hostIdx); FUNCTION_LOG_END(); - StringList *result = strLstNew(); + StringList *const result = strLstNew(); MEM_CONTEXT_TEMP_BEGIN() { // Is this a repo remote? - bool isRepo = protocolStorageType == protocolStorageTypeRepo; + const bool isRepo = protocolStorageType == protocolStorageTypeRepo; // Fixed parameters for ssh command strLstAddZ(result, "-o"); @@ -649,7 +650,7 @@ protocolRemoteParamSsh(const ProtocolStorageType protocolStorageType, const unsi strLstAddZ(result, "PasswordAuthentication=no"); // Append port if specified - ConfigOption optHostPort = isRepo ? cfgOptRepoHostPort : cfgOptPgHostPort; + const ConfigOption optHostPort = isRepo ? cfgOptRepoHostPort : cfgOptPgHostPort; if (cfgOptionIdxTest(optHostPort, hostIdx)) { @@ -663,7 +664,7 @@ protocolRemoteParamSsh(const ProtocolStorageType protocolStorageType, const unsi strZ(cfgOptionIdxStr(isRepo ? cfgOptRepoHost : cfgOptPgHost, hostIdx))); // Add remote command and parameters - StringList *paramList = protocolRemoteParam(protocolStorageType, hostIdx); + StringList *const paramList = protocolRemoteParam(protocolStorageType, hostIdx); strLstInsert(paramList, 0, cfgOptionIdxStr(isRepo ? cfgOptRepoHostCmd : cfgOptPgHostCmd, hostIdx)); strLstAdd(result, strLstJoin(paramList, " ")); @@ -806,7 +807,7 @@ protocolRemoteExec( } FN_EXTERN ProtocolClient * -protocolRemoteGet(ProtocolStorageType protocolStorageType, unsigned int hostIdx) +protocolRemoteGet(const ProtocolStorageType protocolStorageType, const unsigned int hostIdx) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(STRING_ID, protocolStorageType); @@ -814,7 +815,7 @@ protocolRemoteGet(ProtocolStorageType protocolStorageType, unsigned int hostIdx) FUNCTION_LOG_END(); // Is this a repo remote? - bool isRepo = protocolStorageType == protocolStorageTypeRepo; + const bool isRepo = protocolStorageType == protocolStorageTypeRepo; protocolHelperInit(); @@ -835,15 +836,11 @@ protocolRemoteGet(ProtocolStorageType protocolStorageType, unsigned int hostIdx) // Determine protocol id for the remote. If the process option is set then use that since we want the remote protocol id to // match the local protocol id. Otherwise set to 0 since the remote is being started from a main process and there should only // be one remote per host. - unsigned int processId = 0; - - if (cfgOptionTest(cfgOptProcess)) - processId = cfgOptionUInt(cfgOptProcess); - + const unsigned int processId = cfgOptionTest(cfgOptProcess) ? cfgOptionUInt(cfgOptProcess) : 0; CHECK(AssertError, hostIdx < protocolHelper.clientRemoteSize, "invalid host"); // Create protocol object - ProtocolHelperClient *protocolHelperClient = &protocolHelper.clientRemote[hostIdx]; + ProtocolHelperClient *const protocolHelperClient = &protocolHelper.clientRemote[hostIdx]; if (protocolHelperClient->client == NULL) { @@ -858,11 +855,11 @@ protocolRemoteGet(ProtocolStorageType protocolStorageType, unsigned int hostIdx) if (isRepo && cfgOptionIdxStrId(cfgOptRepoCipherType, hostIdx) == cipherTypeNone) { // Options to query - VariantList *param = varLstNew(); + VariantList *const param = varLstNew(); varLstAdd(param, varNewStrZ(cfgOptionIdxName(cfgOptRepoCipherType, hostIdx))); varLstAdd(param, varNewStrZ(cfgOptionIdxName(cfgOptRepoCipherPass, hostIdx))); - VariantList *optionList = configOptionRemote(protocolHelperClient->client, param); + const VariantList *const optionList = configOptionRemote(protocolHelperClient->client, param); if (varUInt64(varLstGet(optionList, 0)) != cipherTypeNone) { @@ -879,7 +876,7 @@ protocolRemoteGet(ProtocolStorageType protocolStorageType, unsigned int hostIdx) /**********************************************************************************************************************************/ FN_EXTERN void -protocolRemoteFree(unsigned int hostIdx) +protocolRemoteFree(const unsigned int hostIdx) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(UINT, hostIdx); diff --git a/src/protocol/parallel.c b/src/protocol/parallel.c index d2b0506a0..e10b61e3f 100644 --- a/src/protocol/parallel.c +++ b/src/protocol/parallel.c @@ -39,7 +39,7 @@ struct ProtocolParallel /**********************************************************************************************************************************/ FN_EXTERN ProtocolParallel * -protocolParallelNew(TimeMSec timeout, ParallelJobCallback *callbackFunction, void *callbackData) +protocolParallelNew(const TimeMSec timeout, ParallelJobCallback *const callbackFunction, void *const callbackData) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(UINT64, timeout); @@ -69,7 +69,7 @@ protocolParallelNew(TimeMSec timeout, ParallelJobCallback *callbackFunction, voi /**********************************************************************************************************************************/ FN_EXTERN void -protocolParallelClientAdd(ProtocolParallel *this, ProtocolClient *client) +protocolParallelClientAdd(ProtocolParallel *const this, ProtocolClient *const client) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL, this); @@ -90,7 +90,7 @@ protocolParallelClientAdd(ProtocolParallel *this, ProtocolClient *client) /**********************************************************************************************************************************/ FN_EXTERN unsigned int -protocolParallelProcess(ProtocolParallel *this) +protocolParallelProcess(ProtocolParallel *const this) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL, this); @@ -149,7 +149,7 @@ protocolParallelProcess(ProtocolParallel *this) timeoutSelect.tv_usec = (suseconds_t)(this->timeout % MSEC_PER_SEC * 1000); // Determine if there is data to be read - int completed = select(fdMax + 1, &selectSet, NULL, NULL, &timeoutSelect); + const int completed = select(fdMax + 1, &selectSet, NULL, NULL, &timeoutSelect); THROW_ON_SYS_ERROR(completed == -1, AssertError, "unable to select from parallel client(s)"); // If any jobs have completed then get the results @@ -234,7 +234,7 @@ protocolParallelProcess(ProtocolParallel *this) /**********************************************************************************************************************************/ FN_EXTERN ProtocolParallelJob * -protocolParallelResult(ProtocolParallel *this) +protocolParallelResult(ProtocolParallel *const this) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL, this); @@ -263,7 +263,7 @@ protocolParallelResult(ProtocolParallel *this) /**********************************************************************************************************************************/ FN_EXTERN bool -protocolParallelDone(ProtocolParallel *this) +protocolParallelDone(ProtocolParallel *const this) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL, this); diff --git a/src/protocol/parallelJob.c b/src/protocol/parallelJob.c index 46ebb545b..2cf85c128 100644 --- a/src/protocol/parallelJob.c +++ b/src/protocol/parallelJob.c @@ -17,7 +17,7 @@ struct ProtocolParallelJob /**********************************************************************************************************************************/ FN_EXTERN ProtocolParallelJob * -protocolParallelJobNew(const Variant *key, const StringId command, PackWrite *const param) +protocolParallelJobNew(const Variant *const key, const StringId command, PackWrite *const param) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(VARIANT, key); @@ -45,7 +45,7 @@ protocolParallelJobNew(const Variant *key, const StringId command, PackWrite *co /**********************************************************************************************************************************/ FN_EXTERN void -protocolParallelJobErrorSet(ProtocolParallelJob *this, int code, const String *message) +protocolParallelJobErrorSet(ProtocolParallelJob *const this, const int code, const String *const message) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL_JOB, this); @@ -69,7 +69,7 @@ protocolParallelJobErrorSet(ProtocolParallelJob *this, int code, const String *m /**********************************************************************************************************************************/ FN_EXTERN void -protocolParallelJobProcessIdSet(ProtocolParallelJob *this, unsigned int processId) +protocolParallelJobProcessIdSet(ProtocolParallelJob *const this, const unsigned int processId) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL_JOB, this); @@ -103,7 +103,7 @@ protocolParallelJobResultSet(ProtocolParallelJob *const this, PackRead *const re /**********************************************************************************************************************************/ FN_EXTERN void -protocolParallelJobStateSet(ProtocolParallelJob *this, ProtocolParallelJobState state) +protocolParallelJobStateSet(ProtocolParallelJob *const this, const ProtocolParallelJobState state) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(PROTOCOL_PARALLEL_JOB, this); diff --git a/src/protocol/server.c b/src/protocol/server.c index 71528684a..dc8ea5145 100644 --- a/src/protocol/server.c +++ b/src/protocol/server.c @@ -45,7 +45,7 @@ typedef struct ProtocolServerSession /**********************************************************************************************************************************/ FN_EXTERN ProtocolServer * -protocolServerNew(const String *name, const String *service, IoRead *read, IoWrite *write) +protocolServerNew(const String *const name, const String *const service, IoRead *const read, IoWrite *const write) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(STRING, name); @@ -123,7 +123,7 @@ protocolServerResponse(ProtocolServer *const this, const ProtocolServerResponseP /**********************************************************************************************************************************/ FN_EXTERN void -protocolServerError(ProtocolServer *this, int code, const String *message, const String *stack) +protocolServerError(ProtocolServer *this, const int code, const String *const message, const String *const stack) { FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_PARAM(PROTOCOL_SERVER, this); @@ -167,7 +167,7 @@ protocolServerRequest(ProtocolServer *const this) MEM_CONTEXT_TEMP_BEGIN() { PackRead *const request = pckReadNewIo(this->read); - ProtocolMessageType type = (ProtocolMessageType)pckReadU32P(request); + const ProtocolMessageType type = (ProtocolMessageType)pckReadU32P(request); CHECK(FormatError, type == protocolMessageTypeRequest, "expected request message"); @@ -193,7 +193,7 @@ protocolServerRequest(ProtocolServer *const this) /**********************************************************************************************************************************/ FN_EXTERN void protocolServerProcess( - ProtocolServer *this, const VariantList *retryInterval, const ProtocolServerHandler *const handlerList, + ProtocolServer *const this, const VariantList *const retryInterval, const ProtocolServerHandler *const handlerList, const unsigned int handlerListSize) { FUNCTION_LOG_BEGIN(logLevelDebug); diff --git a/src/storage/remote/protocol.c b/src/storage/remote/protocol.c index 6e672a91f..62c0234c1 100644 --- a/src/storage/remote/protocol.c +++ b/src/storage/remote/protocol.c @@ -31,7 +31,7 @@ static struct Set filter handlers ***********************************************************************************************************************************/ FN_EXTERN void -storageRemoteFilterHandlerSet(const StorageRemoteFilterHandler *filterHandler, unsigned int filterHandlerSize) +storageRemoteFilterHandlerSet(const StorageRemoteFilterHandler *const filterHandler, const unsigned int filterHandlerSize) { FUNCTION_TEST_BEGIN(); FUNCTION_TEST_PARAM_P(VOID, filterHandler); @@ -71,7 +71,7 @@ storageRemoteFilterGroup(IoFilterGroup *const filterGroup, const Pack *const fil const Pack *const filterParam = pckReadPackP(filterList); // If a compression filter - IoFilter *filter = compressFilterPack(filterKey, filterParam); + IoFilter *const filter = compressFilterPack(filterKey, filterParam); if (filter != NULL) { @@ -140,7 +140,7 @@ storageRemoteFeatureProtocol(PackRead *const param) MEM_CONTEXT_TEMP_BEGIN() { // Get storage based on remote type - const Storage *storage = + const Storage *const storage = cfgOptionStrId(cfgOptRemoteType) == protocolStorageTypeRepo ? storageRepoWrite() : storagePgWrite(); // Store local variables in the server context @@ -277,9 +277,9 @@ storageRemoteInfoProtocol(PackRead *const param) MEM_CONTEXT_TEMP_BEGIN() { // Get file info - const String *file = pckReadStrP(param); - StorageInfoLevel level = (StorageInfoLevel)pckReadU32P(param); - bool followLink = pckReadBoolP(param); + const String *const file = pckReadStrP(param); + const StorageInfoLevel level = (StorageInfoLevel)pckReadU32P(param); + const bool followLink = pckReadBoolP(param); StorageInfo info = storageInterfaceInfoP(storageRemoteProtocolLocal.driver, file, level, .followLink = followLink); @@ -583,10 +583,10 @@ storageRemotePathCreateProtocol(PackRead *const param) MEM_CONTEXT_TEMP_BEGIN() { - const String *path = pckReadStrP(param); - bool errorOnExists = pckReadBoolP(param); - bool noParentCreate = pckReadBoolP(param); - mode_t mode = pckReadModeP(param); + const String *const path = pckReadStrP(param); + const bool errorOnExists = pckReadBoolP(param); + const bool noParentCreate = pckReadBoolP(param); + const mode_t mode = pckReadModeP(param); storageInterfacePathCreateP(storageRemoteProtocolLocal.driver, path, errorOnExists, noParentCreate, mode); } @@ -610,8 +610,8 @@ storageRemotePathRemoveProtocol(PackRead *const param) MEM_CONTEXT_TEMP_BEGIN() { - const String *path = pckReadStrP(param); - bool recurse = pckReadBoolP(param); + const String *const path = pckReadStrP(param); + const bool recurse = pckReadBoolP(param); pckWriteBoolP( protocolServerResultData(result), storageInterfacePathRemoveP(storageRemoteProtocolLocal.driver, path, recurse), @@ -635,7 +635,7 @@ storageRemotePathSyncProtocol(PackRead *const param) MEM_CONTEXT_TEMP_BEGIN() { - const String *path = pckReadStrP(param); + const String *const path = pckReadStrP(param); storageInterfacePathSyncP(storageRemoteProtocolLocal.driver, path); } @@ -657,8 +657,8 @@ storageRemoteRemoveProtocol(PackRead *const param) MEM_CONTEXT_TEMP_BEGIN() { - const String *file = pckReadStrP(param); - bool errorOnMissing = pckReadBoolP(param); + const String *const file = pckReadStrP(param); + const bool errorOnMissing = pckReadBoolP(param); storageInterfaceRemoveP(storageRemoteProtocolLocal.driver, file, .errorOnMissing = errorOnMissing); } diff --git a/src/storage/remote/read.c b/src/storage/remote/read.c index 091f6d04c..ee7a75ce7 100644 --- a/src/storage/remote/read.c +++ b/src/storage/remote/read.c @@ -92,7 +92,7 @@ storageReadRemoteInternal(StorageReadRemote *const this, PackRead *const packRea } static size_t -storageReadRemote(THIS_VOID, Buffer *buffer, bool block) +storageReadRemote(THIS_VOID, Buffer *const buffer, const bool block) { THIS(StorageReadRemote); diff --git a/src/storage/remote/storage.c b/src/storage/remote/storage.c index f27146a7b..e149e6053 100644 --- a/src/storage/remote/storage.c +++ b/src/storage/remote/storage.c @@ -258,7 +258,7 @@ storageRemoteList(THIS_VOID, const String *const path, const StorageInfoLevel le /**********************************************************************************************************************************/ static StorageRead * -storageRemoteNewRead(THIS_VOID, const String *file, bool ignoreMissing, StorageInterfaceNewReadParam param) +storageRemoteNewRead(THIS_VOID, const String *const file, const bool ignoreMissing, const StorageInterfaceNewReadParam param) { THIS(StorageRemote); @@ -283,8 +283,7 @@ storageRemoteNewRead(THIS_VOID, const String *file, bool ignoreMissing, StorageI /**********************************************************************************************************************************/ static StorageWrite * -storageRemoteNewWrite( - THIS_VOID, const String *file, StorageInterfaceNewWriteParam param) +storageRemoteNewWrite(THIS_VOID, const String *const file, const StorageInterfaceNewWriteParam param) { THIS(StorageRemote); @@ -318,7 +317,8 @@ storageRemoteNewWrite( /**********************************************************************************************************************************/ static void storageRemotePathCreate( - THIS_VOID, const String *path, bool errorOnExists, bool noParentCreate, mode_t mode, StorageInterfacePathCreateParam param) + THIS_VOID, const String *const path, const bool errorOnExists, const bool noParentCreate, const mode_t mode, + const StorageInterfacePathCreateParam param) { THIS(StorageRemote); @@ -352,7 +352,7 @@ storageRemotePathCreate( /**********************************************************************************************************************************/ static bool -storageRemotePathRemove(THIS_VOID, const String *path, bool recurse, StorageInterfacePathRemoveParam param) +storageRemotePathRemove(THIS_VOID, const String *const path, const bool recurse, const StorageInterfacePathRemoveParam param) { THIS(StorageRemote); @@ -384,7 +384,7 @@ storageRemotePathRemove(THIS_VOID, const String *path, bool recurse, StorageInte /**********************************************************************************************************************************/ static void -storageRemotePathSync(THIS_VOID, const String *path, StorageInterfacePathSyncParam param) +storageRemotePathSync(THIS_VOID, const String *const path, const StorageInterfacePathSyncParam param) { THIS(StorageRemote); @@ -412,7 +412,7 @@ storageRemotePathSync(THIS_VOID, const String *path, StorageInterfacePathSyncPar /**********************************************************************************************************************************/ static void -storageRemoteRemove(THIS_VOID, const String *file, StorageInterfaceRemoveParam param) +storageRemoteRemove(THIS_VOID, const String *const file, const StorageInterfaceRemoveParam param) { THIS(StorageRemote); diff --git a/src/storage/remote/write.c b/src/storage/remote/write.c index 4ba61ee8a..f66dca305 100644 --- a/src/storage/remote/write.c +++ b/src/storage/remote/write.c @@ -160,9 +160,9 @@ storageWriteRemoteClose(THIS_VOID) /**********************************************************************************************************************************/ FN_EXTERN StorageWrite * storageWriteRemoteNew( - StorageRemote *storage, ProtocolClient *client, const String *name, mode_t modeFile, mode_t modePath, const String *user, - const String *group, time_t timeModified, bool createPath, bool syncFile, bool syncPath, bool atomic, bool compressible, - unsigned int compressLevel) + StorageRemote *const storage, ProtocolClient *const client, const String *const name, const mode_t modeFile, + const mode_t modePath, const String *const user, const String *const group, const time_t timeModified, const bool createPath, + const bool syncFile, const bool syncPath, const bool atomic, const bool compressible, const unsigned int compressLevel) { FUNCTION_LOG_BEGIN(logLevelTrace); FUNCTION_LOG_PARAM(STORAGE_REMOTE, storage); diff --git a/test/src/common/harnessProtocol.c b/test/src/common/harnessProtocol.c index 78f1b8ba9..2e4477743 100644 --- a/test/src/common/harnessProtocol.c +++ b/test/src/common/harnessProtocol.c @@ -97,7 +97,8 @@ Shim protocolLocalExec() to provide coverage as detailed in the hrnProtocolLocal ***********************************************************************************************************************************/ static void protocolLocalExec( - ProtocolHelperClient *helper, ProtocolStorageType protocolStorageType, unsigned int hostIdx, unsigned int processId) + ProtocolHelperClient *const helper, ProtocolStorageType const protocolStorageType, const unsigned int hostIdx, + const unsigned int processId) { // Call the shim when installed if (hrnProtocolStatic.localShim) @@ -194,7 +195,8 @@ Shim protocolRemoteExec() to provide coverage as detailed in the hrnProtocolRemo ***********************************************************************************************************************************/ static void protocolRemoteExec( - ProtocolHelperClient *helper, ProtocolStorageType protocolStorageType, unsigned int hostIdx, unsigned int processId) + ProtocolHelperClient *const helper, const ProtocolStorageType protocolStorageType, const unsigned int hostIdx, + const unsigned int processId) { // Call the shim when installed if (hrnProtocolStatic.remoteShim) [parent: df8cbc91c348]