@@ -39,7 +39,7 @@ bool BSL_AbsSecBlock_IsConsistent(const BSL_AbsSecBlock_t *self)
3939{
4040 // NOLINTBEGIN
4141 CHK_AS_BOOL (self != NULL );
42- CHK_AS_BOOL (self -> sec_context_id > 0 );
42+ // CHK_AS_BOOL(self->sec_context_id > 0);
4343 CHK_AS_BOOL (self -> source_eid .handle != NULL );
4444 CHK_AS_BOOL (BSLB_SecParamList_size (self -> params ) < 10000 );
4545
@@ -55,24 +55,24 @@ bool BSL_AbsSecBlock_IsConsistent(const BSL_AbsSecBlock_t *self)
5555void BSL_AbsSecBlock_Print (const BSL_AbsSecBlock_t * self )
5656{
5757 BSL_StaticString_t str ;
58- BSL_LOG_INFO ("ASB context id: %lu" , self -> sec_context_id );
58+ BSL_LOG_INFO ("ASB context id: %" PRId64 , self -> sec_context_id );
5959 for (size_t index = 0 ; index < uint64_list_size (self -> targets ); index ++ )
6060 {
61- BSL_LOG_INFO ("ASB target[%lu ]: %lu" , index , * uint64_list_cget (self -> targets , index ));
61+ BSL_LOG_INFO ("ASB target[%zu ]: %" PRIu64 , index , * uint64_list_cget (self -> targets , index ));
6262 }
6363
6464 for (size_t index = 0 ; index < BSLB_SecParamList_size (self -> params ); index ++ )
6565 {
6666 BSL_SecParam_t * param = BSLB_SecParamList_get (self -> params , index );
67- BSL_LOG_INFO ("ASB Param[%lu ]: id=%lu val=%lu" , index , param -> param_id , param -> _uint_value );
67+ BSL_LOG_INFO ("ASB Param[%zu ]: id=%" PRIu64 " val=%" PRIu64 , index , param -> param_id , param -> _uint_value );
6868 }
6969
7070 for (size_t index = 0 ; index < BSLB_SecResultList_size (self -> results ); index ++ )
7171 {
7272 BSL_SecResult_t * sec_result = BSLB_SecResultList_get (self -> results , index );
7373 BSL_Log_DumpAsHexString ((uint8_t * )str , sizeof (str ), sec_result -> _bytes , sec_result -> _bytelen );
74- BSL_LOG_INFO ("ASB Result[%lu ]: tgt=%lu , id=%lu %s" , index , sec_result -> target_block_num , sec_result -> result_id ,
75- str );
74+ BSL_LOG_INFO ("ASB Result[%zu ]: tgt=%" PRIu64 " , id=%" PRIu64 " %s" , index , sec_result -> target_block_num ,
75+ sec_result -> result_id , str );
7676 }
7777}
7878
@@ -86,7 +86,7 @@ void BSL_AbsSecBlock_InitEmpty(BSL_AbsSecBlock_t *self)
8686 uint64_list_init (self -> targets );
8787}
8888
89- void BSL_AbsSecBlock_Init (BSL_AbsSecBlock_t * self , uint64_t sec_context_id , BSL_HostEID_t source_eid )
89+ void BSL_AbsSecBlock_Init (BSL_AbsSecBlock_t * self , int64_t sec_context_id , BSL_HostEID_t source_eid )
9090{
9191 ASSERT_ARG_NONNULL (self );
9292 memset (self , 0 , sizeof (* self ));
@@ -249,7 +249,7 @@ ssize_t BSL_AbsSecBlock_EncodeToCBOR(const BSL_AbsSecBlock_t *self, UsefulBuf bu
249249 }
250250
251251 {
252- QCBOREncode_AddUInt64 (& encoder , self -> sec_context_id );
252+ QCBOREncode_AddInt64 (& encoder , self -> sec_context_id );
253253 }
254254
255255 {
@@ -347,7 +347,8 @@ int BSL_AbsSecBlock_DecodeFromCBOR(BSL_AbsSecBlock_t *self, BSL_Data_t encoded_c
347347 QCBORDecode_GetUInt64 (& asbdec , & tgt_num );
348348 BSL_LOG_DEBUG ("got tgt %" PRIu64 "" , tgt_num );
349349 uint64_list_push_back (self -> targets , tgt_num );
350- assert (quit ++ < 20 );
350+ // TODO better error handling
351+ ASSERT_PROPERTY (quit ++ < 20 );
351352 }
352353 QCBORDecode_ExitArray (& asbdec );
353354
@@ -393,7 +394,7 @@ int BSL_AbsSecBlock_DecodeFromCBOR(BSL_AbsSecBlock_t *self, BSL_Data_t encoded_c
393394 {
394395 uint64_t param_u64_value = 0 ;
395396 QCBORDecode_GetUInt64 (& asbdec , & param_u64_value );
396- BSL_LOG_DEBUG ("ASB: Parsed Param[%lu ] = %lu" , item_id , param_u64_value );
397+ BSL_LOG_DEBUG ("ASB: Parsed Param[%" PRIu64 " ] = %" PRIu64 , item_id , param_u64_value );
397398 BSL_SecParam_t param ;
398399 BSL_SecParam_InitInt64 (& param , item_id , param_u64_value );
399400 BSLB_SecParamList_push_back (self -> params , param );
@@ -402,7 +403,7 @@ int BSL_AbsSecBlock_DecodeFromCBOR(BSL_AbsSecBlock_t *self, BSL_Data_t encoded_c
402403 {
403404 UsefulBufC target_buf ;
404405 QCBORDecode_GetByteString (& asbdec , & target_buf );
405- BSL_LOG_DEBUG ("ASB: Parsed Param[%lu ] (ByteStr) = %lu bytes" , item_id , target_buf .len );
406+ BSL_LOG_DEBUG ("ASB: Parsed Param[%" PRIu64 " ] (ByteStr) = %zu bytes" , item_id , target_buf .len );
406407 BSL_SecParam_t param ;
407408 BSL_Data_t data_view = { .owned = 0 , .ptr = (uint8_t * )target_buf .ptr , .len = target_buf .len };
408409 BSL_SecParam_InitBytestr (& param , item_id , data_view );
@@ -440,7 +441,7 @@ int BSL_AbsSecBlock_DecodeFromCBOR(BSL_AbsSecBlock_t *self, BSL_Data_t encoded_c
440441 }
441442 result_index ++ ;
442443
443- BSL_LOG_DEBUG ("Parsing ASB results for target[index=%lu , block#=%lu ]" , result_index , target_id );
444+ BSL_LOG_DEBUG ("Parsing ASB results for target[index=%zu , block#=%zu ]" , result_index , target_id );
444445
445446 // variable length array of results
446447 QCBORDecode_EnterArray (& asbdec , NULL );
@@ -465,7 +466,7 @@ int BSL_AbsSecBlock_DecodeFromCBOR(BSL_AbsSecBlock_t *self, BSL_Data_t encoded_c
465466 BSL_SecResult_t result ;
466467 int result_code = BSL_SecResult_Init (& result , item_id , self -> sec_context_id , target_id , bufdata );
467468 ASSERT_PROPERTY (result_code == 0 );
468- BSL_LOG_DEBUG ("ASB: Parsed Result (target_block=%lu , len=%lu )" , result .target_block_num ,
469+ BSL_LOG_DEBUG ("ASB: Parsed Result (target_block=%" PRIu64 " , len=%zu )" , result .target_block_num ,
469470 result ._bytelen );
470471 BSLB_SecResultList_push_back (self -> results , result );
471472 }
0 commit comments