Commit 8eae580b authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add interface for idx encoding not requiring intermediate tuple type.

parent ebbfc660
......@@ -45,6 +45,12 @@ int namespaceIdxEncode ( namespaceTuple_t tin )
return ( tin.nsp << idxbits ) + tin.idx;
}
int namespaceIdxEncode2 ( int idx, int nsp )
{
assert(nsp < NUM_NAMESPACES && idx < NUM_IDX);
return ( nsp << idxbits ) + idx;
}
namespaceTuple_t namespaceIdxDecode ( int code )
{
......
......@@ -8,7 +8,8 @@ typedef struct {
void namespaceShowbits ( int n, char *name );
int namespaceIdxEncode ( namespaceTuple_t tin );
int namespaceIdxEncode ( namespaceTuple_t tin );
int namespaceIdxEncode2 ( int idx, int nsp );
namespaceTuple_t namespaceIdxDecode ( int code );
#endif
Supports Markdown
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