Commit f2525a01 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Cleanup NEC SX-specific work-around.

parent 6c38e1f0
...@@ -35,28 +35,6 @@ static int activeNamespace = 0; ...@@ -35,28 +35,6 @@ static int activeNamespace = 0;
#define CDI_NETCDF_SWITCHES #define CDI_NETCDF_SWITCHES
#endif #endif
#if defined (SX)
static const union namespaceSwitchValue defaultSwitches[NUM_NAMESPACE_SWITCH] = {
{ .func = (void (*)()) cdiAbortC_serial },
{ .func = (void (*)()) cdiWarning },
{ .func = (void (*)()) serializeGetSizeInCore },
{ .func = (void (*)()) serializePackInCore },
{ .func = (void (*)()) serializeUnpackInCore },
{ .func = (void (*)()) fileOpen_serial },
{ .func = (void (*)()) fileWrite },
{ .func = (void (*)()) fileClose_serial },
{ .func = (void (*)()) cdiStreamOpenDefaultDelegate },
{ .func = (void (*)()) cdiStreamDefVlist_ },
{ .func = (void (*)()) cdiStreamWriteVar_ },
{ .func = (void (*)()) cdiStreamwriteVarChunk_ },
{ .func = (void (*)()) 0 },
{ .func = (void (*)()) 0 },
{ .func = (void (*)()) cdiStreamCloseDefaultDelegate },
{ .func = (void (*)()) cdiStreamDefTimestep_ },
{ .func = (void (*)()) cdiStreamSync_ },
CDI_NETCDF_SWITCHES
};
#else
#define defaultSwitches { \ #define defaultSwitches { \
{ .func = (void (*)()) cdiAbortC_serial }, \ { .func = (void (*)()) cdiAbortC_serial }, \
{ .func = (void (*)()) cdiWarning }, \ { .func = (void (*)()) cdiWarning }, \
...@@ -77,6 +55,10 @@ static const union namespaceSwitchValue defaultSwitches[NUM_NAMESPACE_SWITCH] = ...@@ -77,6 +55,10 @@ static const union namespaceSwitchValue defaultSwitches[NUM_NAMESPACE_SWITCH] =
{ .func = (void (*)()) cdiStreamSync_ }, \ { .func = (void (*)()) cdiStreamSync_ }, \
CDI_NETCDF_SWITCHES \ CDI_NETCDF_SWITCHES \
} }
#if defined (SX)
static const union namespaceSwitchValue
defaultSwitches_[NUM_NAMESPACE_SWITCH] = defaultSwitches;
#endif #endif
struct Namespace struct Namespace
...@@ -85,30 +67,7 @@ struct Namespace ...@@ -85,30 +67,7 @@ struct Namespace
union namespaceSwitchValue switches[NUM_NAMESPACE_SWITCH]; union namespaceSwitchValue switches[NUM_NAMESPACE_SWITCH];
} initialNamespace = { } initialNamespace = {
.resStage = STAGE_DEFINITION, .resStage = STAGE_DEFINITION,
#if defined (SX)
.switches = {
{ .func = (void (*)()) cdiAbortC_serial },
{ .func = (void (*)()) cdiWarning },
{ .func = (void (*)()) serializeGetSizeInCore },
{ .func = (void (*)()) serializePackInCore },
{ .func = (void (*)()) serializeUnpackInCore },
{ .func = (void (*)()) fileOpen_serial },
{ .func = (void (*)()) fileWrite },
{ .func = (void (*)()) fileClose_serial },
{ .func = (void (*)()) cdiStreamOpenDefaultDelegate },
{ .func = (void (*)()) cdiStreamDefVlist_ },
{ .func = (void (*)()) cdiStreamWriteVar_ },
{ .func = (void (*)()) cdiStreamwriteVarChunk_ },
{ .func = (void (*)()) 0 },
{ .func = (void (*)()) 0 },
{ .func = (void (*)()) cdiStreamCloseDefaultDelegate },
{ .func = (void (*)()) cdiStreamDefTimestep_ },
{ .func = (void (*)()) cdiStreamSync_ },
CDI_NETCDF_SWITCHES
}
#else
.switches = defaultSwitches .switches = defaultSwitches
#endif
}; };
struct Namespace *namespaces = &initialNamespace; struct Namespace *namespaces = &initialNamespace;
...@@ -226,7 +185,8 @@ namespaceNew() ...@@ -226,7 +185,8 @@ namespaceNew()
++nNamespaces; ++nNamespaces;
namespaces[newNamespaceID].resStage = STAGE_DEFINITION; namespaces[newNamespaceID].resStage = STAGE_DEFINITION;
#if defined (SX) #if defined (SX)
memcpy(namespaces[newNamespaceID].switches, defaultSwitches, memcpy(namespaces[newNamespaceID].switches,
defaultSwitches_,
sizeof (namespaces[newNamespaceID].switches)); sizeof (namespaces[newNamespaceID].switches));
#else #else
memcpy(namespaces[newNamespaceID].switches, memcpy(namespaces[newNamespaceID].switches,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment