From 0556b96676d85fcf9081e1008020068b4418f9ba Mon Sep 17 00:00:00 2001 From: sdixon Date: Fri, 26 Jan 2024 10:19:11 +0000 Subject: [PATCH] running clang format --- source/authentication/udaClientSSL.cpp | 2 +- source/c_api/accAPI.cpp | 27 ++-- source/c_api/clientAPI.cpp | 2 +- source/c_api/clientMDS.cpp | 2 +- source/c_api/udaGetAPI.cpp | 6 +- source/c_api/udaPutAPI.cpp | 4 +- source/cache/fileCache.cpp | 2 +- source/cache/memcache.cpp | 2 +- source/client/connection.cpp | 8 +- source/client/generateErrors.cpp | 21 ++- source/client/makeClientRequestBlock.cpp | 2 +- source/client/udaClient.cpp | 14 +- source/client2/client.cpp | 8 +- source/client2/connection.cpp | 4 +- source/client2/generate_errors.cpp | 19 ++- source/client2/make_request_block.cpp | 2 +- source/clientserver/makeRequestBlock.cpp | 4 +- source/clientserver/nameValueSubstitution.cpp | 6 +- source/clientserver/parseXML.cpp | 2 +- source/clientserver/protocolXML.cpp | 54 +++---- source/clientserver/protocolXML2.cpp | 80 +++++------ source/clientserver/protocolXML2Put.cpp | 135 +++++++++--------- source/clientserver/readXDRFile.cpp | 2 +- source/clientserver/xdrlib.cpp | 14 +- source/plugins/udaPlugin.cpp | 4 +- source/security/authenticationUtils.cpp | 4 +- source/security/clientAuthentication.cpp | 4 +- source/security/serverAuthentication.cpp | 2 +- source/security/x509Utils.cpp | 2 +- source/server/fatServer.cpp | 4 +- source/server/initPluginList.cpp | 2 +- source/server/serverGetData.cpp | 4 +- source/server/serverLegacyPlugin.cpp | 4 +- source/server/serverPlugin.cpp | 2 +- source/server/serverSubsetData.cpp | 2 +- source/server/sleepServer.cpp | 2 +- source/server/udaLegacyServer.cpp | 25 ++-- source/server/udaServer.cpp | 4 +- source/server2/get_data.cpp | 4 +- source/server2/server.cpp | 4 +- source/server2/server_plugin.cpp | 4 +- source/server2/server_subset_data.cpp | 4 +- source/server2/xdr_protocol.cpp | 2 +- source/structures/accessors.cpp | 17 +-- source/structures/parseIncludeFile.cpp | 13 +- source/structures/struct.cpp | 88 +++++++----- source/structures/xdrUserDefinedData.cpp | 103 ++++++------- 47 files changed, 366 insertions(+), 360 deletions(-) diff --git a/source/authentication/udaClientSSL.cpp b/source/authentication/udaClientSSL.cpp index 614af95c..66137bc3 100644 --- a/source/authentication/udaClientSSL.cpp +++ b/source/authentication/udaClientSSL.cpp @@ -570,7 +570,7 @@ int readUdaClientSSL(void* iohandle, char* buf, int count) } err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "readUdaClientSSL", err, - "Socket is Closed! Data request failed. Restarting connection."); + "Socket is Closed! Data request failed. Restarting connection."); UDA_LOG(UDA_LOG_DEBUG, "Socket is Closed! Data request failed. Restarting connection.\n"); return -1; } diff --git a/source/c_api/accAPI.cpp b/source/c_api/accAPI.cpp index f50efdea..78bf3c49 100644 --- a/source/c_api/accAPI.cpp +++ b/source/c_api/accAPI.cpp @@ -20,8 +20,8 @@ #include "clientserver/protocol.h" #include "clientserver/stringUtils.h" #include "clientserver/xdrlib.h" -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "struct.h" #include "version.h" @@ -100,7 +100,7 @@ int getThreadId(thread_t id) // Lock the thread and set the previous STATE void udaLockThread() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); static unsigned int mutex_initialised = 0; if (!mutex_initialised) { @@ -167,7 +167,7 @@ void udaLockThread() */ void udaUnlockThread() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); # ifdef __GNUC__ thread_t threadId = pthread_self(); # else @@ -246,7 +246,7 @@ void udaFreeDataBlocks() DATA_BLOCK* udaGetCurrentDataBlock() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && udaGetThreadLastHandle() >= 0) { return &data_blocks[udaGetThreadLastHandle()]; @@ -256,7 +256,7 @@ DATA_BLOCK* udaGetCurrentDataBlock() int udaGetCurrentDataBlockIndex() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && udaGetThreadLastHandle() >= 0) { return udaGetThreadLastHandle(); @@ -266,7 +266,7 @@ int udaGetCurrentDataBlockIndex() int udaGrowDataBlocks() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && udaGetThreadLastHandle() >= 0) { return 0; @@ -293,7 +293,7 @@ static int findNewHandleIndex() int udaGetNewDataHandle() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); int newHandleIndex = -1; if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && @@ -429,7 +429,7 @@ void udaResetClientFlag(unsigned int flag) */ void udaSetProperty(const char* property) { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); // User settings for Client and Server behaviour char name[56]; @@ -530,7 +530,7 @@ void udaSetProperty(const char* property) */ int udaGetProperty(const char* property) { - const CLIENT_FLAGS* client_flags = udaClientFlags(); + const CLIENT_FLAGS* client_flags = udaClientFlags(); // User settings for Client and Server behaviour if (property[0] == 'g') { @@ -607,7 +607,7 @@ int udaGetProperty(const char* property) void udaResetProperty(const char* property) { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); // User settings for Client and Server behaviour if (property[0] == 'g') { @@ -678,7 +678,7 @@ void udaResetProperty(const char* property) */ void udaResetProperties() { - CLIENT_FLAGS* client_flags = udaClientFlags(); + CLIENT_FLAGS* client_flags = udaClientFlags(); // Reset on Both Client and Server client_flags->get_datadble = 0; @@ -3068,8 +3068,7 @@ void udaGetGenericDimData(int handle, int ndim, void* data) memcpy(data, (void*)udaGetDimData(handle, ndim), (size_t)udaGetDimNum(handle, ndim) * sizeof(char)); break; case UDA_TYPE_UNSIGNED_INT: - memcpy(data, (void*)udaGetDimData(handle, ndim), - (size_t)udaGetDimNum(handle, ndim) * sizeof(unsigned int)); + memcpy(data, (void*)udaGetDimData(handle, ndim), (size_t)udaGetDimNum(handle, ndim) * sizeof(unsigned int)); break; case UDA_TYPE_UNSIGNED_LONG: memcpy(data, (void*)udaGetDimData(handle, ndim), @@ -3823,7 +3822,7 @@ int udaGetDimDataCheckSum(int handle, int ndim) } return (udaDataCheckSum((void*)data_blocks[handle].dims[ndim].dim, data_blocks[handle].dims[ndim].dim_n, - data_blocks[handle].dims[ndim].data_type)); + data_blocks[handle].dims[ndim].data_type)); } //=========================================================================================================== diff --git a/source/c_api/clientAPI.cpp b/source/c_api/clientAPI.cpp index 9b3a94b8..14f588bd 100644 --- a/source/c_api/clientAPI.cpp +++ b/source/c_api/clientAPI.cpp @@ -8,8 +8,8 @@ #endif #include "include/errorLog.h" -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "client.h" #include "client/makeClientRequestBlock.h" diff --git a/source/c_api/clientMDS.cpp b/source/c_api/clientMDS.cpp index 5aa0852a..37f987b3 100644 --- a/source/c_api/clientMDS.cpp +++ b/source/c_api/clientMDS.cpp @@ -1,8 +1,8 @@ #include "clientMDS.h" #include "clientserver/protocol.h" -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "client.h" #include "client/startup.h" diff --git a/source/c_api/udaGetAPI.cpp b/source/c_api/udaGetAPI.cpp index e02bbafd..f9917be3 100644 --- a/source/c_api/udaGetAPI.cpp +++ b/source/c_api/udaGetAPI.cpp @@ -14,10 +14,10 @@ # include #endif -#include "include/errorLog.h" #include "clientserver/printStructs.h" -#include "initStructs.h" +#include "include/errorLog.h" #include "include/logging.h" +#include "initStructs.h" #include "accAPI.h" #include "client.h" @@ -256,7 +256,7 @@ int udaGetBatchAPI(const char** signals, const char** sources, int count, int* h } int udaGetBatchAPIWithHost(const char** signals, const char** sources, int count, int* handles, const char* host, - int port) + int port) { CLIENT_FLAGS* client_flags = udaClientFlags(); diff --git a/source/c_api/udaPutAPI.cpp b/source/c_api/udaPutAPI.cpp index 2f57514f..f8310497 100644 --- a/source/c_api/udaPutAPI.cpp +++ b/source/c_api/udaPutAPI.cpp @@ -10,10 +10,10 @@ #include "udaPutAPI.h" #include "clientserver/allocData.h" -#include "include/errorLog.h" #include "clientserver/printStructs.h" -#include "initStructs.h" +#include "include/errorLog.h" #include "include/logging.h" +#include "initStructs.h" #include "client/makeClientRequestBlock.h" #include "client/udaClient.h" diff --git a/source/cache/fileCache.cpp b/source/cache/fileCache.cpp index 025abcc8..40b18407 100644 --- a/source/cache/fileCache.cpp +++ b/source/cache/fileCache.cpp @@ -52,8 +52,8 @@ int udaFileCacheWrite(const DATA_BLOCK* data_block, const REQUEST_BLOCK* request # include # include -# include # include +# include # include constexpr int CACHE_MAXCOUNT = 100; // Max Attempts at obtaining a database table lock diff --git a/source/cache/memcache.cpp b/source/cache/memcache.cpp index 81733e4f..58b91a20 100644 --- a/source/cache/memcache.cpp +++ b/source/cache/memcache.cpp @@ -52,10 +52,10 @@ DATA_BLOCK* uda::cache::cache_read(uda::cache::UdaCache* cache, const REQUEST_DA // needed for GCC 12.0 - do not delete # include -# include # include # include # include +# include # include # define UDA_CACHE_HOST "localhost" // Override these with environment variables with the same name diff --git a/source/client/connection.cpp b/source/client/connection.cpp index 3d8f83cb..7f7c6cb6 100644 --- a/source/client/connection.cpp +++ b/source/client/connection.cpp @@ -42,8 +42,8 @@ #include "client.h" #include -#include #include +#include #include #include "getEnvironment.h" @@ -265,7 +265,7 @@ int createConnection(XDR* client_input, XDR* client_output, time_t* tv_server_st if (host != nullptr) { if (host->host_name.empty()) { udaAddError(UDA_CODE_ERROR_TYPE, __func__, -1, - "The host_name is not recognised for the host alias provided!"); + "The host_name is not recognised for the host alias provided!"); return -1; } hostname = host->host_name.c_str(); @@ -408,7 +408,7 @@ int createConnection(XDR* client_input, XDR* client_output, time_t* tv_server_st if (host != nullptr) { if (host->host_name.empty()) { udaAddError(UDA_CODE_ERROR_TYPE, __func__, -1, - "The hostname2 is not recognised for the host alias provided!"); + "The hostname2 is not recognised for the host alias provided!"); return -1; } hostname = host->host_name.c_str(); @@ -605,7 +605,7 @@ int clientWriteout(void* iohandle ALLOW_UNUSED_TYPE, char* buf, int count) if (errno == ECONNRESET) { UDA_LOG(UDA_LOG_DEBUG, "ECONNRESET error!\n"); udaAddError(UDA_CODE_ERROR_TYPE, __func__, -2, - "ECONNRESET: The server program has crashed or closed the socket unexpectedly"); + "ECONNRESET: The server program has crashed or closed the socket unexpectedly"); return -2; } else { if (errno == ENETUNREACH) { diff --git a/source/client/generateErrors.cpp b/source/client/generateErrors.cpp index 7a95f746..222b3a13 100644 --- a/source/client/generateErrors.cpp +++ b/source/client/generateErrors.cpp @@ -79,7 +79,7 @@ int idamSyntheticModel(int model, int param_n, float* params, int data_n, float* #ifdef NO_GSL_LIB int err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "idamSyntheticModel", err, - "Random Number Generators from the GSL library required."); + "Random Number Generators from the GSL library required."); return 999; #else @@ -176,7 +176,7 @@ int generateIdamSyntheticData(int handle) if (udaGetDataType(handle) == UDA_TYPE_DCOMPLEX || udaGetDataType(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamSyntheticData", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } @@ -293,7 +293,7 @@ int generateIdamSyntheticData(int handle) if (udaGetSyntheticData(handle) == nullptr) { if ((err = allocArray(udaGetDataType(handle), udaGetDataNum(handle), &synthetic))) { udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamSyntheticData", err, - "Problem Allocating Heap Memory for Synthetic Data"); + "Problem Allocating Heap Memory for Synthetic Data"); return err; } udaSetSyntheticData(handle, synthetic); @@ -431,14 +431,14 @@ int generateIdamSyntheticDimData(int handle, int ndim) if (udaGetDataType(handle) == UDA_TYPE_DCOMPLEX || udaGetDataType(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamSyntheticDimData", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } float* data; if ((data = (float*)malloc(udaGetDimNum(handle, ndim) * sizeof(float))) == nullptr) { udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamSyntheticDimData", 1, - "Problem Allocating Heap Memory for Synthetic Dimensional Data"); + "Problem Allocating Heap Memory for Synthetic Dimensional Data"); return 1; } @@ -539,7 +539,7 @@ int generateIdamSyntheticDimData(int handle, int ndim) if (err != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamSyntheticDimData", err, - "Unable to Generate Synthetic Dimensional Data"); + "Unable to Generate Synthetic Dimensional Data"); free(data); return err; } @@ -550,7 +550,7 @@ int generateIdamSyntheticDimData(int handle, int ndim) if (udaGetSyntheticDimData(handle, ndim) == nullptr) { if ((err = allocArray(udaGetDimType(handle, ndim), udaGetDimNum(handle, ndim), &synthetic))) { udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamSyntheticDimData", err, - "Problem Allocating Heap Memory for Synthetic Dimensional Data"); + "Problem Allocating Heap Memory for Synthetic Dimensional Data"); return err; } @@ -685,7 +685,7 @@ int generateIdamDataError(int handle) if (udaGetDataType(handle) == UDA_TYPE_DCOMPLEX || udaGetDataType(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamDataError", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } @@ -798,8 +798,7 @@ int generateIdamDataError(int handle) //-------------------------------------------------------------------------------------------------------------- // Generate Error Data - err = - idamErrorModel(model, param_n, params, udaGetDataNum(handle), data, &asymmetry, (float*)errhi, (float*)errlo); + err = idamErrorModel(model, param_n, params, udaGetDataNum(handle), data, &asymmetry, (float*)errhi, (float*)errlo); if (err != 0) { free(data); @@ -1004,7 +1003,7 @@ int generateIdamDimDataError(int handle, int ndim) if (udaGetDataType(handle) == UDA_TYPE_DCOMPLEX || udaGetDataType(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generateIdamDimDataError", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } diff --git a/source/client/makeClientRequestBlock.cpp b/source/client/makeClientRequestBlock.cpp index 4aec2069..a9d134ae 100644 --- a/source/client/makeClientRequestBlock.cpp +++ b/source/client/makeClientRequestBlock.cpp @@ -24,11 +24,11 @@ Interprets the API arguments and assembles a Request data structure. #include "initStructs.h" #include "udaErrors.h" -#include #include #include #include #include +#include #include int makeRequestData(const char* data_object, const char* data_source, REQUEST_DATA* request) diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index 01205dd3..e77683b2 100644 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -13,10 +13,10 @@ #include #include #include -#include #include #include #include +#include #include #include "accAPI.h" @@ -776,8 +776,8 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) if (count > 0) { // Error if data is waiting err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Data waiting in the input data buffer when none expected! Please contact the system " - "administrator."); + "Data waiting in the input data buffer when none expected! Please contact the system " + "administrator."); UDA_LOG(UDA_LOG_DEBUG, "[%d] excess data bytes waiting in input buffer!\n", count++); break; } @@ -793,7 +793,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Corrupted input data stream! Please contact the system administrator."); + "Corrupted input data stream! Please contact the system administrator."); UDA_LOG(UDA_LOG_DEBUG, "Unable to flush input buffer!!!\n"); break; } @@ -836,7 +836,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) g_user_defined_type_list, &(request->putDataBlockList), protocol_version, &log_struct_list, *private_flags, malloc_source)) != 0) { udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Protocol 1 Error (sending putDataBlockList from Request Block)"); + "Protocol 1 Error (sending putDataBlockList from Request Block)"); break; } } @@ -1067,7 +1067,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) if (err == 0 && (udaGetDataStatus(data_block_idx)) == MIN_STATUS && !client_flags->get_bad) { // If Data are not usable, flag the client udaAddError(UDA_CODE_ERROR_TYPE, __func__, DATA_STATUS_BAD, - "Data Status is BAD ... Data are Not Usable!"); + "Data Status is BAD ... Data are Not Usable!"); DATA_BLOCK* data_block = udaGetDataBlock(data_block_idx); if (data_block->errcode == 0) { @@ -1149,7 +1149,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) if (err == 0 && (udaGetDataStatus(data_block_idx) == MIN_STATUS) && !client_flags->get_bad) { // If Data are not usable, flag the client udaAddError(UDA_CODE_ERROR_TYPE, __func__, DATA_STATUS_BAD, - "Data Status is BAD ... Data are Not Usable!"); + "Data Status is BAD ... Data are Not Usable!"); DATA_BLOCK* data_block = udaGetDataBlock(data_block_idx); if (data_block->errcode == 0) { diff --git a/source/client2/client.cpp b/source/client2/client.cpp index 1b1caf22..6c7bbad0 100644 --- a/source/client2/client.cpp +++ b/source/client2/client.cpp @@ -13,12 +13,12 @@ #include "udaTypes.h" #include #include -#include #include #include #include #include #include +#include #include namespace @@ -511,7 +511,7 @@ int uda::client::Client::get_requests(RequestBlock& request_block, int* indices) if (err == 0 && (get_data_status(data_block) == MIN_STATUS) && !client_flags_.get_bad) { // If Data are not usable, flag the client udaAddError(UDA_CODE_ERROR_TYPE, __func__, DATA_STATUS_BAD, - "Data Status is BAD ... Data are Not Usable!"); + "Data Status is BAD ... Data are Not Usable!"); if (data_block->errcode == 0) { // Don't over-rule a server side error @@ -583,7 +583,7 @@ int uda::client::Client::send_putdata(const RequestBlock& request_block) &(request->putDataBlockList), protocol_version_, &log_struct_list_, private_flags_, malloc_source_)) != 0) { udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Protocol 1 Error (sending putDataBlockList from Request Block)"); + "Protocol 1 Error (sending putDataBlockList from Request Block)"); throw uda::exceptions::ClientError("Protocol 1 Error (sending putDataBlockList from Request Block)"); } } @@ -693,7 +693,7 @@ int uda::client::Client::test_connection() if (!rc) { int err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Corrupted input data stream! Please contact the system administrator."); + "Corrupted input data stream! Please contact the system administrator."); UDA_LOG(UDA_LOG_DEBUG, "Unable to flush input buffer!!!\n"); throw uda::exceptions::ClientError("Corrupted input data stream! Please contact the system administrator."); } diff --git a/source/client2/connection.cpp b/source/client2/connection.cpp index 2a4b9f08..df39a50f 100644 --- a/source/client2/connection.cpp +++ b/source/client2/connection.cpp @@ -40,8 +40,8 @@ # endif #endif -#include #include +#include #include #include "error_codes.h" @@ -606,7 +606,7 @@ int uda::client::writeout(void* iohandle, char* buf, int count) if (errno == ECONNRESET) { UDA_LOG(UDA_LOG_DEBUG, "ECONNRESET error!\n"); udaAddError(UDA_CODE_ERROR_TYPE, __func__, -2, - "ECONNRESET: The server program has crashed or closed the socket unexpectedly"); + "ECONNRESET: The server program has crashed or closed the socket unexpectedly"); return -2; } else { if (errno == ENETUNREACH) { diff --git a/source/client2/generate_errors.cpp b/source/client2/generate_errors.cpp index 96f9e47a..4c361e24 100644 --- a/source/client2/generate_errors.cpp +++ b/source/client2/generate_errors.cpp @@ -67,8 +67,7 @@ int uda::client::synthetic_model(int model, int param_n, float* params, int data #ifdef NO_GSL_LIB int err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "synthetic_model", err, - "Random Number Generators from the GSL library required."); + udaAddError(UDA_CODE_ERROR_TYPE, "synthetic_model", err, "Random Number Generators from the GSL library required."); return 999; #else float shift; @@ -175,7 +174,7 @@ int uda::client::generate_synthetic_data(int handle) if (get_data_type(handle) == UDA_TYPE_DCOMPLEX || get_data_type(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generate_synthetic_data", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } @@ -292,7 +291,7 @@ int uda::client::generate_synthetic_data(int handle) if (getSyntheticData(handle) == nullptr) { if ((err = allocArray(get_data_type(handle), get_data_num(handle), &synthetic))) { udaAddError(UDA_CODE_ERROR_TYPE, "generate_synthetic_data", err, - "Problem Allocating Heap Memory for Synthetic Data"); + "Problem Allocating Heap Memory for Synthetic Data"); return err; } set_synthetic_data(handle, synthetic); @@ -430,14 +429,14 @@ int uda::client::generate_synthetic_dim_data(int handle, int ndim) if (get_data_type(handle) == UDA_TYPE_DCOMPLEX || get_data_type(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generate_synthetic_dim_data", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } float* data; if ((data = (float*)malloc(get_dim_num(handle, ndim) * sizeof(float))) == nullptr) { udaAddError(UDA_CODE_ERROR_TYPE, "generate_synthetic_dim_data", 1, - "Problem Allocating Heap Memory for Synthetic Dimensional Data"); + "Problem Allocating Heap Memory for Synthetic Dimensional Data"); return 1; } @@ -538,7 +537,7 @@ int uda::client::generate_synthetic_dim_data(int handle, int ndim) if (err != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "generate_synthetic_dim_data", err, - "Unable to Generate Synthetic Dimensional Data"); + "Unable to Generate Synthetic Dimensional Data"); free(data); return err; } @@ -549,7 +548,7 @@ int uda::client::generate_synthetic_dim_data(int handle, int ndim) if (get_synthetic_dim_data(handle, ndim) == nullptr) { if ((err = allocArray(get_dim_type(handle, ndim), get_dim_num(handle, ndim), &synthetic))) { udaAddError(UDA_CODE_ERROR_TYPE, "generate_synthetic_dim_data", err, - "Problem Allocating Heap Memory for Synthetic Dimensional Data"); + "Problem Allocating Heap Memory for Synthetic Dimensional Data"); return err; } @@ -684,7 +683,7 @@ int uda::client::generate_data_error(int handle) if (get_data_type(handle) == UDA_TYPE_DCOMPLEX || get_data_type(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generate_data_error", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } @@ -1002,7 +1001,7 @@ int uda::client::generate_dim_data_error(int handle, int ndim) if (get_data_type(handle) == UDA_TYPE_DCOMPLEX || get_data_type(handle) == UDA_TYPE_COMPLEX) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "generate_dim_data_error", err, - "Not configured to Generate Complex Type Synthetic Data"); + "Not configured to Generate Complex Type Synthetic Data"); return 999; } diff --git a/source/client2/make_request_block.cpp b/source/client2/make_request_block.cpp index 46959164..6e68bb8c 100644 --- a/source/client2/make_request_block.cpp +++ b/source/client2/make_request_block.cpp @@ -6,8 +6,8 @@ #include "initStructs.h" #include "udaErrors.h" -#include #include +#include #include namespace diff --git a/source/clientserver/makeRequestBlock.cpp b/source/clientserver/makeRequestBlock.cpp index 1c0b3831..3a587b88 100644 --- a/source/clientserver/makeRequestBlock.cpp +++ b/source/clientserver/makeRequestBlock.cpp @@ -231,7 +231,7 @@ int makeRequestData(REQUEST_DATA* request, PLUGINLIST pluginList, const ENVIRONM if ((p0 != nullptr || p1 != nullptr) && (p != nullptr || p2 != nullptr)) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "makeServerRequestBlock", err, - "Source syntax: path with parenthesis () is incorrect!"); + "Source syntax: path with parenthesis () is incorrect!"); return err; } @@ -854,7 +854,7 @@ int source_file_format_test(const char* source, REQUEST_DATA* request, PLUGINLIS udaAddError(UDA_SYSTEM_ERROR_TYPE, "sourceFileFormatTest", errno, ""); } udaAddError(UDA_CODE_ERROR_TYPE, "sourceFileFormatTest", 999, - "Unable to Identify the File's Format"); + "Unable to Identify the File's Format"); return -999; } diff --git a/source/clientserver/nameValueSubstitution.cpp b/source/clientserver/nameValueSubstitution.cpp index 9cef0dad..1b8ee825 100644 --- a/source/clientserver/nameValueSubstitution.cpp +++ b/source/clientserver/nameValueSubstitution.cpp @@ -10,10 +10,10 @@ #include "initStructs.h" #include "udaErrors.h" -#include #include #include #include +#include #include static void embedded_value_substitution(NAMEVALUELIST* nameValueList); @@ -124,7 +124,7 @@ int name_value_substitution(NAMEVALUELIST* nameValueList, char* tpass) UDA_LOG(UDA_LOG_DEBUG, "Inconsistent count of placeholders and available substitutions!\n"); err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "nameValueSubstitution", err, - "Inconsistent count of placeholders and available substitutions!"); + "Inconsistent count of placeholders and available substitutions!"); break; } @@ -137,7 +137,7 @@ int name_value_substitution(NAMEVALUELIST* nameValueList, char* tpass) UDA_LOG(UDA_LOG_DEBUG, "tpassIndex[%d] = %d (%d)\n", i, tpassIndex[i], placeholderCount); err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "nameValueSubstitution", err, - "Placeholder numbering is Inconsistent with Placeholder Count!"); + "Placeholder numbering is Inconsistent with Placeholder Count!"); break; } diff --git a/source/clientserver/parseXML.cpp b/source/clientserver/parseXML.cpp index 33852e9e..b6056159 100644 --- a/source/clientserver/parseXML.cpp +++ b/source/clientserver/parseXML.cpp @@ -23,9 +23,9 @@ #ifndef NOXMLPARSER # include "udaTypes.h" -# include # include # include +# include static double deScale(char* scale); static void parse_target_value(xmlDocPtr doc, xmlNodePtr cur, const char* target, double* value); diff --git a/source/clientserver/protocolXML.cpp b/source/clientserver/protocolXML.cpp index 17fd4f76..88001a16 100644 --- a/source/clientserver/protocolXML.cpp +++ b/source/clientserver/protocolXML.cpp @@ -144,7 +144,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC int shape = data_block->data_n; // rank 1 array of dimension lengths auto udt = (USERDEFINEDTYPE*)data_block->opaque_block; // The data's structure definition USERDEFINEDTYPE* u = udaFindUserDefinedType(userdefinedtypelist, "SARRAY", - 0); // Locate the carrier structure definition + 0); // Locate the carrier structure definition UDA_LOG(UDA_LOG_DEBUG, "protocolXML: Sending to Client\n"); @@ -153,7 +153,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC UDA_LOG(UDA_LOG_DEBUG, "protocolXML: nullptr SARRAY User defined data Structure Definition\n"); udaPrintUserDefinedTypeListTable(*userdefinedtypelist); udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "nullptr User defined data Structure Definition"); + "nullptr User defined data Structure Definition"); break; } @@ -203,13 +203,13 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - "Unable to Obtain a Temporary/Cache File Name"); + "Unable to Obtain a Temporary/Cache File Name"); break; } if ((xdrfile = fopen(temp_file.c_str(), "wb")) == nullptr) { err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - "Unable to Open a Temporary/Cache XDR File for Writing"); + "Unable to Open a Temporary/Cache XDR File for Writing"); break; } @@ -240,15 +240,15 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC UDA_LOG(UDA_LOG_DEBUG, "protocolXML: Structure Definitions sent: rc = %d\n", rc); // send the Data - rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data, - protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source); + rc = rc && + udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data, + protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source); UDA_LOG(UDA_LOG_DEBUG, "protocolXML: Data sent: rc = %d\n", rc); if (!rc) { err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Bad Return Code passing data structures"); + udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, "Bad Return Code passing data structures"); break; } @@ -355,7 +355,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - "Unable to Obtain a Temporary File Name [3]"); + "Unable to Obtain a Temporary File Name [3]"); err = 998; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, tempFile); UDA_LOG(UDA_LOG_DEBUG, "Unable to Obtain a Temporary File Name [3], tempFile=[%s]\n", @@ -403,7 +403,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Obtain a Temporary File Name [2]"); + " Unable to Obtain a Temporary File Name [2]"); err = 997; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, tempFile); UDA_LOG(UDA_LOG_DEBUG, "Unable to Obtain a Temporary File Name [2], tempFile=[%s]\n", @@ -418,7 +418,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC if ((xdrfile = fopen(tempFile, "rb")) == nullptr) { // Read temporary file err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Open a Temporary XDR File for Writing"); + " Unable to Open a Temporary XDR File for Writing"); break; } @@ -436,21 +436,21 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Structure Definitions"); + "Failure receiving Structure Definitions"); break; } UDA_LOG(UDA_LOG_DEBUG, "protocolXML: udaXDRUserDefinedTypeData #A\n"); udaInitUserDefinedType(udt_received); - rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data, - protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // receive the Data + rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, + &data, protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // receive the Data UDA_LOG(UDA_LOG_DEBUG, "protocolXML: udaXDRUserDefinedTypeData #B\n"); if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Data and Structure Definition"); + "Failure receiving Data and Structure Definition"); break; } @@ -497,7 +497,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Name of Received Data Structure Incorrect"); + "Name of Received Data Structure Incorrect"); break; } } @@ -540,7 +540,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Obtain a Temporary File Name"); + " Unable to Obtain a Temporary File Name"); err = 996; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, tempFile); UDA_LOG(UDA_LOG_DEBUG, "Unable to Obtain a Temporary File Name, tempFile=[%s]\n", tempFile); @@ -579,7 +579,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC if ((xdrfile = fopen(tempFile, "rb")) == nullptr) { // Read temporary file err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Open a Temporary XDR File for Writing"); + " Unable to Open a Temporary XDR File for Writing"); break; } @@ -594,20 +594,21 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Structure Definitions"); + "Failure receiving Structure Definitions"); break; } udaInitUserDefinedType(udt_received); - rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, - &data, protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // receive the Data + rc = + rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, + &data, protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // receive the Data if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Data and Structure Definition"); + "Failure receiving Data and Structure Definition"); break; } @@ -634,8 +635,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC auto s = (SARRAY*)data; if (s->count != data_block->data_n) { // check for consistency err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Inconsistent S Array Counts"); + udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, "Inconsistent S Array Counts"); break; } data_block->data = (char*) @@ -650,7 +650,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Name of Received Data Structure Incorrect"); + "Name of Received Data Structure Incorrect"); break; } } diff --git a/source/clientserver/protocolXML2.cpp b/source/clientserver/protocolXML2.cpp index 8fd24fc9..f11c1b99 100644 --- a/source/clientserver/protocolXML2.cpp +++ b/source/clientserver/protocolXML2.cpp @@ -178,7 +178,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO UDA_LOG(UDA_LOG_DEBUG, "nullptr SARRAY User defined data Structure Definition\n"); udaPrintUserDefinedTypeListTable(*userdefinedtypelist); udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "nullptr User defined data Structure Definition"); + "nullptr User defined data Structure Definition"); break; } @@ -223,13 +223,13 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Obtain a Temporary/Cache File Name"); + " Unable to Obtain a Temporary/Cache File Name"); break; } if ((xdrfile = fopen(temp_file.c_str(), "wb")) == nullptr) { err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Open a Temporary/Cache XDR File for Writing"); + " Unable to Open a Temporary/Cache XDR File for Writing"); break; } @@ -266,7 +266,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", errno, ""); } udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2", err, - "Unable to Open a XDR Memory Stream for Writing data objects"); + "Unable to Open a XDR Memory Stream for Writing data objects"); break; } @@ -314,7 +314,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Bad Return Code passing Structure Definitions"); + "Bad Return Code passing Structure Definitions"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -327,15 +327,14 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO } rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data, - protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // send the Data + protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // send the Data UDA_LOG(UDA_LOG_DEBUG, "Data sent: rc = %d\n", rc); if (!rc) { err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Bad Return Code passing data structures"); + udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, "Bad Return Code passing data structures"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -537,7 +536,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - "Unable to Obtain a Temporary File Name [3]"); + "Unable to Obtain a Temporary File Name [3]"); err = 998; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, temp_file.c_str()); UDA_LOG(UDA_LOG_DEBUG, "Unable to Obtain a Temporary File Name [3], tempFile=[%s]\n", @@ -629,7 +628,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Obtain a Temporary File Name [2]"); + " Unable to Obtain a Temporary File Name [2]"); err = 997; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, temp_file.c_str()); UDA_LOG(UDA_LOG_DEBUG, "Unable to Obtain a Temporary File Name [2], tempFile=[%s]\n", @@ -644,7 +643,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO if ((xdrfile = fopen(temp_file.c_str(), "rb")) == nullptr) { // Read temporary file err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Open a Temporary XDR File for Writing"); + " Unable to Open a Temporary XDR File for Writing"); break; } @@ -695,7 +694,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Structure Definitions"); + "Failure receiving Structure Definitions"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -710,15 +709,15 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO UDA_LOG(UDA_LOG_DEBUG, "udaXDRUserDefinedTypeData #A\n"); udaInitUserDefinedType(udt_received); - rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data, - protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // receive the Data + rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, + &data, protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // receive the Data UDA_LOG(UDA_LOG_DEBUG, "udaXDRUserDefinedTypeData #B\n"); if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Data and Structure Definition"); + "Failure receiving Data and Structure Definition"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -787,7 +786,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Name of Received Data Structure Incorrect"); + "Name of Received Data Structure Incorrect"); break; } } @@ -893,7 +892,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Structure Definitions"); + "Failure receiving Structure Definitions"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -904,14 +903,15 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO udaInitUserDefinedType(udt_received); - rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, - &data, protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // receive the Data + rc = + rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, + &data, protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // receive the Data if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Data and Structure Definition"); + "Failure receiving Data and Structure Definition"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -938,8 +938,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO SARRAY* s = (SARRAY*)data; if (s->count != data_block->data_n) { // check for consistency err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Inconsistent S Array Counts"); + udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, "Inconsistent S Array Counts"); break; } data_block->data = (char*) @@ -954,7 +953,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Name of Received Data Structure Incorrect"); + "Name of Received Data Structure Incorrect"); break; } } @@ -976,7 +975,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO err = errno; } udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Obtain a Temporary File Name"); + " Unable to Obtain a Temporary File Name"); err = 996; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, temp_file.c_str()); UDA_LOG(UDA_LOG_DEBUG, "Unable to Obtain a Temporary File Name, tempFile=[%s]\n", @@ -1014,7 +1013,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO if ((xdrfile = fopen(temp_file.c_str(), "rb")) == nullptr) { // Read temporary file err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML", err, - " Unable to Open a Temporary XDR File for Writing"); + " Unable to Open a Temporary XDR File for Writing"); break; } @@ -1028,7 +1027,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Structure Definitions"); + "Failure receiving Structure Definitions"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -1039,14 +1038,15 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO udaInitUserDefinedType(udt_received); - rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, - &data, protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // receive the Data + rc = + rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, + &data, protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // receive the Data if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Failure receiving Data and Structure Definition"); + "Failure receiving Data and Structure Definition"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -1075,8 +1075,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO auto s = (SARRAY*)data; if (s->count != data_block->data_n) { // check for consistency err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Inconsistent S Array Counts"); + udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, "Inconsistent S Array Counts"); break; } data_block->data = (char*) @@ -1091,7 +1090,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err, - "Name of Received Data Structure Incorrect"); + "Name of Received Data Structure Incorrect"); break; } } @@ -1230,7 +1229,7 @@ int unpackXDRFile(LOGMALLOCLIST* logmalloclist, XDR* xdrs, unsigned char* filena udaInitUserDefinedType(udt_received); rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data, - protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source); + protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source); if (!rc) { err = 999; @@ -1340,12 +1339,11 @@ int unpackXDRObject(LOGMALLOCLIST* logmalloclist, XDR* xdrs, unsigned char* obje udaInitUserDefinedType(udt_received); rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data, - protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source); + protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source); if (!rc) { err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "unpackXDRObject", err, - "Failure receiving Data and Structure Definition"); + udaAddError(UDA_CODE_ERROR_TYPE, "unpackXDRObject", err, "Failure receiving Data and Structure Definition"); if (xdr_stdio_flag) { xdr_destroy(xdrs); // Close the stdio stream and reuse the TCP socket stream xdrs = priorxdrs; @@ -1432,7 +1430,7 @@ int packXDRDataBlockObject(unsigned char* object, size_t objectSize, DATA_BLOCK* udaAddError(UDA_SYSTEM_ERROR_TYPE, "packXDRDataBlockObject", errno, ""); } udaAddError(UDA_CODE_ERROR_TYPE, "packXDRDataBlockObject", err, - "Unable to Open a XDR Memory Stream for Writing data objects"); + "Unable to Open a XDR Memory Stream for Writing data objects"); break; } diff --git a/source/clientserver/protocolXML2Put.cpp b/source/clientserver/protocolXML2Put.cpp index 10d8fbea..a74883b6 100644 --- a/source/clientserver/protocolXML2Put.cpp +++ b/source/clientserver/protocolXML2Put.cpp @@ -88,7 +88,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST *data = malloc(datacount * userdefinedtype->size); if (structRank > 1 && structShape != nullptr) { udaAddMalloc2(logmalloclist, *data, datacount, userdefinedtype->size, userdefinedtype->name, structRank, - structShape); + structShape); } else { udaAddMalloc(logmalloclist, *data, datacount, userdefinedtype->size, userdefinedtype->name); } @@ -176,7 +176,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume 0 means No Pointer data to send! + &shape); // Assume 0 means No Pointer data to send! // Allocation of pointer data within SOAP is problematic. // Data malloc'd within SOAP are typed "unknown". @@ -206,7 +206,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { // there should be no remainder udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -217,7 +217,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Type Float Data Heap Allocation not found in log!"); + "Type Float Data Heap Allocation not found in log!"); break; } @@ -270,7 +270,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -291,7 +291,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -302,7 +302,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Type Double Data Heap Allocation not found in log!"); + "Type Double Data Heap Allocation not found in log!"); break; } @@ -355,7 +355,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -375,7 +375,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified short malloc total size not integer multiple!"); + "Specified short malloc total size not integer multiple!"); count = 0; } } @@ -386,7 +386,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Short Data Heap Allocation not found in log!"); + "Short Data Heap Allocation not found in log!"); break; } @@ -425,8 +425,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST shape = nullptr; } d = (char*)malloc(count * sizeof(unsigned short)); - udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned short), "unsigned short", rank, - shape); + udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned short), "unsigned short", + rank, shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -439,7 +439,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -459,9 +459,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST count = totalsize / size; if (rcount != 0) { - udaAddError( - UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified unsigned short malloc total size not integer multiple!"); + udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, + "Specified unsigned short malloc total size not integer multiple!"); count = 0; } } @@ -472,7 +471,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Short Data Heap Allocation not found in log!"); + "Unsigned Short Data Heap Allocation not found in log!"); break; } @@ -524,7 +523,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -545,7 +544,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -556,7 +555,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Integer Data Heap Allocation not found in log!"); + "Integer Data Heap Allocation not found in log!"); break; } @@ -596,7 +595,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST } d = (char*)malloc(count * sizeof(unsigned int)); udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned int), "unsigned int", rank, - shape); + shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -609,7 +608,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -629,7 +628,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -639,7 +638,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Integer Data Heap Allocation not found in log!"); + "Unsigned Integer Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -690,7 +689,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -711,7 +710,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -721,7 +720,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Long Long Data Heap Allocation not found in log!"); + "Long Long Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -759,8 +758,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST shape = nullptr; } d = (char*)malloc(count * sizeof(unsigned long long)); - udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned long long), "unsigned long long", - rank, shape); + udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned long long), + "unsigned long long", rank, shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -773,7 +772,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -794,7 +793,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -804,7 +803,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Long Long Data Heap Allocation not found in log!"); + "Unsigned Long Long Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -859,7 +858,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -880,7 +879,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -908,7 +907,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Char Data Heap Allocation not found in log!"); + "Char Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -980,7 +979,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST } udaFindMalloc(logmalloclist, (void*)p, &count, &size, - &type); // Assume 0 means No Pointer data to send! + &type); // Assume 0 means No Pointer data to send! if (malloc_source == UDA_MALLOC_SOURCE_DOM && (count == 0 || size == 0) && d != nullptr) { int lstr = (int)strlen(d); @@ -1005,7 +1004,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "String Data Heap Allocation not found in log!"); + "String Data Heap Allocation not found in log!"); break; } } @@ -1120,7 +1119,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST } udaFindMalloc2(logmalloclist, (void*)p, &nstr, &size, &type, &rank, - &shape); // Assume 0 means No Pointer data to send! + &shape); // Assume 0 means No Pointer data to send! // or heap allocated in external library! // Is this a fixed length array of strings ? @@ -1137,7 +1136,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((nstr == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "String Array Data Heap Allocation not found in log!"); + "String Array Data Heap Allocation not found in log!"); break; } @@ -1223,7 +1222,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST break; } udaFindMalloc(logmalloclist, (void*)p, &count, &size, - &type); // Assume 0 means No string to send! + &type); // Assume 0 means No string to send! if (count == 1 && STR_EQUALS(type, "unknown")) { // ***** Fix for SOAP sources incomplete! count = size; size = sizeof(char); @@ -1231,7 +1230,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "String Data Heap Allocation not found in log!"); + "String Data Heap Allocation not found in log!"); break; } } @@ -1278,8 +1277,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST ssize = sizeof(char); // Assume xml void pointer type is to char type = chartype; } else { - ssize = - (int)udaGetsizeof(userdefinedtypelist, userdefinedtype->compoundfield[j].type); + ssize = (int)udaGetsizeof(userdefinedtypelist, + userdefinedtype->compoundfield[j].type); type = userdefinedtype->compoundfield[j].type; } @@ -1288,7 +1287,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST count = totalsize / size; } else { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -1297,7 +1296,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Data Heap Allocation not found in log!"); + "Data Heap Allocation not found in log!"); break; } } @@ -1341,7 +1340,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST // Size and Type also known. Type cannot be 'void'. udaAddNonMalloc(logmalloclist, (void*)p, userdefinedtype->compoundfield[j].count, - userdefinedtype->compoundfield[j].size, userdefinedtype->compoundfield[j].type); + userdefinedtype->compoundfield[j].size, userdefinedtype->compoundfield[j].type); loopcount = userdefinedtype->compoundfield[j].count; count = 0; @@ -1417,8 +1416,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (newNTree->children == nullptr && newNTree->branches == 0) { newNTree->children = (NTREE**)malloc(loopcount * sizeof(NTREE*)); // Allocate the node array - udaAddMalloc(logmalloclist, (void*)newNTree->children, loopcount, sizeof(NTREE*), - "NTREE *"); + udaAddMalloc(logmalloclist, (void*)newNTree->children, loopcount, + sizeof(NTREE*), "NTREE *"); } else { // Multiple branches (user types) originating in the same node auto old = (VOIDTYPE)newNTree->children; newNTree->children = (NTREE**)realloc( @@ -1426,7 +1425,7 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST (newNTree->branches + loopcount) * sizeof(NTREE*)); // Individual node addresses remain valid udaChangeMalloc(logmalloclist, old, (void*)newNTree->children, - newNTree->branches + loopcount, sizeof(NTREE*), "NTREE *"); + newNTree->branches + loopcount, sizeof(NTREE*), "NTREE *"); } } udaAddNTree(newNTree, subNTree); // Only first call creates new tree node @@ -1441,7 +1440,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST if (udaGettypeof(type) != UDA_TYPE_UNKNOWN) { char* z = (char*)*p; - rc = rc && udaXDRAtomicData(logmalloclist, xdrs, type, count, size, &z); // Must be an Atomic Type + rc = rc && + udaXDRAtomicData(logmalloclist, xdrs, type, count, size, &z); // Must be an Atomic Type *p = (VOIDTYPE)z; break; } else { @@ -1471,8 +1471,8 @@ int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST // Send/Receive Array of Structures int udaXDRUserDefinedTypeDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, - USERDEFINEDTYPE* userdefinedtype, void** data, int protocolVersion, - LOGSTRUCTLIST* log_struct_list, int malloc_source) + USERDEFINEDTYPE* userdefinedtype, void** data, int protocolVersion, + LOGSTRUCTLIST* log_struct_list, int malloc_source) { int rc = 1; @@ -1483,7 +1483,7 @@ int udaXDRUserDefinedTypeDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDE NTREE* dataNTree = nullptr; rc = rc && udaXDRUserdefinedtype(xdrs, userdefinedtypelist, - userdefinedtype); // User Defined Type Definitions + userdefinedtype); // User Defined Type Definitions rc = rc && xdrUserDefinedDataPut(xdrs, logmalloclist, log_struct_list, userdefinedtypelist, userdefinedtype, data, 1, @@ -1494,12 +1494,12 @@ int udaXDRUserDefinedTypeDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDE if (userdefinedtype == nullptr) { udaAddError(UDA_CODE_ERROR_TYPE, "udaXDRUserDefinedTypeData", 999, - "No User Defined Type passed - cannot send!"); + "No User Defined Type passed - cannot send!"); return 0; } rc = udaXDRUserdefinedtype(xdrs, userdefinedtypelist, - userdefinedtype); // User Defined Type Definitions + userdefinedtype); // User Defined Type Definitions rc = rc && xdrUserDefinedDataPut(xdrs, logmalloclist, log_struct_list, userdefinedtypelist, userdefinedtype, data, 1, @@ -1575,14 +1575,14 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA int shape = data_block->data_n; // rank 1 array of dimension lengths auto udt = (USERDEFINEDTYPE*)data_block->opaque_block; // The data's structure definition USERDEFINEDTYPE* u = udaFindUserDefinedType(userdefinedtypelist, "SARRAY", - 0); // Locate the carrier structure definition + 0); // Locate the carrier structure definition if (udt == nullptr || u == nullptr) { err = 999; UDA_LOG(UDA_LOG_DEBUG, "nullptr SARRAY User defined data Structure Definition\n"); udaPrintUserDefinedTypeListTable(*userdefinedtypelist); udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, - "nullptr User defined data Structure Definition"); + "nullptr User defined data Structure Definition"); break; } @@ -1614,15 +1614,15 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA UDA_LOG(UDA_LOG_DEBUG, "Structure Definitions sent: rc = %d\n", rc); rc = rc && udaXDRUserDefinedTypeDataPut(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data, - protocolVersion, log_struct_list, - malloc_source); // send the Data + protocolVersion, log_struct_list, + malloc_source); // send the Data UDA_LOG(UDA_LOG_DEBUG, "Structured Data sent: rc = %d\n", rc); if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, - "Bad Return Code passing data structures"); + "Bad Return Code passing data structures"); break; } @@ -1648,7 +1648,7 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA if (option == 4) { err = 999; udaAddError(UDA_SYSTEM_ERROR_TYPE, "protocolXML2Put", err, - "Unknown package Type control option"); + "Unknown package Type control option"); break; } @@ -1673,15 +1673,15 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, - "Failure receiving Structure Definitions"); + "Failure receiving Structure Definitions"); break; } udaInitUserDefinedType(udt_received); rc = rc && udaXDRUserDefinedTypeDataPut(xdrs, logmalloclist, userdefinedtypelist, udt_received, - &data, protocolVersion, log_struct_list, - malloc_source); // receive the Data + &data, protocolVersion, log_struct_list, + malloc_source); // receive the Data // rc = rc && udaXDRUserDefinedTypeData(xdrs, udt_received, &data); // receive the Data UDA_LOG(UDA_LOG_DEBUG, "udaXDRUserDefinedTypeData received\n"); @@ -1689,7 +1689,7 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, - "Failure receiving Data and Structure Definition"); + "Failure receiving Data and Structure Definition"); break; } @@ -1700,8 +1700,7 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA auto s = (SARRAY*)data; if (s->count != data_block->data_n) { // check for consistency err = 999; - udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, - "Inconsistent S Array Counts"); + udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, "Inconsistent S Array Counts"); break; } @@ -1719,7 +1718,7 @@ int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMA } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML2Put", err, - "Name of Received Data Structure Incorrect"); + "Name of Received Data Structure Incorrect"); break; } } diff --git a/source/clientserver/readXDRFile.cpp b/source/clientserver/readXDRFile.cpp index fa97c2d8..33e4acb2 100644 --- a/source/clientserver/readXDRFile.cpp +++ b/source/clientserver/readXDRFile.cpp @@ -169,7 +169,7 @@ int receiveXDRFile(XDR* xdrs, const char* xdrfile) if (nchar > bufsize) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "receiveXDRFile", err, - "File block size inconsistent with buffer size"); + "File block size inconsistent with buffer size"); break; } diff --git a/source/clientserver/xdrlib.cpp b/source/clientserver/xdrlib.cpp index d78a9e94..329adb8c 100644 --- a/source/clientserver/xdrlib.cpp +++ b/source/clientserver/xdrlib.cpp @@ -446,12 +446,12 @@ bool_t xdr_serialise_object(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINED int shape = str->data_n; // rank 1 array of dimension lengths auto udt = (USERDEFINEDTYPE*)str->opaque_block; // The data's structure definition auto u = udaFindUserDefinedType(userdefinedtypelist, "SARRAY", - 0); // Locate the carrier structure definition + 0); // Locate the carrier structure definition if (udt == nullptr || u == nullptr) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolDataObject", err, - "nullptr User defined data Structure Definition"); + "nullptr User defined data Structure Definition"); return 0; } @@ -471,9 +471,9 @@ bool_t xdr_serialise_object(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINED // Send the data rc = rc && udaXDRUserdefinedtypelist(xdrs, userdefinedtypelist, - xdr_stdio_flag); // send the full set of known named structures + xdr_stdio_flag); // send the full set of known named structures rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data, protocolVersion, - xdr_stdio_flag, log_struct_list, malloc_source); // send the Data + xdr_stdio_flag, log_struct_list, malloc_source); // send the Data if (!rc) { err = 999; @@ -516,13 +516,13 @@ bool_t xdr_serialise_object(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINED udaInitUserDefinedType(udt_received); rc = rc && udaXDRUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data, - protocolVersion, xdr_stdio_flag, log_struct_list, - malloc_source); // receive the Data + protocolVersion, xdr_stdio_flag, log_struct_list, + malloc_source); // receive the Data if (!rc) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "protocolDataObject", err, - "Failure receiving Data and it's Structure Definition"); + "Failure receiving Data and it's Structure Definition"); return 0; } diff --git a/source/plugins/udaPlugin.cpp b/source/plugins/udaPlugin.cpp index 0e189376..c2717407 100644 --- a/source/plugins/udaPlugin.cpp +++ b/source/plugins/udaPlugin.cpp @@ -4,12 +4,12 @@ #include "server/serverSubsetData.h" #include "struct.h" -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "udaTypes.h" -#include #include #include +#include #include UDA_PLUGIN_INTERFACE* udaCreatePluginInterface(const char* request) diff --git a/source/security/authenticationUtils.cpp b/source/security/authenticationUtils.cpp index 52b73d8a..24b5f38f 100644 --- a/source/security/authenticationUtils.cpp +++ b/source/security/authenticationUtils.cpp @@ -17,14 +17,14 @@ int testFilePermissions(const char* object) udaAddError(UDA_SYSTEM_ERROR_TYPE, "testSecurityFilePermissions", errno, ""); } udaAddError(UDA_CODE_ERROR_TYPE, "clientAuthentication", err, - "Could not verify the user's private key directory's access permissions!"); + "Could not verify the user's private key directory's access permissions!"); return err; } if (buffer.st_mode & S_IRGRP || buffer.st_mode & S_IWGRP || buffer.st_mode & S_IXGRP || buffer.st_mode & S_IROTH || buffer.st_mode & S_IWOTH || buffer.st_mode & S_IXOTH) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "testSecurityFilePermissions", err, - "The user's private key directory is public: Your keys and certificate may be compromised!!!"); + "The user's private key directory is public: Your keys and certificate may be compromised!!!"); return err; } return 0; diff --git a/source/security/clientAuthentication.cpp b/source/security/clientAuthentication.cpp index a1d2e01f..3dd4024f 100644 --- a/source/security/clientAuthentication.cpp +++ b/source/security/clientAuthentication.cpp @@ -1,8 +1,8 @@ #include "clientAuthentication.h" -#include #include #include +#include #include #ifndef TESTIDAMSECURITY # include "include/client.h" @@ -187,7 +187,7 @@ static int initialiseKeys(CLIENT_BLOCK* client_block, gcry_sexp_t* publickey_out if (gcry_pk_testkey(privatekey) != 0) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "clientAuthentication", err, - "The User's Private Authentication Key is Invalid!"); + "The User's Private Authentication Key is Invalid!"); return err; } diff --git a/source/security/serverAuthentication.cpp b/source/security/serverAuthentication.cpp index 8cffb3a4..6d69c3d5 100644 --- a/source/security/serverAuthentication.cpp +++ b/source/security/serverAuthentication.cpp @@ -117,7 +117,7 @@ static int initialiseKeys(CLIENT_BLOCK* client_block, gcry_sexp_t* publickey_out if (gcry_pk_testkey(privatekey) != 0) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "idamServerAuthentication", err, - "The Server's Private Authentication Key is Invalid!"); + "The Server's Private Authentication Key is Invalid!"); break; } diff --git a/source/security/x509Utils.cpp b/source/security/x509Utils.cpp index 7777867a..905f36a3 100644 --- a/source/security/x509Utils.cpp +++ b/source/security/x509Utils.cpp @@ -2,8 +2,8 @@ #include -#include #include +#include #include "security.h" diff --git a/source/server/fatServer.cpp b/source/server/fatServer.cpp index c3b9c39f..5bf5634c 100644 --- a/source/server/fatServer.cpp +++ b/source/server/fatServer.cpp @@ -2,16 +2,16 @@ #include #include -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "struct.h" #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/source/server/initPluginList.cpp b/source/server/initPluginList.cpp index 761f5b04..3b298951 100644 --- a/source/server/initPluginList.cpp +++ b/source/server/initPluginList.cpp @@ -3,9 +3,9 @@ #include #include -#include #include #include +#include #include #include "getPluginAddress.h" diff --git a/source/server/serverGetData.cpp b/source/server/serverGetData.cpp index 3d2a7cd2..e493fc0e 100644 --- a/source/server/serverGetData.cpp +++ b/source/server/serverGetData.cpp @@ -7,14 +7,14 @@ # define strncasecmp _strnicmp #endif -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "struct.h" -#include #include #include #include #include +#include #include "applyXML.h" #include "getServerEnvironment.h" diff --git a/source/server/serverLegacyPlugin.cpp b/source/server/serverLegacyPlugin.cpp index 9c55d8a8..52680808 100644 --- a/source/server/serverLegacyPlugin.cpp +++ b/source/server/serverLegacyPlugin.cpp @@ -5,8 +5,8 @@ # include #endif -#include #include +#include #include #ifndef FATCLIENT @@ -68,7 +68,7 @@ int udaServerLegacyPlugin(REQUEST_DATA* request, DATA_SOURCE* data_source, SIGNA } else { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Unmatched count of Target and Substitute File Paths."); + "Unmatched count of Target and Substitute File Paths."); break; } } diff --git a/source/server/serverPlugin.cpp b/source/server/serverPlugin.cpp index 17039ff4..572a7838 100644 --- a/source/server/serverPlugin.cpp +++ b/source/server/serverPlugin.cpp @@ -19,11 +19,11 @@ #include "initStructs.h" #include "struct.h" #include -#include #include #include #include #include +#include #include #define REQUEST_READ_START 1000 diff --git a/source/server/serverSubsetData.cpp b/source/server/serverSubsetData.cpp index 6c0ae176..a75e9a55 100644 --- a/source/server/serverSubsetData.cpp +++ b/source/server/serverSubsetData.cpp @@ -27,9 +27,9 @@ #include "udaTypes.h" #include #include -#include #include #include +#include #include //---------------------------------------------------------------------------------------------------------------------------- diff --git a/source/server/sleepServer.cpp b/source/server/sleepServer.cpp index 52f19911..14899c5c 100644 --- a/source/server/sleepServer.cpp +++ b/source/server/sleepServer.cpp @@ -7,9 +7,9 @@ *--------------------------------------------------------------*/ #include "sleepServer.h" -#include #include #include +#include #include #include diff --git a/source/server/udaLegacyServer.cpp b/source/server/udaLegacyServer.cpp index 844d9b3a..dc7471df 100644 --- a/source/server/udaLegacyServer.cpp +++ b/source/server/udaLegacyServer.cpp @@ -8,13 +8,13 @@ #include "initStructs.h" #include "struct.h" #include "udaTypes.h" -#include #include #include #include #include -#include +#include #include +#include #include #include "closeServerSockets.h" @@ -249,8 +249,8 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL if (client_block.version < 6) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "PROXY redirection: Originating Client Version not compatible with the PROXY server " - "interface."); + "PROXY redirection: Originating Client Version not compatible with the PROXY server " + "interface."); break; } @@ -278,7 +278,7 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL (STRING_LENGTH - 1 - strlen(environment->server_proxy) - 4 + strlen(request_block.api_delim))) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "PROXY redirection: The source argument string is too long!"); + "PROXY redirection: The source argument string is too long!"); break; } @@ -332,7 +332,7 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL private_flags, malloc_source)) != 0) { UDA_LOG(UDA_LOG_DEBUG, "Problem Receiving putData Block List\n"); udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Protocol 1 Error (Receiving Client putDataBlockList)"); + "Protocol 1 Error (Receiving Client putDataBlockList)"); break; } @@ -420,8 +420,8 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL protocolVersionTypeTest(protocolVersion, data_block.error_type))) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "The Data has a type that cannot be passed to the Client: A newer client library version " - "is required."); + "The Data has a type that cannot be passed to the Client: A newer client library version " + "is required."); break; } @@ -433,8 +433,8 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL protocolVersionTypeTest(protocolVersion, dim.error_type)) { err = 999; udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "A Coordinate Data has a numerical type that cannot be passed to the Client: A " - "newer client library version is required."); + "A Coordinate Data has a numerical type that cannot be passed to the Client: A " + "newer client library version is required."); break; } } @@ -512,8 +512,7 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL if (next_protocol != UDA_PROTOCOL_DATA_SYSTEM) { err = 998; - udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Protocol 3 Error: Protocol Request Inconsistency"); + udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, "Protocol 3 Error: Protocol Request Inconsistency"); break; } @@ -668,7 +667,7 @@ int legacyServer(CLIENT_BLOCK client_block, const PLUGINLIST* pluginlist, LOGMAL &data_block, protocolVersion, &log_struct_list, &io_data, private_flags, malloc_source)) != 0) { udaAddError(UDA_CODE_ERROR_TYPE, __func__, err, - "Server Side Protocol Error (Opaque Structure Type)"); + "Server Side Protocol Error (Opaque Structure Type)"); break; } diff --git a/source/server/udaServer.cpp b/source/server/udaServer.cpp index 227d95fa..f735c4a8 100644 --- a/source/server/udaServer.cpp +++ b/source/server/udaServer.cpp @@ -12,13 +12,13 @@ #include "struct.h" #include "udaErrors.h" #include -#include #include #include #include #include -#include +#include #include +#include #include #include diff --git a/source/server2/get_data.cpp b/source/server2/get_data.cpp index 3162a960..ab30a5cc 100644 --- a/source/server2/get_data.cpp +++ b/source/server2/get_data.cpp @@ -1,11 +1,11 @@ #include "get_data.hpp" #include "apply_XML.hpp" -#include "include/errorLog.h" #include "clientserver/nameValueSubstitution.h" #include "clientserver/printStructs.h" #include "clientserver/stringUtils.h" -#include "initStructs.h" +#include "include/errorLog.h" #include "include/logging.h" +#include "initStructs.h" #include "make_server_request_block.hpp" #include "server_plugin.h" #include "server_subset_data.h" diff --git a/source/server2/server.cpp b/source/server2/server.cpp index b68e6424..8811adbe 100644 --- a/source/server2/server.cpp +++ b/source/server2/server.cpp @@ -4,13 +4,13 @@ #include #include -#include "include/errorLog.h" #include "clientserver/printStructs.h" #include "clientserver/protocol.h" #include "clientserver/xdrlib.h" +#include "include/errorLog.h" +#include "include/logging.h" #include "initStructs.h" #include "logging/accessLog.h" -#include "include/logging.h" #include "server_environment.hpp" #include "server_exceptions.h" #include "server_plugin.h" diff --git a/source/server2/server_plugin.cpp b/source/server2/server_plugin.cpp index 15203fcf..34183612 100644 --- a/source/server2/server_plugin.cpp +++ b/source/server2/server_plugin.cpp @@ -18,15 +18,15 @@ # define dup2 _dup2 #endif -#include "initStructs.h" #include "include/logging.h" +#include "initStructs.h" #include "struct.h" #include -#include #include #include #include #include +#include #define REQUEST_READ_START 1000 #define REQUEST_PLUGIN_MCOUNT 100 // Maximum initial number of plugins that can be registered diff --git a/source/server2/server_subset_data.cpp b/source/server2/server_subset_data.cpp index 87ebf19d..b99b5fa4 100644 --- a/source/server2/server_subset_data.cpp +++ b/source/server2/server_subset_data.cpp @@ -21,9 +21,9 @@ #include "struct.h" #include "udaTypes.h" #include -#include #include #include +#include #include //---------------------------------------------------------------------------------------------------------------------------- @@ -241,7 +241,7 @@ int uda::serverSubsetData(DATA_BLOCK* data_block, ACTION action, LOGMALLOCLIST* // Properties Must be identical for all structure array elements extract = *(char**)&data_block->data[jj * udt->size + udt->compoundfield[i].offset]; udaFindMalloc2(logmalloclist, (void*)extract, &count, &size, &type_name, &rank, - &shape); + &shape); if (jj > 0) { if (count != count_p || size != size_p || rank != rank_p || strcmp(type_name, type_name_p) != 0) { diff --git a/source/server2/xdr_protocol.cpp b/source/server2/xdr_protocol.cpp index 5edae423..f1ec510c 100644 --- a/source/server2/xdr_protocol.cpp +++ b/source/server2/xdr_protocol.cpp @@ -1,8 +1,8 @@ #include "xdr_protocol.hpp" -#include "include/errorLog.h" #include "clientserver/printStructs.h" #include "clientserver/protocol.h" #include "clientserver/xdrlib.h" +#include "include/errorLog.h" #include "struct.h" #include "udaErrors.h" #include "udaTypes.h" diff --git a/source/structures/accessors.cpp b/source/structures/accessors.cpp index e696fffe..7c42bb3e 100644 --- a/source/structures/accessors.cpp +++ b/source/structures/accessors.cpp @@ -126,7 +126,7 @@ The first name must be searched for down the tree from the root or starting node All subsequent names must be within child nodes unless the last name */ NTREE* udaFindNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - const char** lastname) + const char** lastname) { if (ntree == nullptr) { ntree = udaGetFullNTree(); @@ -136,7 +136,8 @@ NTREE* udaFindNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntre if ((strchr(target, '.') != nullptr) || strchr(target, '/') != nullptr) { int ntargets; - char** targetlist = udaParseTarget(target, &ntargets); // Deconstruct the Name and search for each hierarchy group + char** targetlist = + udaParseTarget(target, &ntargets); // Deconstruct the Name and search for each hierarchy group *lastname = targetlist[ntargets - 1]; // Preserve the last element name @@ -166,7 +167,7 @@ NTREE* udaFindNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntre } udaAddMalloc(logmalloclist, (void*)targetlist[ntargets - 1], (int)strlen(targetlist[ntargets - 1]) + 1, - sizeof(char), "char"); + sizeof(char), "char"); const char* last_target = targetlist[ntargets - 1]; @@ -254,7 +255,7 @@ NTREE* udaFindNTreeStructure2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const *lastname = targetlist[ntargets - 1]; // Preserve the last element name udaAddMalloc(logmalloclist, (void*)targetlist[ntargets - 1], (int)strlen(targetlist[ntargets - 1]) + 1, - sizeof(char), "char"); + sizeof(char), "char"); for (int i = 0; i < ntargets - 1; i++) { // Free all others free(targetlist[i]); @@ -570,7 +571,7 @@ int udaMaxCountVlenStructureArray(NTREE* tree, const char* target, int reset) * @return An integer returning an error code: 0 => OK. */ int udaRegulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* tree, USERDEFINEDTYPELIST* userdefinedtypelist, - const char* target, unsigned int count) + const char* target, unsigned int count) { if (tree == nullptr) { tree = udaGetFullNTree(); @@ -616,8 +617,8 @@ int udaRegulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* tree, USERD for (int i = 0; i < tree->branches; i++) { int rc; - if ((rc = udaRegulariseVlenStructures(logmalloclist, tree->children[i], userdefinedtypelist, target, - count)) != 0) { + if ((rc = udaRegulariseVlenStructures(logmalloclist, tree->children[i], userdefinedtypelist, target, count)) != + 0) { return rc; } } @@ -672,7 +673,7 @@ int udaRegulariseVlenData(LOGMALLOCLIST* logmalloclist, NTREE* tree, USERDEFINED count = udaMaxCountVlenStructureArray(tree, nt->userdefinedtype->name, 1); if (count > 0) { rc = udaRegulariseVlenStructures(logmalloclist, tree, userdefinedtypelist, nt->userdefinedtype->name, - count); + count); } if (rc != 0) { return rc; diff --git a/source/structures/parseIncludeFile.cpp b/source/structures/parseIncludeFile.cpp index 9bbb3c18..bdbb28b2 100644 --- a/source/structures/parseIncludeFile.cpp +++ b/source/structures/parseIncludeFile.cpp @@ -27,8 +27,8 @@ #include "udaDefines.h" #include "udaErrors.h" -#include #include +#include #include "struct.h" @@ -94,7 +94,7 @@ int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* heade err = 999; if (errno != 0) { udaAddError(UDA_SYSTEM_ERROR_TYPE, "parseIncludeFile", errno, - "Unable to Open Structure Definition Header file for Read Access!"); + "Unable to Open Structure Definition Header file for Read Access!"); } if (fh != nullptr) { fclose(fh); @@ -247,7 +247,7 @@ int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* heade name2[0] = '\0'; } else { udaAddError(UDA_CODE_ERROR_TYPE, "parseIncludeFile", 999, - "typedef statement does not conform to syntax model!"); + "typedef statement does not conform to syntax model!"); } buffer[0] = '\0'; break; @@ -278,7 +278,7 @@ int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* heade name2[0] = '\0'; } else { udaAddError(UDA_CODE_ERROR_TYPE, "parseIncludeFile", 999, - "typedef statement does not conform to syntax model!"); + "typedef statement does not conform to syntax model!"); } buffer[0] = '\0'; break; @@ -442,7 +442,7 @@ int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* heade // fprintf(stdout,"Names do Not Match: %s, %s, %s\n", name, name1, name2); err = 999; udaAddError(UDA_CODE_ERROR_TYPE, "parseIncludeFile", 999, - "typedef statement does not conform to syntax model!"); + "typedef statement does not conform to syntax model!"); return err; } @@ -677,7 +677,8 @@ int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* heade } else { if (itemCount > 0) { space = size[itemCount - 1] * count[itemCount - 1]; - offpad[itemCount] = udaPadding(offset[itemCount - 1] + space, type[itemCount]); + offpad[itemCount] = + udaPadding(offset[itemCount - 1] + space, type[itemCount]); offset[itemCount] = udaNewoffset(offset[itemCount - 1] + space, type[itemCount]); } else { diff --git a/source/structures/struct.cpp b/source/structures/struct.cpp index 50c934fa..e9ee238a 100644 --- a/source/structures/struct.cpp +++ b/source/structures/struct.cpp @@ -52,9 +52,9 @@ #endif #include "udaErrors.h" -#include #include #include +#include #include #include "accessors.h" @@ -208,7 +208,8 @@ void udaAddImage(char** image, int* imagecount, const char* line) * @param expand A pre-allocated array of char to be used to receive the expanded buffer string. * @return expand An expanded Image line. */ -void udaExpandImage(char* buffer, char defnames[MAXELEMENTS][MAXELEMENTNAME], int* defvalues, int defCount, char* expand) +void udaExpandImage(char* buffer, char defnames[MAXELEMENTS][MAXELEMENTNAME], int* defvalues, int defCount, + char* expand) { // Insert values with #define names int len, lstr; @@ -625,7 +626,7 @@ void udaAddNonMalloc(LOGMALLOCLIST* logmalloclist, void* stack, int count, size_ * @return void. */ void udaAddNonMalloc2(LOGMALLOCLIST* logmalloclist, void* stack, int count, size_t size, const char* type, int rank, - int* shape) + int* shape) { // Put a non malloc'd memory location on the malloc log flagging it as freed @@ -699,7 +700,7 @@ void udaAddMalloc(LOGMALLOCLIST* logmalloclist, void* heap, int count, size_t si * @return void. */ void udaAddMalloc2(LOGMALLOCLIST* logmalloclist, void* heap, int count, size_t size, const char* type, int rank, - int* shape) + int* shape) { // Log all Heap allocations for Data from User Defined Structures // Grow the list when necessary @@ -956,7 +957,7 @@ void udaFindMalloc(LOGMALLOCLIST* logmalloclist, void* heap, int* count, int* si * @return void. */ void udaFindMalloc2(LOGMALLOCLIST* logmalloclist, void* heap, int* count, int* size, const char** type, int* rank, - int** shape) + int** shape) { // Find a specific Heap allocation for Data within User Defined Structures @@ -1334,7 +1335,7 @@ void udaGetInitialUserDefinedTypeList(USERDEFINEDTYPELIST** anew) udaInitCompoundField(&field); udaDefineField(&field, "enumarray", "Data with this enumerated type", &offset, - ARRAYULONG64); // Data need to be converted to this type + ARRAYULONG64); // Data need to be converted to this type udaAddCompoundField(&usertype, field); udaInitCompoundField(&field); udaDefineField(&field, "enumarray_rank", "The rank of arraydata", &offset, SCALARINT); @@ -1401,7 +1402,7 @@ void udaUpdateUserDefinedType(USERDEFINEDTYPELIST* str, int typeId, USERDEFINEDT * @return void. */ void udaChangeUserDefinedTypeElementProperty(USERDEFINEDTYPELIST* str, int typeId, char* element, char* property, - void* value) + void* value) { USERDEFINEDTYPE* userdefinedtype = str->userdefinedtype; // Target this definition for (int i = 0; i < userdefinedtype[typeId].fieldcount; i++) { @@ -2085,8 +2086,8 @@ int udaXDRAtomicData(LOGMALLOCLIST* logmalloclist, XDR* xdrs, const char* type, // Send/Receive Array of Structures int udaXDRUserDefinedTypeData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, - USERDEFINEDTYPE* userdefinedtype, void** data, int protocolVersion, bool xdr_stdio_flag, - LOGSTRUCTLIST* log_struct_list, int malloc_source) + USERDEFINEDTYPE* userdefinedtype, void** data, int protocolVersion, bool xdr_stdio_flag, + LOGSTRUCTLIST* log_struct_list, int malloc_source) { int rc; @@ -2112,7 +2113,7 @@ int udaXDRUserDefinedTypeData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFIN if (userdefinedtype == nullptr) { udaAddError(UDA_CODE_ERROR_TYPE, "udaXDRUserDefinedTypeData", 999, - "No User Defined Type passed - cannot send!"); + "No User Defined Type passed - cannot send!"); return 0; } @@ -2603,7 +2604,7 @@ void udaPrintAtomicType(LOGMALLOCLIST* logmalloclist, NTREE* tree, const char* t } else { data = (void*)&p[userdefinedtype->compoundfield[i].offset]; udaPrintAtomicData(data, userdefinedtype->compoundfield[i].atomictype, - userdefinedtype->compoundfield[i].count, target); + userdefinedtype->compoundfield[i].count, target); } } else { UDA_LOG(UDA_LOG_ERROR, "ERROR: %s is Not of Atomic Type\n", target); @@ -2859,7 +2860,7 @@ void* udaGetNodeStructureArrayData(LOGMALLOCLIST* logmalloclist, NTREE* ntree, i } if (udaGetNodeStructureDataCount(logmalloclist, ntree) < (index + 1)) { udaAddError(UDA_CODE_ERROR_TYPE, "udaGetNodeStructureArrayData", 999, - "The Tree Node array index > allocated array dimension"); + "The Tree Node array index > allocated array dimension"); return nullptr; } p = (char*)ntree->data; @@ -2875,7 +2876,7 @@ void* udaGetNodeStructureArrayData(LOGMALLOCLIST* logmalloclist, NTREE* ntree, i * @return a Pointer to a Component Structure Array element. */ void* udaGetNodeStructureComponentArrayData(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - int structureindex, int componentindex) + int structureindex, int componentindex) { int offset, count, size; char* p; @@ -2883,11 +2884,11 @@ void* udaGetNodeStructureComponentArrayData(LOGMALLOCLIST* logmalloclist, NTREE* const char* type; if (structureindex < 0) { udaAddError(UDA_CODE_ERROR_TYPE, "udaGetNodeStructureComponentArrayData", 999, - "The Tree Node Structure array index < 0"); + "The Tree Node Structure array index < 0"); } if (componentindex < 0) { udaAddError(UDA_CODE_ERROR_TYPE, "udaGetNodeStructureComponentArrayData", 999, - "The Tree Node Structure Component array index < 0"); + "The Tree Node Structure Component array index < 0"); return nullptr; } if (ntree == nullptr) { @@ -2914,14 +2915,14 @@ void* udaGetNodeStructureComponentArrayData(LOGMALLOCLIST* logmalloclist, NTREE* } if (count <= componentindex) { udaAddError(UDA_CODE_ERROR_TYPE, "udaGetNodeStructureComponentArrayData", 999, - "The Tree Node Structure Component array index > allocated array dimension"); + "The Tree Node Structure Component array index > allocated array dimension"); return nullptr; } return (void*)&p[componentindex * size]; } } udaAddError(UDA_CODE_ERROR_TYPE, "udaGetNodeStructureComponentArrayData", 999, - "The named Tree Node Structure Component array is not a member of the Data structure"); + "The named Tree Node Structure Component array is not a member of the Data structure"); return nullptr; } @@ -3256,7 +3257,7 @@ int* udaGetNodeStructureRank(LOGMALLOCLIST* logmalloclist, NTREE* ntree) return nullptr; } udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count0, &size, - &type, &rank, &shape); + &type, &rank, &shape); ranks[count] = rank; } count++; @@ -3295,7 +3296,7 @@ int* udaGetNodeAtomicRank(LOGMALLOCLIST* logmalloclist, NTREE* ntree) return nullptr; } udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count0, &size, - &type, &rank, &shape); + &type, &rank, &shape); ranks[count] = rank; } count++; @@ -3334,7 +3335,7 @@ int** udaGetNodeStructureShape(LOGMALLOCLIST* logmalloclist, NTREE* ntree) return nullptr; } udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count0, &size, - &type, &rank, &shape); + &type, &rank, &shape); shapes[count] = shape; } count++; @@ -3553,7 +3554,8 @@ int udaGetNodeStructureComponentDataCount(LOGMALLOCLIST* logmalloclist, NTREE* n if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return 0; } @@ -3599,7 +3601,8 @@ int udaGetNodeStructureComponentDataRank(LOGMALLOCLIST* logmalloclist, NTREE* nt if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return 0; } @@ -3611,8 +3614,8 @@ int udaGetNodeStructureComponentDataRank(LOGMALLOCLIST* logmalloclist, NTREE* nt if ((data = (char*)ntree->data) == nullptr) { return 0; } - udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count, &size, &type, - &rank, &shape); + udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count, &size, + &type, &rank, &shape); if (count == 0) { rank = 0; } @@ -3642,7 +3645,8 @@ int* udaGetNodeStructureComponentDataShape(LOGMALLOCLIST* logmalloclist, NTREE* if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return nullptr; } @@ -3654,8 +3658,8 @@ int* udaGetNodeStructureComponentDataShape(LOGMALLOCLIST* logmalloclist, NTREE* if ((data = (char*)ntree->data) == nullptr) { return 0; } - udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count, &size, &type, - &rank, &shape); + udaFindMalloc2(logmalloclist, &data[ntree->userdefinedtype->compoundfield[i].offset], &count, &size, + &type, &rank, &shape); if (count == 0) { shape = nullptr; } @@ -3683,7 +3687,8 @@ int udaGetNodeStructureComponentDataIsPointer(LOGMALLOCLIST* logmalloclist, NTRE if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return 0; } @@ -3714,7 +3719,8 @@ int udaGetNodeStructureComponentDataSize(LOGMALLOCLIST* logmalloclist, NTREE* nt if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return 0; } @@ -3753,7 +3759,8 @@ const char* udaGetNodeStructureComponentDataDataType(LOGMALLOCLIST* logmalloclis if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return "unknown"; } @@ -3792,7 +3799,8 @@ void* udaGetNodeStructureComponentData(LOGMALLOCLIST* logmalloclist, NTREE* ntre if (ntree == nullptr) { ntree = udaGetFullNTree(); } - ntree = udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name + ntree = + udaFindNTreeStructureComponent2(logmalloclist, ntree, target, &lastname); // Identify node and component name if (ntree == nullptr) { return nullptr; } @@ -3830,7 +3838,7 @@ void* udaGetNodeStructureComponentData(LOGMALLOCLIST* logmalloclist, NTREE* ntre * @return void. */ void udaPrintNodeStructureComponentData(NTREE* ntree, LOGMALLOCLIST* logmalloclist, - USERDEFINEDTYPELIST* userdefinedtypelist, const char* target) + USERDEFINEDTYPELIST* userdefinedtypelist, const char* target) { NTREE* node; USERDEFINEDTYPE* userdefinedtype; @@ -3902,7 +3910,7 @@ void udaPrintNodeStructureComponentData(NTREE* ntree, LOGMALLOCLIST* logmallocli } if (userdefinedtype->compoundfield[i].atomictype != UDA_TYPE_UNKNOWN) { udaPrintAtomicData(data, userdefinedtype->compoundfield[i].atomictype, - userdefinedtype->compoundfield[i].count, lastname); + userdefinedtype->compoundfield[i].count, lastname); } else { temp.data = data; @@ -3913,7 +3921,7 @@ void udaPrintNodeStructureComponentData(NTREE* ntree, LOGMALLOCLIST* logmallocli firstpass = 0; } else { udaChangeNonMalloc(logmalloclist, olddata, data, 1, userdefinedtype->compoundfield[i].size, - type); + type); } olddata = data; @@ -3977,7 +3985,8 @@ void udaPrintNodeStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntree) } } if (node == nullptr) { - udaAddError(UDA_CODE_ERROR_TYPE, "udaPrintNodeStructure", 999, "Structure Array element Node not Found!"); + udaAddError(UDA_CODE_ERROR_TYPE, "udaPrintNodeStructure", 999, + "Structure Array element Node not Found!"); return; } } @@ -4521,7 +4530,8 @@ void udaPrintAtomicType_stdout(LOGMALLOCLIST* logmalloclist, NTREE* tree, const udaPrintAtomicType(logmalloclist, tree, target); } -void udaGetNodeStructureComponentDataShape_f(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, int* shape_f) +void udaGetNodeStructureComponentDataShape_f(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, + int* shape_f) { int rank = udaGetNodeStructureComponentDataRank(logmalloclist, ntree, target); for (int i = 0; i < MAXRANK; i++) { @@ -4638,7 +4648,7 @@ short* udaCastNodeStructureComponentDatatoShort(LOGMALLOCLIST* logmalloclist, NT } void udaCastNodeStructureComponentDatatoShort_f(LOGMALLOCLIST* logmalloclist, NTREE* node, const char* target, - short* data_f) + short* data_f) { short* data = udaCastNodeStructureComponentDatatoShort(logmalloclist, node, target); if (data != nullptr) { @@ -4651,7 +4661,7 @@ void udaCastNodeStructureComponentDatatoShort_f(LOGMALLOCLIST* logmalloclist, NT } void udaCastNodeStructureComponentDatatoFloat_f(LOGMALLOCLIST* logmalloclist, NTREE* node, const char* target, - float* data_f) + float* data_f) { float* data = udaCastNodeStructureComponentDatatoFloat(logmalloclist, node, target); if (data != nullptr) { @@ -4664,7 +4674,7 @@ void udaCastNodeStructureComponentDatatoFloat_f(LOGMALLOCLIST* logmalloclist, NT } void udaAddStructureField(USERDEFINEDTYPE* user_type, const char* name, const char* desc, UDA_TYPE data_type, - bool is_pointer, int rank, int* shape, size_t offset) + bool is_pointer, int rank, int* shape, size_t offset) { COMPOUNDFIELD field; udaInitCompoundField(&field); diff --git a/source/structures/xdrUserDefinedData.cpp b/source/structures/xdrUserDefinedData.cpp index bdcfb2a2..b3093b2c 100644 --- a/source/structures/xdrUserDefinedData.cpp +++ b/source/structures/xdrUserDefinedData.cpp @@ -3,10 +3,10 @@ #include #include "udaErrors.h" -#include #include #include #include +#include #include #include "struct.h" @@ -82,7 +82,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l *data = malloc(datacount * userdefinedtype->size); if (structRank > 1 && structShape != nullptr) { udaAddMalloc2(logmalloclist, *data, datacount, userdefinedtype->size, userdefinedtype->name, structRank, - structShape); + structShape); } else { udaAddMalloc(logmalloclist, *data, datacount, userdefinedtype->size, userdefinedtype->name); } @@ -198,7 +198,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if (rcount != 0) { // there should be no remainder udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -209,7 +209,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Type Float Data Heap Allocation not found in log!"); + "Type Float Data Heap Allocation not found in log!"); break; } @@ -281,7 +281,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -292,7 +292,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Type Double Data Heap Allocation not found in log!"); + "Type Double Data Heap Allocation not found in log!"); break; } @@ -345,7 +345,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -364,7 +364,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified short malloc total size not integer multiple!"); + "Specified short malloc total size not integer multiple!"); count = 0; } } @@ -375,7 +375,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Short Data Heap Allocation not found in log!"); + "Short Data Heap Allocation not found in log!"); break; } @@ -415,7 +415,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l } d = (char*)malloc(count * sizeof(unsigned char)); udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned char), "unsigned char", rank, - shape); + shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -428,7 +428,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -447,7 +447,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified unsigned char malloc total size not integer multiple!"); + "Specified unsigned char malloc total size not integer multiple!"); count = 0; } } @@ -458,7 +458,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Char Data Heap Allocation not found in log!"); + "Unsigned Char Data Heap Allocation not found in log!"); break; } @@ -497,8 +497,8 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l shape = nullptr; } d = (char*)malloc(count * sizeof(unsigned short)); - udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned short), "unsigned short", rank, - shape); + udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned short), "unsigned short", + rank, shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -511,7 +511,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -529,9 +529,8 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l size = sizeof(unsigned short); count = totalsize / size; if (rcount != 0) { - udaAddError( - UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified unsigned short malloc total size not integer multiple!"); + udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, + "Specified unsigned short malloc total size not integer multiple!"); count = 0; } } @@ -542,7 +541,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Short Data Heap Allocation not found in log!"); + "Unsigned Short Data Heap Allocation not found in log!"); break; } @@ -594,7 +593,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -613,7 +612,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -624,7 +623,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Integer Data Heap Allocation not found in log!"); + "Integer Data Heap Allocation not found in log!"); break; } @@ -664,7 +663,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l } d = (char*)malloc(count * sizeof(unsigned int)); udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned int), "unsigned int", rank, - shape); + shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -677,7 +676,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -696,7 +695,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -706,7 +705,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Integer Data Heap Allocation not found in log!"); + "Unsigned Integer Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -757,7 +756,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -777,7 +776,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -787,7 +786,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Long Long Data Heap Allocation not found in log!"); + "Long Long Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -826,8 +825,8 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l shape = nullptr; } d = (char*)malloc(count * sizeof(unsigned long long)); - udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned long long), "unsigned long long", - rank, shape); + udaAddMalloc2(logmalloclist, (void*)d, count, sizeof(unsigned long long), + "unsigned long long", rank, shape); *p = (VOIDTYPE)d; // Save pointer: data will be written here } else { break; @@ -840,7 +839,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc2(logmalloclist, (void*)p, &count, &size, &type, &rank, - &shape); // Assume count of 0 means No Pointer data to send! + &shape); // Assume count of 0 means No Pointer data to send! if (type != nullptr && STR_EQUALS(type, "unknown")) { if (malloc_source == UDA_MALLOC_SOURCE_SOAP && j > 0 && @@ -860,7 +859,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -870,7 +869,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Unsigned Long Long Data Heap Allocation not found in log!"); + "Unsigned Long Long Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -944,7 +943,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l count = totalsize / size; if (rcount != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -972,7 +971,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Char Data Heap Allocation not found in log!"); + "Char Data Heap Allocation not found in log!"); break; } rc = rc && xdr_int(xdrs, &rank); // Send Shape of arrays @@ -1045,7 +1044,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l } udaFindMalloc(logmalloclist, (void*)p, &count, &size, - &type); // Assume 0 means No Pointer data to send! + &type); // Assume 0 means No Pointer data to send! if (malloc_source == UDA_MALLOC_SOURCE_DOM && (count == 0 || size == 0) && d != nullptr) { int lstr = (int)strlen(d); @@ -1070,7 +1069,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "String Data Heap Allocation not found in log!"); + "String Data Heap Allocation not found in log!"); break; } } @@ -1185,7 +1184,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l } udaFindMalloc2(logmalloclist, (void*)p, &nstr, &size, &type, &rank, - &shape); // Assume 0 means No Pointer data to send! + &shape); // Assume 0 means No Pointer data to send! // or heap allocated in external library! // Is this a fixed length array of strings ? @@ -1202,7 +1201,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((nstr == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "String Array Data Heap Allocation not found in log!"); + "String Array Data Heap Allocation not found in log!"); break; } @@ -1288,7 +1287,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l break; } udaFindMalloc(logmalloclist, (void*)p, &count, &size, - &type); // Assume 0 means No string to send! + &type); // Assume 0 means No string to send! if (count == 1 && STR_EQUALS(type, "unknown")) { // ***** Fix for SOAP sources incomplete! count = size; size = sizeof(char); @@ -1296,7 +1295,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l rc = rc && xdr_int(xdrs, &count); if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "String Data Heap Allocation not found in log!"); + "String Data Heap Allocation not found in log!"); break; } } @@ -1343,7 +1342,8 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l ssize = sizeof(char); // Assume xml void pointer type is to char type = chartype; } else { - ssize = udaGetsizeof(userdefinedtypelist, userdefinedtype->compoundfield[j].type); + ssize = + udaGetsizeof(userdefinedtypelist, userdefinedtype->compoundfield[j].type); type = userdefinedtype->compoundfield[j].type; } @@ -1354,7 +1354,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if (rcount != 0) {} } else { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Specified malloc total size not integer multiple!"); + "Specified malloc total size not integer multiple!"); count = 0; } } @@ -1363,7 +1363,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if ((count == 0 || size == 0) && *p != 0) { udaAddError(UDA_CODE_ERROR_TYPE, "xdrUserDefinedData", 999, - "Data Heap Allocation not found in log!"); + "Data Heap Allocation not found in log!"); break; } } @@ -1407,7 +1407,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l // Size and Type also known. Type cannot be 'void'. udaAddNonMalloc(logmalloclist, (void*)p, userdefinedtype->compoundfield[j].count, - userdefinedtype->compoundfield[j].size, userdefinedtype->compoundfield[j].type); + userdefinedtype->compoundfield[j].size, userdefinedtype->compoundfield[j].type); loopcount = userdefinedtype->compoundfield[j].count; count = 0; @@ -1479,8 +1479,8 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if (newNTree->children == nullptr && newNTree->branches == 0) { newNTree->children = (NTREE**)malloc(loopcount * sizeof(NTREE*)); // Allocate the node array - udaAddMalloc(logmalloclist, (void*)newNTree->children, loopcount, sizeof(NTREE*), - "NTREE *"); + udaAddMalloc(logmalloclist, (void*)newNTree->children, loopcount, + sizeof(NTREE*), "NTREE *"); } else { // Multiple branches (user types) originating in the same node auto old = (VOIDTYPE)newNTree->children; newNTree->children = (NTREE**)realloc( @@ -1488,7 +1488,7 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l (newNTree->branches + loopcount) * sizeof(NTREE*)); // Individual node addresses remain valid udaChangeMalloc(logmalloclist, old, (void*)newNTree->children, - newNTree->branches + loopcount, sizeof(NTREE*), "NTREE *"); + newNTree->branches + loopcount, sizeof(NTREE*), "NTREE *"); } } udaAddNTree(newNTree, subNTree); // Only first call creates new tree node @@ -1505,7 +1505,8 @@ int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* l if (udaGettypeof(type) != UDA_TYPE_UNKNOWN) { char* z = (char*)*p; - rc = rc && udaXDRAtomicData(logmalloclist, xdrs, type, count, size, &z); // Must be an Atomic Type + rc = rc && + udaXDRAtomicData(logmalloclist, xdrs, type, count, size, &z); // Must be an Atomic Type *p = (VOIDTYPE)z; break; } else {