Skip to content

Commit effaf7d

Browse files
Merge branch 'master' into dev
Signed-off-by: Thiago Macieira <[email protected]>
2 parents 33a563f + 85c9f81 commit effaf7d

File tree

7 files changed

+36
-20
lines changed

7 files changed

+36
-20
lines changed

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ os:
44
- osx
55
env:
66
- CFLAGS="-O0 -g" QMAKEFLAGS="-config debug" PATH=/opt/qt56/bin:/usr/local/opt/qt5/bin:$PATH
7+
addons:
8+
apt:
9+
sources:
10+
- sourceline: 'ppa:beineri/opt-qt563-trusty'
11+
packages:
12+
- qt56base valgrind
713
install:
8-
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
9-
sudo apt-add-repository -y ppa:beineri/opt-qt562;
10-
sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test;
11-
sudo apt-get update -qq;
12-
sudo apt-get install -y qt56base valgrind g++-5;
13-
else
14+
- if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
1415
brew install qt5;
1516
fi
1617
script:
17-
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
18-
sudo ln -sf g++-5 /usr/bin/g++;
19-
fi
2018
- make -s -f Makefile.configure configure | tee .config
2119
- make
2220
CFLAGS="$CFLAGS"

LICENSE

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Intel Corporation
4+
15
Permission is hereby granted, free of charge, to any person obtaining a copy
26
of this software and associated documentation files (the "Software"), to deal
37
in the Software without restriction, including without limitation the rights
48
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
59
copies of the Software, and to permit persons to whom the Software is
610
furnished to do so, subject to the following conditions:
711

8-
The above copyright notice and this permission notice shall be included in
9-
all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1014

1115
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1216
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1317
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1418
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1519
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17-
THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bin/cbordump: $(CBORDUMP_SOURCES:.c=.o) lib/libtinycbor.a
116116

117117
bin/json2cbor: $(JSON2CBOR_SOURCES:.c=.o) lib/libtinycbor.a
118118
@$(MKDIR) -p bin
119-
$(CC) -o $@ $(LDFLAGS) $(LDFLAGS_CJSON) $^ $(LDLIBS) -lm
119+
$(CC) -o $@ $(LDFLAGS) $^ $(LDFLAGS_CJSON) $(LDLIBS) -lm
120120

121121
tinycbor.pc: tinycbor.pc.in
122122
$(SED) > $@ < $< \

Makefile.nmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ TINYCBOR_OBJS = \
1313
src\cborerrorstrings.obj \
1414
src\cborencoder.obj \
1515
src\cborencoder_close_container_checked.obj \
16+
src\cborparser.obj \
1617
src\cborparser_dup_string.obj \
1718
src\cborpretty.obj
1819

README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Concise Binary Object Representation (CBOR) Library
2+
---------------------------------------------------
3+
4+
To build TinyCBOR:
5+
6+
make
7+
8+
If you want to change the compiler or pass extra compiler flags:
9+
10+
make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"
11+
12+
Documentation: https://01org.github.io/tinycbor/current/
13+

src/cborparser.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,11 @@ static uintptr_t iterate_memcmp(char *s1, const uint8_t *s2, size_t len)
11491149
return memcmp(s1, (const char *)s2, len) == 0;
11501150
}
11511151

1152+
static uintptr_t iterate_memcpy(char *dest, const uint8_t *src, size_t len)
1153+
{
1154+
return (uintptr_t)memcpy(dest, src, len);
1155+
}
1156+
11521157
static CborError iterate_string_chunks(const CborValue *value, char *buffer, size_t *buflen,
11531158
bool *result, CborValue *next, IterateFunction func)
11541159
{
@@ -1263,7 +1268,7 @@ CborError _cbor_value_copy_string(const CborValue *value, void *buffer,
12631268
{
12641269
bool copied_all;
12651270
CborError err = iterate_string_chunks(value, (char*)buffer, buflen, &copied_all, next,
1266-
buffer ? (IterateFunction)memcpy : iterate_noop);
1271+
buffer ? iterate_memcpy : iterate_noop);
12671272
return err ? err :
12681273
copied_all ? CborNoError : CborErrorOutOfMemory;
12691274
}

src/compilersupport_p.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@
185185
# define unreachable() do {} while (0)
186186
#endif
187187

188-
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) && \
189-
(__GNUC__ * 100 + __GNUC_MINOR__ >= 404)
190-
# pragma GCC optimize("-ffunction-sections")
191-
#endif
192-
193188
static inline bool add_check_overflow(size_t v1, size_t v2, size_t *r)
194189
{
195190
#if ((defined(__GNUC__) && (__GNUC__ >= 5)) && !defined(__INTEL_COMPILER)) || __has_builtin(__builtin_add_overflow)

0 commit comments

Comments
 (0)