Skip to content
Snippets Groups Projects
Commit e96a1a5c authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Merge declarations with initializations in namespaceAdaptKey.

parent 87ae2413
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -245,17 +245,12 @@ namespaceGetActive()
int
namespaceAdaptKey(int originResH, int originNamespace)
{
namespaceTuple_t tin;
int nsp;
if (originResH == CDI_UNDEFID) return CDI_UNDEFID;
tin.idx = originResH & idxmask;
tin.nsp = (int) (((unsigned) (originResH & nspmask)) >> idxbits);
namespaceTuple_t tin = { .idx = originResH & idxmask, .nsp = (int) (((unsigned) (originResH & nspmask)) >> idxbits) };
xassert(tin.nsp == originNamespace);
nsp = namespaceGetActive();
int nsp = namespaceGetActive();
return namespaceIdxEncode2(nsp, tin.idx);
}
......@@ -263,16 +258,11 @@ namespaceAdaptKey(int originResH, int originNamespace)
int
namespaceAdaptKey2(int originResH)
{
namespaceTuple_t tin;
int nsp;
if (originResH == CDI_UNDEFID) return CDI_UNDEFID;
tin.idx = originResH & idxmask;
tin.nsp = (int) (((unsigned) (originResH & nspmask)) >> idxbits);
nsp = namespaceGetActive();
namespaceTuple_t tin = { .idx = originResH & idxmask, .nsp = (int) (((unsigned) (originResH & nspmask)) >> idxbits) };
int nsp = namespaceGetActive();
return namespaceIdxEncode2(nsp, tin.idx);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment