MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / svc_enum_to_ptr

Function svc_enum_to_ptr

internal/cbm/service_patterns.c:1083–1085  ·  view source on GitHub ↗

Encode the enum + 1 in the pointer so 0/NULL means "miss". */

Source from the content-addressed store, hash-verified

1081static CBM_TLS CBMHashTable *_svc_cache = NULL;
1082/* Encode the enum + 1 in the pointer so 0/NULL means "miss". */
1083static inline void *svc_enum_to_ptr(cbm_svc_kind_t k) {
1084 return (void *)(uintptr_t)((unsigned)k + 1u);
1085}
1086static inline cbm_svc_kind_t svc_ptr_to_enum(void *p) {
1087 return (cbm_svc_kind_t)((uintptr_t)p - 1u);
1088}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected