| /openbsd-src/usr.sbin/nsd/ |
| H A D | buffer.h | 23 typedef struct buffer buffer_type; 25 struct buffer struct 55 buffer_invariant(buffer_type *ATTR_UNUSED(buffer)) in buffer_invariant() argument 60 buffer_invariant(buffer_type *buffer) in buffer_invariant() argument 62 assert(buffer); in buffer_invariant() 63 assert(buffer->_position <= buffer->_limit); in buffer_invariant() 64 assert(buffer->_limit <= buffer->_capacity); in buffer_invariant() 65 assert(buffer->_data); in buffer_invariant() 79 void buffer_create_from(buffer_type *buffer, void *data, size_t size); 85 void buffer_clear(buffer_type *buffer); [all …]
|
| H A D | buffer.c | 19 buffer_type *buffer = (buffer_type *) arg; in buffer_cleanup() local 20 assert(!buffer->_fixed); in buffer_cleanup() 21 free(buffer->_data); in buffer_cleanup() 27 buffer_type *buffer in buffer_create() local 29 if (!buffer) in buffer_create() 32 buffer->_data = (uint8_t *) xalloc(capacity); in buffer_create() 33 buffer->_position = 0; in buffer_create() 34 buffer->_limit = buffer->_capacity = capacity; in buffer_create() 35 buffer->_fixed = 0; in buffer_create() 36 buffer_invariant(buffer); in buffer_create() [all …]
|
| /openbsd-src/gnu/gcc/gcc/ |
| H A D | tree-pretty-print.c | 52 int i; for (i = 0; i<SPACE; i++) pp_space (buffer); } while (0) 54 #define NIY do_niy(buffer,node) 57 (buffer, "%s", TREE_CODE (NODE) == NOP_EXPR ? \ 61 static pretty_printer buffer; variable 67 do_niy (pretty_printer *buffer, tree node) in do_niy() argument 71 pp_string (buffer, "<<< Unknown tree: "); in do_niy() 72 pp_string (buffer, tree_code_name[(int) TREE_CODE (node)]); in do_niy() 79 newline_and_indent (buffer, 2); in do_niy() 80 dump_generic_node (buffer, TREE_OPERAND (node, i), 2, 0, false); in do_niy() 84 pp_string (buffer, " >>>\n"); in do_niy() [all …]
|
| /openbsd-src/usr.sbin/unbound/sldns/ |
| H A D | sbuffer.h | 142 sldns_buffer_invariant(sldns_buffer *ATTR_UNUSED(buffer)) in sldns_buffer_invariant() argument 147 sldns_buffer_invariant(sldns_buffer *buffer) in sldns_buffer_invariant() argument 149 assert(buffer != NULL); in sldns_buffer_invariant() 150 assert(buffer->_position <= buffer->_limit); in sldns_buffer_invariant() 151 assert(buffer->_limit <= buffer->_capacity); in sldns_buffer_invariant() 152 assert(buffer->_data != NULL); in sldns_buffer_invariant() 173 void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size); 182 void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size); 189 INLINE void sldns_buffer_clear(sldns_buffer *buffer) in sldns_buffer_clear() argument 191 sldns_buffer_invariant(buffer); in sldns_buffer_clear() [all …]
|
| H A D | sbuffer.c | 21 sldns_buffer *buffer = (sldns_buffer*)malloc(sizeof(sldns_buffer)); in sldns_buffer_new() local 23 if (!buffer) { in sldns_buffer_new() 27 buffer->_data = (uint8_t *) malloc(capacity); in sldns_buffer_new() 28 if (!buffer->_data) { in sldns_buffer_new() 29 free(buffer); in sldns_buffer_new() 33 buffer->_position = 0; in sldns_buffer_new() 34 buffer->_limit = buffer->_capacity = capacity; in sldns_buffer_new() 35 buffer->_fixed = 0; in sldns_buffer_new() 36 buffer->_status_err = 0; in sldns_buffer_new() 38 sldns_buffer_invariant(buffer); in sldns_buffer_new() [all …]
|
| /openbsd-src/sbin/unwind/libunbound/sldns/ |
| H A D | sbuffer.h | 142 sldns_buffer_invariant(sldns_buffer *ATTR_UNUSED(buffer)) in sldns_buffer_invariant() argument 147 sldns_buffer_invariant(sldns_buffer *buffer) in sldns_buffer_invariant() argument 149 assert(buffer != NULL); in sldns_buffer_invariant() 150 assert(buffer->_position <= buffer->_limit); in sldns_buffer_invariant() 151 assert(buffer->_limit <= buffer->_capacity); in sldns_buffer_invariant() 152 assert(buffer->_data != NULL); in sldns_buffer_invariant() 173 void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size); 182 void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size); 189 INLINE void sldns_buffer_clear(sldns_buffer *buffer) in sldns_buffer_clear() argument 191 sldns_buffer_invariant(buffer); in sldns_buffer_clear() [all …]
|
| H A D | sbuffer.c | 21 sldns_buffer *buffer = (sldns_buffer*)malloc(sizeof(sldns_buffer)); in sldns_buffer_new() local 23 if (!buffer) { in sldns_buffer_new() 27 buffer->_data = (uint8_t *) malloc(capacity); in sldns_buffer_new() 28 if (!buffer->_data) { in sldns_buffer_new() 29 free(buffer); in sldns_buffer_new() 33 buffer->_position = 0; in sldns_buffer_new() 34 buffer->_limit = buffer->_capacity = capacity; in sldns_buffer_new() 35 buffer->_fixed = 0; in sldns_buffer_new() 36 buffer->_status_err = 0; in sldns_buffer_new() 38 sldns_buffer_invariant(buffer); in sldns_buffer_new() [all …]
|
| /openbsd-src/gnu/llvm/compiler-rt/lib/asan/tests/ |
| H A D | asan_internal_interface_test.cpp | 17 std::vector<char> buffer(17, 0xff); in TEST() local 19 __asan_set_shadow_00((uptr)buffer.data(), buffer.size()); in TEST() 20 EXPECT_EQ(std::vector<char>(buffer.size(), 0x00), buffer); in TEST() 22 __asan_set_shadow_01((uptr)buffer.data(), buffer.size()); in TEST() 23 EXPECT_EQ(std::vector<char>(buffer.size(), 0x01), buffer); in TEST() 25 __asan_set_shadow_02((uptr)buffer.data(), buffer.size()); in TEST() 26 EXPECT_EQ(std::vector<char>(buffer.size(), 0x02), buffer); in TEST() 28 __asan_set_shadow_03((uptr)buffer.data(), buffer.size()); in TEST() 29 EXPECT_EQ(std::vector<char>(buffer.size(), 0x03), buffer); in TEST() 31 __asan_set_shadow_04((uptr)buffer.data(), buffer.size()); in TEST() [all …]
|
| /openbsd-src/gnu/usr.bin/gcc/gcc/ |
| H A D | diagnostic.c | 95 set_real_maximum_length (buffer) in set_real_maximum_length() argument 96 output_buffer *buffer; in set_real_maximum_length() 101 if (!output_is_line_wrapping (buffer) 102 || output_prefixing_rule (buffer) == DIAGNOSTICS_SHOW_PREFIX_ONCE 103 || output_prefixing_rule (buffer) == DIAGNOSTICS_SHOW_PREFIX_NEVER) 104 line_wrap_cutoff (buffer) = output_line_cutoff (buffer); 107 int prefix_length = buffer->state.prefix ? 108 strlen (buffer->state.prefix) : 0; 111 if (output_line_cutoff (buffer) - prefix_length < 32) 112 line_wrap_cutoff (buffer) = output_line_cutoff (buffer) + 32; [all …]
|
| /openbsd-src/gnu/usr.bin/cvs/src/ |
| H A D | buffer.h | 13 struct buffer struct 70 void (*memory_error) PROTO((struct buffer *)); argument 100 typedef void (*BUFMEMERRPROC) PROTO ((struct buffer *)); 102 extern struct buffer *buf_initialize PROTO((int (*) (void *, char *, int, 109 void (*) (struct buffer *), 111 extern void buf_free PROTO((struct buffer *)); 112 extern struct buffer *buf_nonio_initialize PROTO((void (*) (struct buffer *))); 113 extern struct buffer *stdio_buffer_initialize 114 PROTO((FILE *, int, void (*) (struct buffer *))); 115 extern struct buffer *compress_buffer_initialize [all …]
|
| /openbsd-src/lib/libcbor/src/cbor/ |
| H A D | encoding.c | 11 size_t cbor_encode_uint8(uint8_t value, unsigned char *buffer, in cbor_encode_uint8() argument 13 return _cbor_encode_uint8(value, buffer, buffer_size, 0x00); in cbor_encode_uint8() 16 size_t cbor_encode_uint16(uint16_t value, unsigned char *buffer, in cbor_encode_uint16() argument 18 return _cbor_encode_uint16(value, buffer, buffer_size, 0x00); in cbor_encode_uint16() 21 size_t cbor_encode_uint32(uint32_t value, unsigned char *buffer, in cbor_encode_uint32() argument 23 return _cbor_encode_uint32(value, buffer, buffer_size, 0x00); in cbor_encode_uint32() 26 size_t cbor_encode_uint64(uint64_t value, unsigned char *buffer, in cbor_encode_uint64() argument 28 return _cbor_encode_uint64(value, buffer, buffer_size, 0x00); in cbor_encode_uint64() 31 size_t cbor_encode_uint(uint64_t value, unsigned char *buffer, in cbor_encode_uint() argument 33 return _cbor_encode_uint(value, buffer, buffer_size, 0x00); in cbor_encode_uint() [all …]
|
| /openbsd-src/gnu/usr.bin/binutils/gdb/ |
| H A D | kod-cisco.c | 50 char buffer[PBUFSIZ]; in cisco_kod_open() local 69 (*gdb_kod_query) ("oI;", buffer, &bufsiz); in cisco_kod_open() 71 strcpy (buffer, "Cisco IOS/Classic/13.4 0.0.0"); in cisco_kod_open() 75 for (i = 0; count && buffer[i] != '\0'; ++i) in cisco_kod_open() 77 if (buffer[i] == ' ') in cisco_kod_open() 81 if (buffer[i] == '\0') in cisco_kod_open() 83 if (strcmp (&buffer[i], "0.0.0")) in cisco_kod_open() 84 error ("Remote returned unknown stub version: %s\n", &buffer[i]); in cisco_kod_open() 111 char buffer[PBUFSIZ], command[PBUFSIZ]; in cisco_kod_request() local 150 (*gdb_kod_query) (command, buffer, &bufsiz); in cisco_kod_request() [all …]
|
| /openbsd-src/lib/libcbor/src/cbor/internal/ |
| H A D | encoders.c | 11 size_t _cbor_encode_uint8(uint8_t value, unsigned char *buffer, in _cbor_encode_uint8() argument 15 buffer[0] = value + offset; in _cbor_encode_uint8() 20 buffer[0] = 0x18 + offset; in _cbor_encode_uint8() 21 buffer[1] = value; in _cbor_encode_uint8() 28 size_t _cbor_encode_uint16(uint16_t value, unsigned char *buffer, in _cbor_encode_uint16() argument 31 buffer[0] = 0x19 + offset; in _cbor_encode_uint16() 34 memcpy(buffer + 1, &value, 2); in _cbor_encode_uint16() 36 buffer[1] = (unsigned char)(value >> 8); in _cbor_encode_uint16() 37 buffer[2] = (unsigned char)value; in _cbor_encode_uint16() 45 size_t _cbor_encode_uint32(uint32_t value, unsigned char *buffer, in _cbor_encode_uint32() argument [all …]
|
| /openbsd-src/sys/dev/adb/ |
| H A D | ams.c | 72 void ms_adbcomplete(caddr_t buffer, caddr_t data_area, int adb_command); 206 u_char buffer[9]; in ems_init() local 230 buffer[0] = 4; in ems_init() 231 buffer[1] = 0x00; /* Alternative speed */ in ems_init() 232 buffer[2] = 0x00; /* speed = maximum */ in ems_init() 233 buffer[3] = 0x10; /* enable extended protocol, in ems_init() 237 buffer[4] = 0x07; /* Locking mask = 0000b, in ems_init() 240 adb_op_sync((Ptr)buffer, cmd); in ems_init() 253 buffer[0] = 0; in ems_init() 254 adb_op_sync((Ptr)buffer, ADBFLUSH(adbaddr)); in ems_init() [all …]
|
| /openbsd-src/gnu/gcc/libcpp/ |
| H A D | lex.c | 83 add_line_note (cpp_buffer *buffer, const uchar *pos, unsigned int type) in add_line_note() argument 85 if (buffer->notes_used == buffer->notes_cap) in add_line_note() 87 buffer->notes_cap = buffer->notes_cap * 2 + 200; in add_line_note() 88 buffer->notes = XRESIZEVEC (_cpp_line_note, buffer->notes, in add_line_note() 89 buffer->notes_cap); in add_line_note() 92 buffer->notes[buffer->notes_used].pos = pos; in add_line_note() 93 buffer->notes[buffer->notes_used].type = type; in add_line_note() 94 buffer->notes_used++; in add_line_note() 102 cpp_buffer *buffer; in _cpp_clean_line() local 106 buffer = pfile->buffer; in _cpp_clean_line() [all …]
|
| /openbsd-src/lib/libcurses/tinfo/ |
| H A D | comp_expand.c | 65 static char *buffer; in _nc_tic_expand() local 80 if (buffer != 0) { in _nc_tic_expand() 81 FreeAndNull(buffer); in _nc_tic_expand() 87 if (buffer == 0 || need > length) { in _nc_tic_expand() 88 if ((buffer = typeRealloc(char, length = need, buffer)) == 0) in _nc_tic_expand() 99 buffer[bufp++] = *str++; in _nc_tic_expand() 111 _nc_SPRINTF(buffer + bufp, _nc_SLIMIT(P_LIMIT(bufp)) in _nc_tic_expand() 113 bufp += (int) strlen(buffer + bufp); in _nc_tic_expand() 116 buffer[bufp++] = *str; in _nc_tic_expand() 136 buffer[bufp++] = S_QUOTE; in _nc_tic_expand() [all …]
|
| /openbsd-src/gnu/usr.bin/binutils/gdb/rdi-share/ |
| H A D | msgbuild.c | 45 unsigned int vmsgbuild(unsigned char *buffer, const char *format, va_list args) in vmsgbuild() argument 55 if (buffer != NULL) in vmsgbuild() 56 *buffer++ = (unsigned char)ch; in vmsgbuild() 73 if (buffer != NULL) in vmsgbuild() 75 PUT32LE(buffer, na); in vmsgbuild() 76 buffer += sizeof(unsigned int); in vmsgbuild() 90 if (buffer != NULL) in vmsgbuild() 92 PUT16LE(buffer, na); in vmsgbuild() 93 buffer += sizeof(unsigned short); in vmsgbuild() 117 if (buffer != NULL) in vmsgbuild() [all …]
|
| /openbsd-src/gnu/usr.bin/binutils-2.17/opcodes/ |
| H A D | m68k-dis.c | 165 fetch_arg (unsigned char *buffer, in fetch_arg() argument 175 val = buffer[3] >> 5; in fetch_arg() 179 val = ((buffer[3] >> 3) & 0x2) | ((~buffer[1] >> 7) & 0x1); in fetch_arg() 183 val = ((buffer[3] >> 3) & 0x2) | ((buffer[1] >> 7) & 0x1); in fetch_arg() 187 val = buffer[0] >> 2; in fetch_arg() 191 val = buffer[2] >> 1; in fetch_arg() 195 val = buffer[0] >> 1; in fetch_arg() 199 val = buffer[1]; in fetch_arg() 203 val = buffer[1]; in fetch_arg() 207 val = (buffer[0] << 8) + buffer[1]; in fetch_arg() [all …]
|
| H A D | m68hc11-dis.c | 48 read_memory (bfd_vma memaddr, bfd_byte* buffer, int size, in read_memory() argument 55 status = (*info->read_memory_func) (memaddr, buffer, size, info); in read_memory() 72 bfd_byte buffer[4]; in print_indexed_operand() local 81 status = read_memory (memaddr, &buffer[0], 1, info); in print_indexed_operand() 88 if ((buffer[0] & 0x20) == 0) in print_indexed_operand() 90 reg = (buffer[0] >> 6) & 3; in print_indexed_operand() 91 sval = (buffer[0] & 0x1f); in print_indexed_operand() 109 else if ((buffer[0] & 0xc0) != 0xc0) in print_indexed_operand() 113 reg = (buffer[0] >> 6) & 3; in print_indexed_operand() 114 sval = (buffer[0] & 0x0f); in print_indexed_operand() [all …]
|
| /openbsd-src/gnu/llvm/compiler-rt/lib/sanitizer_common/ |
| H A D | sanitizer_stacktrace_printer.cpp | 108 InternalScopedString *buffer) { in MaybeBuildIdToBuffer() argument 111 buffer->append(" "); in MaybeBuildIdToBuffer() 112 buffer->append("(BuildId: "); in MaybeBuildIdToBuffer() 114 buffer->append("%02x", info.uuid[i]); in MaybeBuildIdToBuffer() 116 buffer->append(")"); in MaybeBuildIdToBuffer() 122 void RenderFrame(InternalScopedString *buffer, const char *format, int frame_no, in RenderFrame() argument 135 buffer->append("%c", *p); in RenderFrame() 141 buffer->append("%%"); in RenderFrame() 145 buffer->append("%u", frame_no); in RenderFrame() 148 buffer->append("0x%zx", address); in RenderFrame() [all …]
|
| /openbsd-src/gnu/usr.bin/binutils/opcodes/ |
| H A D | m68k-dis.c | 188 bfd_byte *buffer = priv.the_buffer; local 283 FETCH_DATA (info, buffer + 2); 284 major_opcode = (buffer[0] >> 4) & 15; 291 if (((0xff & buffer[0] & (match >> 24)) == (0xff & (opcode >> 24))) 292 && ((0xff & buffer[1] & (match >> 16)) == (0xff & (opcode >> 16))) 296 (FETCH_DATA (info, buffer + 4) 297 && ((0xff & buffer[2] & (match >> 8)) == (0xff & (opcode >> 8))) 298 && ((0xff & buffer[3] & match) == (0xff & opcode))) 327 val = fetch_arg (buffer, d[1], 3, info); 347 p = buffer + 2; [all …]
|
| H A D | m68hc11-dis.c | 48 read_memory (bfd_vma memaddr, bfd_byte* buffer, int size, in read_memory() argument 55 status = (*info->read_memory_func) (memaddr, buffer, size, info); in read_memory() 72 bfd_byte buffer[4]; in print_indexed_operand() local 81 status = read_memory (memaddr, &buffer[0], 1, info); in print_indexed_operand() 88 if ((buffer[0] & 0x20) == 0) in print_indexed_operand() 90 reg = (buffer[0] >> 6) & 3; in print_indexed_operand() 91 sval = (buffer[0] & 0x1f); in print_indexed_operand() 109 else if ((buffer[0] & 0xc0) != 0xc0) in print_indexed_operand() 113 reg = (buffer[0] >> 6) & 3; in print_indexed_operand() 114 sval = (buffer[0] & 0x0f); in print_indexed_operand() [all …]
|
| /openbsd-src/sys/dev/pci/drm/ |
| H A D | drm_client.c | 265 static void drm_client_buffer_delete(struct drm_client_buffer *buffer) in drm_client_buffer_delete() argument 267 if (buffer->gem) { in drm_client_buffer_delete() 268 drm_gem_vunmap_unlocked(buffer->gem, &buffer->map); in drm_client_buffer_delete() 269 drm_gem_object_put(buffer->gem); in drm_client_buffer_delete() 272 kfree(buffer); in drm_client_buffer_delete() 282 struct drm_client_buffer *buffer; in drm_client_buffer_create() local 286 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); in drm_client_buffer_create() 287 if (!buffer) in drm_client_buffer_create() 290 buffer->client = client; in drm_client_buffer_create() 305 buffer->pitch = dumb_args.pitch; in drm_client_buffer_create() [all …]
|
| /openbsd-src/gnu/llvm/compiler-rt/lib/sanitizer_common/tests/ |
| H A D | sanitizer_leb128_test.cpp | 40 u8 buffer[16] = {255}; in TYPED_TEST() local 42 EXPECT_EQ(buffer + 1, EncodeSLEB128(v, buffer, buffer + 1)); in TYPED_TEST() 43 EXPECT_EQ(buffer + 1, DecodeSLEB128(buffer, buffer + 1, &v)); in TYPED_TEST() 50 u8 buffer[16] = {}; in TYPED_TEST() local 51 u8* p = EncodeSLEB128(v, std::begin(buffer), std::end(buffer)); in TYPED_TEST() 52 EXPECT_EQ(int(BitsNeeded(v < 0 ? (-v - 1) : v) + 6 + 1) / 7, p - buffer) in TYPED_TEST() 55 u8* p2 = DecodeSLEB128(std::begin(buffer), std::end(buffer), &v2); in TYPED_TEST() 64 u8 buffer[16] = {255}; in TYPED_TEST() local 66 EXPECT_EQ(buffer + 1, EncodeULEB128(v, buffer, buffer + 1)); in TYPED_TEST() 67 EXPECT_EQ(buffer + 1, DecodeULEB128(buffer, buffer + 1, &v)); in TYPED_TEST() [all …]
|
| /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/gcc.c-torture/execute/ |
| H A D | string-opt-17.c | 12 char buffer[32]; variable 17 memset (buffer, argc, 0); in main() 18 memset (buffer, argc, 1); in main() 19 memset (buffer, argc, 2); in main() 20 memset (buffer, argc, 3); in main() 21 memset (buffer, argc, 4); in main() 22 memset (buffer, argc, 5); in main() 23 memset (buffer, argc, 6); in main() 24 memset (buffer, argc, 7); in main() 25 memset (buffer, argc, 8); in main() [all …]
|