MCPcopy Create free account
hub / github.com/apache/arrow / to_hex_int32

Function to_hex_int32

cpp/src/gandiva/precompiled/string_ops.cc:3013–3028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3011}
3012
3013FORCE_INLINE
3014const char* to_hex_int32(int64_t context, int32_t data, int32_t* out_len) {
3015 const int32_t max_size = 2 * sizeof(int32_t);
3016 // Allocate one extra byte for the null terminator written by snprintf.
3017 auto ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, max_size + 1));
3018
3019 if (ret == nullptr) {
3020 gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string");
3021 *out_len = 0;
3022 return "";
3023 }
3024 snprintf(ret, max_size + 1, "%" PRIX32, data);
3025
3026 *out_len = static_cast<int32_t>(strlen(ret));
3027 return ret;
3028}
3029
3030FORCE_INLINE
3031const char* from_hex_utf8(int64_t context, const char* text, int32_t text_len,

Callers 1

TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68