From f2cc9ad24d6391ccd288b527a643d6cea8e57b09 Mon Sep 17 00:00:00 2001 From: Roman Khlopkov <roman.khlopkov@demlabs.net> Date: Thu, 16 Sep 2021 05:38:17 +0300 Subject: [PATCH] [*] Build fix --- dap-sdk/core/include/dap_common.h | 6 +++--- modules/chain/dap_chain_cell.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dap-sdk/core/include/dap_common.h b/dap-sdk/core/include/dap_common.h index 1b8b665af8..d86474fc8d 100755 --- a/dap-sdk/core/include/dap_common.h +++ b/dap-sdk/core/include/dap_common.h @@ -132,8 +132,8 @@ typedef uint8_t byte_t; #define DAP_ALFREE(a) _dap_aligned_free(a, b) #define DAP_NEW( a ) DAP_CAST_REINT(a, malloc(sizeof(a)) ) #define DAP_NEW_SIZE(a, b) DAP_CAST_REINT(a, malloc(b) ) - #define DAP_NEW_S( a ) DAP_CAST_REINT(a, alloca(sizeof(a)) ) - #define DAP_NEW_S_SIZE(a, b) DAP_CAST_REINT(a, alloca(b) ) + #define DAP_NEW_S( a ) DAP_CAST_REINT(a, alloca(sizeof(a)) ) + #define DAP_NEW_S_SIZE(a, b) DAP_CAST_REINT(a, alloca(b) ) #define DAP_NEW_Z( a ) DAP_CAST_REINT(a, calloc(1,sizeof(a))) #define DAP_NEW_Z_SIZE(a, b) DAP_CAST_REINT(a, calloc(1,b)) #define DAP_REALLOC(a, b) realloc(a,b) @@ -189,7 +189,7 @@ DAP_STATIC_INLINE void _dap_aligned_free( void *ptr ) #if __SIZEOF_LONG__==8 #define DAP_UINT64_FORMAT_X "lX" -#define DAP_UINT64_FORMAT_x "lx" +#define DAP_UINT64_FORMAT_x "lx" #define DAP_UINT64_FORMAT_U "lu" #elif __SIZEOF_LONG__==4 #define DAP_UINT64_FORMAT_X "llX" diff --git a/modules/chain/dap_chain_cell.c b/modules/chain/dap_chain_cell.c index 4f0076f2b4..20a31982a5 100644 --- a/modules/chain/dap_chain_cell.c +++ b/modules/chain/dap_chain_cell.c @@ -87,7 +87,7 @@ dap_chain_cell_t * dap_chain_cell_create_fill(dap_chain_t * a_chain, dap_chain_c dap_chain_cell_t * l_cell = DAP_NEW_Z(dap_chain_cell_t); l_cell->chain = a_chain; l_cell->id.uint64 = a_cell_id.uint64; - l_cell->file_storage_path = dap_strdup_printf("%0llx.dchaincell", l_cell->id.uint64); + l_cell->file_storage_path = dap_strdup_printf("%0"DAP_UINT64_FORMAT_x".dchaincell", l_cell->id.uint64); pthread_rwlock_wrlock(&a_chain->cell_rwlock); HASH_ADD(hh, a_chain->cells, id, sizeof(dap_chain_cell_id_t), l_cell); pthread_rwlock_unlock(&a_chain->cell_rwlock); @@ -98,7 +98,7 @@ dap_chain_cell_t * dap_chain_cell_create_fill2(dap_chain_t * a_chain, const char { dap_chain_cell_t * l_cell = DAP_NEW_Z(dap_chain_cell_t); l_cell->chain = a_chain; - sscanf(a_filename, "%0llx.dchaincell", &l_cell->id.uint64); + sscanf(a_filename, "%"DAP_UINT64_FORMAT_x".dchaincell", &l_cell->id.uint64); l_cell->file_storage_path = dap_strdup_printf(a_filename); pthread_rwlock_wrlock(&a_chain->cell_rwlock); HASH_ADD(hh, a_chain->cells, id, sizeof(dap_chain_cell_id_t), l_cell); -- GitLab