From 94d4a8db6e34c79ff2867f00f460a1b75998a1be Mon Sep 17 00:00:00 2001 From: hxy7yx <1595670487@qq.com> Date: Tue, 9 Apr 2024 15:44:56 +0800 Subject: [PATCH] determine whether tag(string) set endianness --- .github/workflows/check.yml | 4 ++-- include/neuron/tag.h | 1 + src/base/tag.c | 15 ++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ec3842bb..fc707f0f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -74,7 +74,7 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} directory: ./cov_report/ - files: cov-ut.info + files: ./cov_report/cov-ut.info pft: runs-on: ubuntu-20.04 @@ -135,4 +135,4 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} directory: ./cov_report/ - files: cov-${{ matrix.plugin }}.info + files: ./cov_report/cov-${{ matrix.plugin }}.info diff --git a/include/neuron/tag.h b/include/neuron/tag.h index 044ee05c..e4055f7e 100644 --- a/include/neuron/tag.h +++ b/include/neuron/tag.h @@ -67,6 +67,7 @@ typedef union { struct { uint16_t length; neu_datatag_string_type_e type; + bool is_default; } string; struct { diff --git a/src/base/tag.c b/src/base/tag.c index 1c6e0d1d..4d1e60e1 100644 --- a/src/base/tag.c +++ b/src/base/tag.c @@ -161,19 +161,24 @@ int neu_datatag_parse_addr_option(const neu_datatag_t * datatag, switch (t) { case 'H': - option->string.type = NEU_DATATAG_STRING_TYPE_H; + option->string.type = NEU_DATATAG_STRING_TYPE_H; + option->string.is_default = false; break; case 'L': - option->string.type = NEU_DATATAG_STRING_TYPE_L; + option->string.type = NEU_DATATAG_STRING_TYPE_L; + option->string.is_default = false; break; case 'D': - option->string.type = NEU_DATATAG_STRING_TYPE_D; + option->string.type = NEU_DATATAG_STRING_TYPE_D; + option->string.is_default = false; break; case 'E': - option->string.type = NEU_DATATAG_STRING_TYPE_D; + option->string.type = NEU_DATATAG_STRING_TYPE_E; + option->string.is_default = false; break; default: - option->string.type = NEU_DATATAG_STRING_TYPE_H; + option->string.type = NEU_DATATAG_STRING_TYPE_H; + option->string.is_default = true; break; }