From 28489b9ee84ab7180d4ac4775ca0fe4d5c3112d5 Mon Sep 17 00:00:00 2001 From: oxmox Date: Sun, 12 Feb 2023 13:38:54 +0100 Subject: [PATCH] add my standard typedefs for integrals --- src/dp_common.h | 6 ++++-- src/dp_types.h | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/dp_types.h diff --git a/src/dp_common.h b/src/dp_common.h index d52909a..1ba9db1 100644 --- a/src/dp_common.h +++ b/src/dp_common.h @@ -3,6 +3,8 @@ #include #include +#include "dp_types.h" +#include "log.h" #ifdef __cplusplus extern "C" { @@ -23,8 +25,8 @@ nng_socket make_doom_sub(const char *url); static const char *const CtrlUrl = "ipc://666_ctrl.socket"; // controller publishes here static const char *const DoomUrl = "ipc://666_doom.socket"; // dooms publish here -typedef uint32_t doomid_t; // unique id for each doom instance -typedef uint16_t dmt_t; // for DP_MessageType values +typedef u32 doomid_t; // unique id for each doom instance +typedef u16 dmt_t; // for DP_MessageType values enum DP_MessageType { diff --git a/src/dp_types.h b/src/dp_types.h new file mode 100644 index 0000000..fb2a0c5 --- /dev/null +++ b/src/dp_types.h @@ -0,0 +1,21 @@ +#ifndef SRC_DP_TYPES_H +#define SRC_DP_TYPES_H + +#ifdef __cplusplus +#include +#else +#include +#endif + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; + + +#endif // SRC_DP_TYPES_H \ No newline at end of file