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:754–756  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

752static CBM_TLS CBMHashTable *_svc_cache = NULL;
753/* Encode the enum + 1 in the pointer so 0/NULL means "miss". */
754static inline void *svc_enum_to_ptr(cbm_svc_kind_t k) {
755 return (void *)(uintptr_t)((unsigned)k + 1u);
756}
757static inline cbm_svc_kind_t svc_ptr_to_enum(void *p) {
758 return (cbm_svc_kind_t)((uintptr_t)p - 1u);
759}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected