Skip to content

Commit db48ee5

Browse files
author
Arto Kinnunen
committed
Squashed 'features/FEATURE_COMMON_PAL/nanostack-libservice/' changes from 854505d..09056ed
09056ed Merge pull request #63 from ARMmbed/apache 56472ac Change license to apache 9f70a64 Correct some types b851db9 ONME-3201: Fix compilation warning of unsigned-signed comparison. git-subtree-dir: features/FEATURE_COMMON_PAL/nanostack-libservice git-subtree-split: 09056ed2eed0ec39a2dd235f29868e9983d4a5c1
1 parent 0613e29 commit db48ee5

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

mbed-client-libservice/ns_nvm_helper.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
/*
2-
* Copyright (c) 2016 ARM Limited. All rights reserved.
3-
*/
1+
// ----------------------------------------------------------------------------
2+
// Copyright 2016-2017 ARM Ltd.
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
// ----------------------------------------------------------------------------
418

519
/**
620
* NanoStack NVM helper functions to read, write and delete key-value pairs to platform NVM.

source/nsdynmemLIB/nsdynmemLIB.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct ns_mem_book {
4646
static ns_mem_book_t *default_book; // heap pointer for original "ns_" API use
4747

4848
// size of a hole_t in our word units
49-
#define HOLE_T_SIZE ((sizeof(hole_t) + sizeof(ns_mem_word_size_t) - 1) / sizeof(ns_mem_word_size_t))
49+
#define HOLE_T_SIZE ((ns_mem_word_size_t) ((sizeof(hole_t) + sizeof(ns_mem_word_size_t) - 1) / sizeof(ns_mem_word_size_t)))
5050

5151
static NS_INLINE hole_t *hole_from_block_start(ns_mem_word_size_t *start)
5252
{
@@ -334,8 +334,8 @@ static void ns_mem_free_and_merge_with_adjacent_blocks(ns_mem_book_t *book, ns_m
334334

335335
if (start != book->heap_main) {
336336
if (*(start - 1) < 0) {
337-
int *block_end = start - 1;
338-
size_t block_size = 1 + (-*block_end) + 1;
337+
ns_mem_word_size_t *block_end = start - 1;
338+
ns_mem_word_size_t block_size = 1 + (-*block_end) + 1;
339339
merged_data_size += block_size;
340340
start -= block_size;
341341
if (*start != *block_end) {
@@ -349,8 +349,8 @@ static void ns_mem_free_and_merge_with_adjacent_blocks(ns_mem_book_t *book, ns_m
349349

350350
if (end != book->heap_main_end) {
351351
if (*(end + 1) < 0) {
352-
int *block_start = end + 1;
353-
size_t block_size = 1 + (-*block_start) + 1;
352+
ns_mem_word_size_t *block_start = end + 1;
353+
ns_mem_word_size_t block_size = 1 + (-*block_start) + 1;
354354
merged_data_size += block_size;
355355
end += block_size;
356356
if (*end != *block_start) {

source/nvmHelper/ns_nvm_helper.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
/*
2-
* Copyright (c) 2016 ARM Limited. All rights reserved.
3-
*/
1+
// ----------------------------------------------------------------------------
2+
// Copyright 2016-2017 ARM Ltd.
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
// ----------------------------------------------------------------------------
418

519
#include <string.h>
620
#include <ns_types.h>

0 commit comments

Comments
 (0)