8#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
9#define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
23 extern const char _kUpb_ToBase92[];
25 return _kUpb_ToBase92[ch];
29 extern const int8_t _kUpb_FromBase92[];
30 if (
' ' > ch || ch >
'~')
return -1;
31 return _kUpb_FromBase92[ch -
' '];
35 const char* end,
char first_ch,
36 uint8_t min, uint8_t max,
40 const int bits_per_char =
46 if (
ptr == end || *
ptr < min || max < *
ptr) {
52 shift += bits_per_char;
53 if (shift >= 32)
return NULL;
UPB_INLINE char _upb_ToBase92(int8_t ch)
Definition base92.h:22
UPB_INLINE char _upb_FromBase92(uint8_t ch)
Definition base92.h:28
UPB_INLINE const char * _upb_Base92_DecodeVarint(const char *ptr, const char *end, char first_ch, uint8_t min, uint8_t max, uint32_t *out_val)
Definition base92.h:34
#define UPB_ASSUME(expr)
Definition def.inc:319
#define UPB_ASSERT(expr)
Definition def.inc:329
#define UPB_INLINE
Definition def.inc:144
UPB_INLINE int upb_Log2Ceiling(int x)
Definition log2.h:19