Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code smells reported by SonarCloud in test code (2) #369

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# https://github.com/docker/build-push-action/issues/761
with:
driver-opts: |
image=moby/buildkit:v0.10.6

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
Expand All @@ -77,7 +73,7 @@ jobs:
type=ref,event=pr

- name: Build and push cloud-server docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand Down
16 changes: 10 additions & 6 deletions api/oc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ oc_set_mtu_size(size_t mtu_size)
(void)mtu_size;
#ifdef OC_INOUT_BUFFER_SIZE
return -1;
#endif /* OC_INOUT_BUFFER_SIZE */
#else /* !OC_INOUT_BUFFER_SIZE */
#ifdef OC_BLOCK_WISE
if (mtu_size < (COAP_MAX_HEADER_SIZE + 16))
if (mtu_size < (COAP_MAX_HEADER_SIZE + 16)) {
return -1;
}
#ifdef OC_OSCORE
_OC_MTU_SIZE = mtu_size + COAP_MAX_HEADER_SIZE;
#else /* OC_OSCORE */
Expand All @@ -135,6 +136,7 @@ oc_set_mtu_size(size_t mtu_size)
_OC_BLOCK_SIZE = ((size_t)1) << i;
#endif /* OC_BLOCK_WISE */
return 0;
#endif /* OC_INOUT_BUFFER_SIZE */
}

long
Expand All @@ -147,8 +149,8 @@ void
oc_set_max_app_data_size(size_t size)
{
#ifdef OC_APP_DATA_BUFFER_SIZE
return;
#endif /* OC_APP_DATA_BUFFER_SIZE */
(void)size;
#else /* !OC_APP_DATA_BUFFER_SIZE */
_OC_MAX_APP_DATA_SIZE = size;
#ifndef OC_REP_ENCODING_REALLOC
_OC_MIN_APP_DATA_SIZE = size;
Expand All @@ -157,6 +159,7 @@ oc_set_max_app_data_size(size_t size)
_OC_BLOCK_SIZE = size;
_OC_MTU_SIZE = size + COAP_MAX_HEADER_SIZE;
#endif /* !OC_BLOCK_WISE */
#endif /* OC_APP_DATA_BUFFER_SIZE */
}

long
Expand All @@ -169,9 +172,10 @@ void
oc_set_min_app_data_size(size_t size)
{
#if defined(OC_APP_DATA_BUFFER_SIZE) || !defined(OC_REP_ENCODING_REALLOC)
return;
#endif /* OC_APP_DATA_BUFFER_SIZE || !OC_REP_ENCODING_REALLOC */
(void)size;
#else /* !OC_APP_DATA_BUFFER_SIZE && !OC_REP_ENCODING_REALLOC */
_OC_MIN_APP_DATA_SIZE = size;
#endif /* OC_APP_DATA_BUFFER_SIZE || !OC_REP_ENCODING_REALLOC */
}

long
Expand Down
Loading