Skip to content

Commit

Permalink
Removing C style typedef of more internal structures.
Browse files Browse the repository at this point in the history
  • Loading branch information
jholloc committed Feb 14, 2024
1 parent f89d86e commit 3392b36
Show file tree
Hide file tree
Showing 59 changed files with 1,887 additions and 1,814 deletions.
22 changes: 11 additions & 11 deletions source/c_api/accAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ using namespace uda::client_server;
using namespace uda::client;
using namespace uda::logging;

USERDEFINEDTYPE* udaGetUserDefinedType(int handle);
USERDEFINEDTYPELIST* udaGetUserDefinedTypeList(int handle);
USERDEFINEDTYPE * udaGetUserDefinedType(int handle);
USERDEFINEDTYPELIST * udaGetUserDefinedTypeList(int handle);
LOGMALLOCLIST* udaGetLogMallocList(int handle);

//---------------------------- Mutex locking for thread safety -------------------------
Expand Down Expand Up @@ -3461,7 +3461,7 @@ int udaGetDimDataCheckSum(int handle, int ndim)
// Access to (De)Serialiser

void udaGetClientSerialisedDataBlock(int handle, void** object, size_t* objectSize, char** key, size_t* keySize,
int protocolVersion, LOGSTRUCTLIST* log_struct_list, int private_flags,
int protocolVersion, LogStructList* log_struct_list, int private_flags,
int malloc_source)
{
// Extract the serialised Data Block from Cache or serialise it if not cached (hash key in Data Block, empty if not
Expand All @@ -3487,8 +3487,8 @@ void udaGetClientSerialisedDataBlock(int handle, void** object, size_t* objectSi

int token;

USERDEFINEDTYPELIST* userdefinedtypelist = udaGetUserDefinedTypeList(handle);
LOGMALLOCLIST* logmalloclist = udaGetLogMallocList(handle);
auto userdefinedtypelist = static_cast<UserDefinedTypeList*>(udaGetUserDefinedTypeList(handle));
auto logmalloclist = static_cast<LogMallocList*>(udaGetLogMallocList(handle));
DataBlockList data_block_list;
data_block_list.count = 1;
data_block_list.data = getDataBlock(handle);
Expand Down Expand Up @@ -3532,9 +3532,9 @@ int udaSetDataTree(int handle)

udaSetFullNTree((NTREE*)udaGetData(handle));
void* opaque_block = udaGetDataOpaqueBlock(handle);
setUserDefinedTypeList(((GENERAL_BLOCK*)opaque_block)->userdefinedtypelist);
setLogMallocList(((GENERAL_BLOCK*)opaque_block)->logmalloclist);
udaSetLastMallocIndexValue(&(((GENERAL_BLOCK*)opaque_block)->lastMallocIndex));
setUserDefinedTypeList(((GeneralBlock*)opaque_block)->userdefinedtypelist);
setLogMallocList(((GeneralBlock*)opaque_block)->logmalloclist);
udaSetLastMallocIndexValue(&(((GeneralBlock*)opaque_block)->lastMallocIndex));
return 1; // Return TRUE
}

Expand Down Expand Up @@ -3577,7 +3577,7 @@ USERDEFINEDTYPE* udaGetUserDefinedType(int handle)
return nullptr;
}
void* opaque_block = udaGetDataOpaqueBlock(handle);
return ((GENERAL_BLOCK*)opaque_block)->userdefinedtype;
return ((GeneralBlock*)opaque_block)->userdefinedtype;
}

USERDEFINEDTYPELIST* udaGetUserDefinedTypeList(int handle)
Expand All @@ -3586,7 +3586,7 @@ USERDEFINEDTYPELIST* udaGetUserDefinedTypeList(int handle)
return nullptr;
}
void* opaque_block = udaGetDataOpaqueBlock(handle);
return ((GENERAL_BLOCK*)opaque_block)->userdefinedtypelist;
return ((GeneralBlock*)opaque_block)->userdefinedtypelist;
}

LOGMALLOCLIST* udaGetLogMallocList(int handle)
Expand All @@ -3595,7 +3595,7 @@ LOGMALLOCLIST* udaGetLogMallocList(int handle)
return nullptr;
}
void* opaque_block = udaGetDataOpaqueBlock(handle);
return ((GENERAL_BLOCK*)opaque_block)->logmalloclist;
return ((GeneralBlock*)opaque_block)->logmalloclist;
}

NTREE* udaFindIdamNTreeStructureDefinition(NTREE* node, const char* target)
Expand Down
8 changes: 4 additions & 4 deletions source/c_api/udaPutAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ int udaPutListAPI(const char* putInstruction, PUTDATA_BLOCK_LIST* inPutDataBlock

/* #ifndef FATCLIENT */
/* if (!udaGetAPICalledOnce) { */
/* LOGMALLOCLIST* oldlogmalloclist = logmalloclist; */
/* USERDEFINEDTYPELIST* olduserdefinedtypelist = userdefinedtypelist; */
/* LogMallocList* oldlogmalloclist = logmalloclist; */
/* UserDefinedTypeList* olduserdefinedtypelist = userdefinedtypelist; */
/* logmalloclist = nullptr; */
/* userdefinedtypelist = nullptr; */
/* int h = udaGetAPI("help::ping()", ""); */
Expand Down Expand Up @@ -139,8 +139,8 @@ int udaPutAPI(const char* putInstruction, PUTDATA_BLOCK* inPutData)
/* #ifndef FATCLIENT */
/* if (!udaGetAPICalledOnce) { */
/* UDA_LOG(LOG_DEBUG, "!udaGetAPICalledOnce\n"); */
/* LOGMALLOCLIST* oldlogmalloclist = logmalloclist; */
/* USERDEFINEDTYPELIST* olduserdefinedtypelist = userdefinedtypelist; */
/* LogMallocList* oldlogmalloclist = logmalloclist; */
/* UserDefinedTypeList* olduserdefinedtypelist = userdefinedtypelist; */
/* logmalloclist = nullptr; */
/* userdefinedtypelist = nullptr; */
/* int h = udaGetAPI("help::ping()", ""); */
Expand Down
8 changes: 4 additions & 4 deletions source/cache/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

using namespace uda::client_server;

void writeCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
const DataBlock* data_block, int protocolVersion, LOGSTRUCTLIST* log_struct_list,
void writeCacheData(FILE* fp, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
const DataBlock* data_block, int protocolVersion, LogStructList* log_struct_list,
unsigned int private_flags, int malloc_source)
{
XDR xdrs;
Expand All @@ -23,8 +23,8 @@ void writeCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST*
xdr_destroy(&xdrs); // Destroy before the file otherwise a segmentation error occurs
}

DataBlock* readCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags,
DataBlock* readCacheData(FILE* fp, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
int protocolVersion, LogStructList* log_struct_list, unsigned int private_flags,
int malloc_source)
{
XDR xdrs;
Expand Down
10 changes: 5 additions & 5 deletions source/cache/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "structures/genStructs.h"
#include <cstdio>

void writeCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
void writeCacheData(FILE* fp, LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
const uda::client_server::DataBlock* data_block, int protocolVersion,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source);
LogStructList* log_struct_list, unsigned int private_flags, int malloc_source);

uda::client_server::DataBlock* readCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags,
uda::client_server::DataBlock* readCacheData(FILE* fp, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, int protocolVersion,
LogStructList* log_struct_list, unsigned int private_flags,
int malloc_source);

#endif // UDA_CACHE_CACHE_H
20 changes: 10 additions & 10 deletions source/cache/fileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ char source[]
#include "fileCache.h"

#ifdef _WIN32
DataBlock* udaFileCacheRead(const RequestData* request, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source)
DataBlock* udaFileCacheRead(const RequestData* request, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, int protocolVersion,
LogStructList* log_struct_list, unsigned int private_flags, int malloc_source)
{
return nullptr;
}

int udaFileCacheWrite(const DataBlock* data_block, const RequestBlock* request_block, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list,
int udaFileCacheWrite(const DataBlock* data_block, const RequestBlock* request_block, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, int protocolVersion, LogStructList* log_struct_list,
unsigned int private_flags, int malloc_source)
{
return 0;
Expand Down Expand Up @@ -373,9 +373,9 @@ boost::optional<CacheStats> purge_cache(FILE* db)
return stats;
}

DataBlock* udaFileCacheRead(const RequestData* request, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source)
DataBlock* udaFileCacheRead(const RequestData* request, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, int protocolVersion,
LogStructList* log_struct_list, unsigned int private_flags, int malloc_source)
{
auto maybe_entry = find_cache_entry(request);
if (!maybe_entry) {
Expand Down Expand Up @@ -603,8 +603,8 @@ std::string generate_cache_filename(const RequestData* request)
return std::string{"uda_"} + std::to_string(key) + ".cache";
}

int udaFileCacheWrite(const DataBlock* data_block, const RequestBlock* request_block, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list,
int udaFileCacheWrite(const DataBlock* data_block, const RequestBlock* request_block, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, int protocolVersion, LogStructList* log_struct_list,
unsigned int private_flags, int malloc_source)
{
RequestData* request = &request_block->requests[0];
Expand Down
8 changes: 4 additions & 4 deletions source/cache/fileCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "structures/genStructs.h"

uda::client_server::DataBlock* udaFileCacheRead(const uda::client_server::RequestData* request,
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
int protocolVersion, LOGSTRUCTLIST* log_struct_list,
LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
int protocolVersion, LogStructList* log_struct_list,
unsigned int private_flags, int malloc_source);

int udaFileCacheWrite(const uda::client_server::DataBlock* data_block,
const uda::client_server::RequestBlock* request_block, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list,
const uda::client_server::RequestBlock* request_block, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, int protocolVersion, LogStructList* log_struct_list,
unsigned int private_flags, int malloc_source);

#endif // UDA_CACHE_FILECACHE_H
18 changes: 9 additions & 9 deletions source/cache/memcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ uda::cache::UdaCache* uda::cache::open_cache()
void uda::cache::free_cache() {}

int uda::cache::cache_write(uda::cache::UdaCache* cache, const uda::client_server::RequestData* request_data,
uda::client_server::DataBlock* data_block, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, uda::client_server::Environment environment,
int protocolVersion, uint32_t flags, LOGSTRUCTLIST* log_struct_list,
uda::client_server::DataBlock* data_block, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, uda::client_server::Environment environment,
int protocolVersion, uint32_t flags, LogStructList* log_struct_list,
unsigned int private_flags, int malloc_source)
{
return 0;
}

uda::client_server::DataBlock*
uda::cache::cache_read(uda::cache::UdaCache* cache, const uda::client_server::RequestData* request_data,
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
uda::client_server::Environment environment, int protocolVersion, uint32_t flags,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source)
LogStructList* log_struct_list, unsigned int private_flags, int malloc_source)
{
return nullptr;
}
Expand Down Expand Up @@ -246,9 +246,9 @@ void uda::cache::free_cache() // Will be called by the udaFreeAll function
}

int uda::cache::cache_write(uda::cache::UdaCache* cache, const RequestData* request_data, DataBlock* data_block,
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
Environment environment, int protocolVersion, uint32_t flags,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source)
LogStructList* log_struct_list, unsigned int private_flags, int malloc_source)
{
# ifdef CACHEDEV
if (!data_block->cachePermission) {
Expand Down Expand Up @@ -282,9 +282,9 @@ int uda::cache::cache_write(uda::cache::UdaCache* cache, const RequestData* requ
}

DataBlock* uda::cache::cache_read(uda::cache::UdaCache* cache, const RequestData* request_data,
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist,
Environment environment, int protocolVersion, uint32_t flags,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source)
LogStructList* log_struct_list, unsigned int private_flags, int malloc_source)
{
auto key = generate_cache_key(request_data, environment, flags, private_flags);
if (key.empty()) {
Expand Down
10 changes: 5 additions & 5 deletions source/cache/memcache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ UdaCache* open_cache();
void free_cache();

int cache_write(uda::cache::UdaCache* cache, const uda::client_server::RequestData* request_data, uda::client_server::DataBlock* data_block,
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, uda::client_server::Environment environment,
int protocolVersion, uint32_t flags, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags,
LogMallocList* logmalloclist, UserDefinedTypeList* userdefinedtypelist, uda::client_server::Environment environment,
int protocolVersion, uint32_t flags, LogStructList* log_struct_list, unsigned int private_flags,
int malloc_source);

uda::client_server::DataBlock* cache_read(uda::cache::UdaCache* cache, const uda::client_server::RequestData* request_data, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, uda::client_server::Environment environment, int protocolVersion,
uint32_t flags, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source);
uda::client_server::DataBlock* cache_read(uda::cache::UdaCache* cache, const uda::client_server::RequestData* request_data, LogMallocList* logmalloclist,
UserDefinedTypeList* userdefinedtypelist, uda::client_server::Environment environment, int protocolVersion,
uint32_t flags, LogStructList* log_struct_list, unsigned int private_flags, int malloc_source);

} // namespace cache
} // namespace uda
Expand Down
Loading

0 comments on commit 3392b36

Please sign in to comment.