diff --git a/include/log_io.h b/include/log_io.h index 322d68e572c35a9fd00cd18ba621263ba8dee553..b49caa208709fcaf803517b5c4e8f41dca8defbd 100644 --- a/include/log_io.h +++ b/include/log_io.h @@ -141,13 +141,13 @@ header_v11_sign(struct header_v11 *header); struct row_v11 { log_magic_t marker; struct header_v11 header; - u16 tag; + uint16_t tag; u64 cookie; - u8 data[]; + uint8_t data[]; } __attribute__((packed)); void -row_v11_fill(struct row_v11 *row, u64 lsn, u16 tag, u64 cookie, +row_v11_fill(struct row_v11 *row, u64 lsn, uint16_t tag, u64 cookie, const char *metadata, size_t metadata_len, const char *data, size_t data_len); diff --git a/include/recovery.h b/include/recovery.h index 915d032f58e391379204a95851dae7abe28e087a..c9d372cfe3020901de214556cc8692fba4d33445 100644 --- a/include/recovery.h +++ b/include/recovery.h @@ -123,7 +123,7 @@ void recover_existing_wals(struct recovery_state *); void recovery_follow_local(struct recovery_state *r, ev_tstamp wal_dir_rescan_delay); void recovery_finalize(struct recovery_state *r); int wal_write(struct recovery_state *r, i64 lsn, u64 cookie, - u16 op, const char *data, u32 len); + uint16_t op, const char *data, u32 len); void recovery_setup_panic(struct recovery_state *r, bool on_snap_error, bool on_wal_error); diff --git a/include/tarantool/util.h b/include/tarantool/util.h index 7712da55bd26807e3f18a225cb9b09f83eb763d7..8825ce4085d4be60b5b3e440d2324d7f7dfb7d94 100644 --- a/include/tarantool/util.h +++ b/include/tarantool/util.h @@ -121,12 +121,8 @@ strindex(const char **haystack, const char *needle, uint32_t hmax); #define CACHEALIGN(LEN) TYPEALIGN(32, (LEN)) #endif -typedef uint8_t u8; -typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef int8_t i8; -typedef int16_t i16; typedef int32_t i32; typedef int64_t i64; diff --git a/src/box/box.cc b/src/box/box.cc index 47862599e9509171bb166be4bb6daa724d9a65b0..0c28e4f60868563849540ff706a5c26e477a8288 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -170,12 +170,12 @@ recover_row(void *param __attribute__((unused)), const char *row, uint32_t rowle try { const char *end = row + rowlen; row += sizeof(struct header_v11); - u16 tag = pick_u16(&row, end); + uint16_t tag = pick_u16(&row, end); (void) pick_u64(&row, end); /* drop cookie */ if (tag == SNAP) { recover_snap_row(row); } else if (tag == XLOG) { - u16 op = pick_u16(&row, end); + uint16_t op = pick_u16(&row, end); process_rw(&null_port, op, row, end - row); } else { say_error("unknown row tag: %i", (int)tag); diff --git a/src/box/box_lua.cc b/src/box/box_lua.cc index e1202c02cb35456d34032937244c214895c70dcc..54dc448fece87d434d3e861d7c189524a03bc7c6 100644 --- a/src/box/box_lua.cc +++ b/src/box/box_lua.cc @@ -1609,8 +1609,8 @@ lbox_unpack(struct lua_State *L) int save_stacksize = lua_gettop(L); char charbuf; - u8 u8buf; - u16 u16buf; + uint8_t u8buf; + uint16_t u16buf; u32 u32buf; #define CHECK_SIZE(cur) if (unlikely((cur) >= end)) { \ @@ -1621,13 +1621,13 @@ lbox_unpack(struct lua_State *L) switch (*f) { case 'b': CHECK_SIZE(s); - u8buf = *(u8 *) s; + u8buf = *(uint8_t *) s; lua_pushnumber(L, u8buf); s++; break; case 's': CHECK_SIZE(s + 1); - u16buf = *(u16 *) s; + u16buf = *(uint16_t *) s; lua_pushnumber(L, u16buf); s += 2; break; diff --git a/src/box/tuple.cc b/src/box/tuple.cc index 9c5f0f5d69b01d2495c857f2fb946843e7a3a529..06837570330a1b95f44fb7a72444d4987debd4a9 100644 --- a/src/box/tuple.cc +++ b/src/box/tuple.cc @@ -140,7 +140,7 @@ print_field(struct tbuf *buf, const char *field, uint32_t len) { switch (len) { case 2: - tbuf_printf(buf, "%hu", *(u16 *)field); + tbuf_printf(buf, "%hu", *(uint16_t *)field); break; case 4: tbuf_printf(buf, "%u", *(u32 *)field); @@ -152,10 +152,10 @@ print_field(struct tbuf *buf, const char *field, uint32_t len) tbuf_printf(buf, "'"); const char *field_end = field + len; while (field < field_end) { - if (0x20 <= *(u8 *)field && *(u8 *)field < 0x7f) { - tbuf_printf(buf, "%c", *(u8 *) field); + if (0x20 <= *(uint8_t *)field && *(uint8_t *)field < 0x7f) { + tbuf_printf(buf, "%c", *(uint8_t *) field); } else { - tbuf_printf(buf, "\\x%02X", *(u8 *)field); + tbuf_printf(buf, "\\x%02X", *(uint8_t *)field); } field++; } diff --git a/src/box/tuple.h b/src/box/tuple.h index 81945b0a034e2ecbc039ef0c58888ad9bd97f53a..1442b0f76d4144764fa36d7bb42183a5b0cf4204 100644 --- a/src/box/tuple.h +++ b/src/box/tuple.h @@ -41,9 +41,9 @@ struct key_def; struct tuple { /** reference counter */ - u16 refs; + uint16_t refs; /* see enum tuple_flags */ - u16 flags; + uint16_t flags; /** length of the variable part of the tuple */ u32 bsize; /** number of fields in the variable part. */ diff --git a/src/box/tuple_update.cc b/src/box/tuple_update.cc index 62c20513f97107af2165b2150c9b6c54239a1f6e..f2398231338291088e57920f3e191b462ff0d34e 100644 --- a/src/box/tuple_update.cc +++ b/src/box/tuple_update.cc @@ -165,7 +165,7 @@ struct update_op { union update_op_arg arg; u32 field_no; u32 new_field_len; - u8 opcode; + uint8_t opcode; }; STAILQ_HEAD(op_list, update_op); diff --git a/src/box/txn.cc b/src/box/txn.cc index 6bfaaf278524a5c1af0d555ac512b2baee43f1b1..1a6e5e60e5a40cbfa108664dbe6e5db4de7c73db 100644 --- a/src/box/txn.cc +++ b/src/box/txn.cc @@ -36,7 +36,7 @@ #include "request.h" /* for request_name */ void -txn_add_redo(struct txn *txn, u16 op, const char *data, u32 len) +txn_add_redo(struct txn *txn, uint16_t op, const char *data, u32 len) { txn->op = op; txn->data = data; diff --git a/src/box/txn.h b/src/box/txn.h index eee411172bddcfcace6047c326229e2a3c9cc84a..fffb9d344622f550396363c208756172f61c9a22 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -42,14 +42,14 @@ struct txn { /* Redo info: binary packet */ const char *data; u32 len; - u16 op; + uint16_t op; }; struct txn *txn_begin(); void txn_commit(struct txn *txn); void txn_finish(struct txn *txn); void txn_rollback(struct txn *txn); -void txn_add_redo(struct txn *txn, u16 op, const char *data, u32 len); +void txn_add_redo(struct txn *txn, uint16_t op, const char *data, u32 len); void txn_replace(struct txn *txn, struct space *space, struct tuple *old_tuple, struct tuple *new_tuple, enum dup_replace_mode mode); diff --git a/src/log_io.cc b/src/log_io.cc index d1da025bceefda8f38f7b8bfa13c617fab8fdd39..d4e56465d6db9666bea70d8a9a63a5957d7f7854 100644 --- a/src/log_io.cc +++ b/src/log_io.cc @@ -53,7 +53,7 @@ header_v11_sign(struct header_v11 *header) } void -row_v11_fill(struct row_v11 *row, u64 lsn, u16 tag, u64 cookie, +row_v11_fill(struct row_v11 *row, u64 lsn, uint16_t tag, u64 cookie, const char *metadata, size_t metadata_len, const char *data, size_t data_len) { diff --git a/src/memcached.cc b/src/memcached.cc index aaf3cd4b8c489fc7ee1ee47ca10fdd135996d968..3ed233fc0c060fa523790e173c606908548a7fdd 100644 --- a/src/memcached.cc +++ b/src/memcached.cc @@ -77,7 +77,7 @@ memcached_natoq(const char *start, const char *end) { u64 num = 0; while (start < end) { - u8 code = *start++; + uint8_t code = *start++; num = num * 10 + (code - '0'); } return num; diff --git a/src/recovery.cc b/src/recovery.cc index d20d98f66b9160355724bb4ab3aad1ae3710501d..c0b69fd61948d943832845698cb4b138d8c07299 100644 --- a/src/recovery.cc +++ b/src/recovery.cc @@ -1106,7 +1106,7 @@ wal_writer_thread(void *worker_args) */ int wal_write(struct recovery_state *r, i64 lsn, u64 cookie, - u16 op, const char *row, u32 row_len) + uint16_t op, const char *row, u32 row_len) { say_debug("wal_write lsn=%" PRIi64, lsn); ERROR_INJECT_RETURN(ERRINJ_WAL_IO); diff --git a/src/replication.cc b/src/replication.cc index 3f0f699ba8e2077212d36a5aa3451f71bc12543f..5bcc946a4f4c775d3df2f3cc626dd4e0b4de9439 100644 --- a/src/replication.cc +++ b/src/replication.cc @@ -539,7 +539,7 @@ static void replication_relay_recv(struct ev_io *w, int __attribute__((unused)) revents) { int client_sock = (int) (intptr_t) w->data; - u8 data; + uint8_t data; int rc = recv(client_sock, &data, sizeof(data), 0); diff --git a/test/connector_c/update.c b/test/connector_c/update.c index 4aa27709700fd77300016df9d119c0f278414149..fa1e71bba1e04e82829c681c08d73ec1becf7ec9 100644 --- a/test/connector_c/update.c +++ b/test/connector_c/update.c @@ -347,10 +347,10 @@ print_tuple(struct tnt_tuple *tuple) switch(size) { case 1: - printf("%"PRIi8" (0x%02"PRIx8")", *(i8 *)data, *(i8 *)data); + printf("%"PRIi8" (0x%02"PRIx8")", *(int8_t *)data, *(int8_t *)data); break; case 2: - printf("%"PRIi16" (0x%04"PRIx16")", *(i16 *)data, *(i16 *)data); + printf("%"PRIi16" (0x%04"PRIx16")", *(int16_t *)data, *(int16_t *)data); break; case 4: printf("%"PRIi32" (0x%08"PRIx32")", *(i32 *)data, *(i32 *)data);