From 10f8a545a5c822ad79daa6ceb86cb52a4f28626e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 15 Mar 2023 10:44:30 +0000 Subject: [PATCH] remove uint8_t from _print --- TODO | 7 ------- include/dicom/dicom.h | 4 ++-- src/dicom-data.c | 12 ++++++------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/TODO b/TODO index c5d3d6b..6b798c8 100644 --- a/TODO +++ b/TODO @@ -2,8 +2,6 @@ - need to be able to set a stop-at function on filehandles -- rename DcmDataSet as DcmDataset - # bot support @@ -32,11 +30,6 @@ no, it's unsigned int -- dcm_dataset_print() should not use uint8_t - - - instead, the caller should free on error ... how easy would this be to change? - # asserts diff --git a/include/dicom/dicom.h b/include/dicom/dicom.h index 45e3694..dc46b53 100644 --- a/include/dicom/dicom.h +++ b/include/dicom/dicom.h @@ -858,7 +858,7 @@ bool dcm_element_set_value_sequence(DcmError **error, * :param indentation: Number of white spaces before text */ DCM_EXTERN -void dcm_element_print(const DcmElement *element, uint8_t indentation); +void dcm_element_print(const DcmElement *element, int indentation); /** * Destroy a Data Element. @@ -1026,7 +1026,7 @@ bool dcm_dataset_is_locked(const DcmDataSet *dataset); * :param indentation: Number of white spaces before text */ DCM_EXTERN -void dcm_dataset_print(const DcmDataSet *dataset, uint8_t indentation); +void dcm_dataset_print(const DcmDataSet *dataset, int indentation); /** * Destroy a Data Set. diff --git a/src/dicom-data.c b/src/dicom-data.c index 76edfbc..6b4db6d 100644 --- a/src/dicom-data.c +++ b/src/dicom-data.c @@ -179,8 +179,8 @@ DcmElement *dcm_element_create(DcmError **error, uint32_t tag, DcmVR vr) if (!dcm_is_valid_vr_for_tag(vr, tag)) { dcm_error_set(error, DCM_ERROR_CODE_INVALID, "Incorrect tag", - "Element tag %08X does not allow VR %s", - element->tag, + "Tag %08X does not allow VR %s", + tag, dcm_dict_str_from_vr(vr)); return NULL; } @@ -1122,11 +1122,11 @@ static void element_print_string(const DcmElement *element, } -void dcm_element_print(const DcmElement *element, uint8_t indentation) +void dcm_element_print(const DcmElement *element, int indentation) { DcmVRClass klass = dcm_dict_vr_class(element->vr); - const uint8_t num_indent = indentation * 2; - const uint8_t num_indent_next = (indentation + 1) * 2; + const int num_indent = indentation * 2; + const int num_indent_next = (indentation + 1) * 2; uint32_t i; @@ -1383,7 +1383,7 @@ void dcm_dataset_copy_tags(const DcmDataSet *dataset, } -void dcm_dataset_print(const DcmDataSet *dataset, uint8_t indentation) +void dcm_dataset_print(const DcmDataSet *dataset, int indentation) { uint32_t i; DcmElement *element;