Branch data Line data Source code
1 : : // Copyright 2019-2026 David Robillard <d@drobilla.net> 2 : : // SPDX-License-Identifier: ISC 3 : : 4 : : #include "fixed.h" 5 : : 6 : : #include <exess/exess.h> 7 : : 8 : : #include <stdint.h> 9 : : #include <stdlib.h> 10 : : 11 : : EXESS_NONBLOCKING EXESS_NONBLOCKING ExessResult 12 : 99480 : exess_read_short(const char* const str, int16_t* const out) 13 : : { 14 : 99480 : int64_t value = 0; 15 : 99480 : const ExessResult r = read_signed(str, INT16_MIN, INT16_MAX, &value); 16 : : 17 [ + + ]: 99480 : if (!r.status) { 18 : 99464 : *out = (int16_t)value; 19 : : } 20 : : 21 : 99480 : return r; 22 : : } 23 : : 24 : : EXESS_NONBLOCKING EXESS_NONBLOCKING ExessResult 25 : 99525 : exess_write_short(const int16_t value, const size_t buf_size, char* const buf) 26 : : { 27 : 99525 : return exess_write_long(value, buf_size, buf); 28 : : }