...
 
Commits (7)
......@@ -6,7 +6,7 @@
language: generic
dist: trusty
dist: xenial
#-----------------------------------------------------------------------------
......@@ -18,23 +18,21 @@ addons_shortcuts:
packages: [ 'libprotobuf-dev','protobuf-compiler', 'clang-3.5' ]
addons_clang38: &clang38
apt:
sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.8' ]
packages: [ 'libprotobuf-dev','protobuf-compiler', 'clang-3.8' ]
addons_clang39: &clang39
apt:
sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.9' ]
packages: [ 'libprotobuf-dev','protobuf-compiler', 'clang-3.9' ]
addons_clang40: &clang40
apt:
sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0' ]
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'libprotobuf-dev','protobuf-compiler', 'clang-4.0' ]
addons_clang50: &clang50
apt:
sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0' ]
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'libprotobuf-dev','protobuf-compiler', 'clang-5.0' ]
addons_clang60: &clang60
apt:
sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0' ]
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'libprotobuf-dev','protobuf-compiler', 'clang-6.0', 'clang-tidy-6.0' ]
addons_gcc47: &gcc47
apt:
......@@ -68,97 +66,118 @@ matrix:
- os: linux
compiler: "clang-3.5"
env: BUILD='Debug' CC=clang-3.5 CXX=clang++-3.5
dist: trusty
addons: *clang35
- os: linux
compiler: "clang-3.8"
env: BUILD='Debug' CC=clang-3.8 CXX=clang++-3.8
addons: *clang38
- os: linux
compiler: "clang-3.9"
env: BUILD='Debug' CC=clang-3.9 CXX=clang++-3.9
addons: *clang39
- os: linux
compiler: "clang-4.0"
env: BUILD='Debug' CC=clang-4.0 CXX=clang++-4.0
addons: *clang40
- os: linux
compiler: "clang-5.0"
env: BUILD='Debug' CC=clang-5.0 CXX=clang++-5.0
addons: *clang50
- os: linux
compiler: "clang-6.0"
env: BUILD='Debug' CC=clang-6.0 CXX=clang++-6.0
CLANG_TIDY=clang-tidy-6.0
addons: *clang60
- os: linux
compiler: "clang-6.0"
env: BUILD='Release' CC=clang-6.0 CXX=clang++-6.0
addons: *clang60
- os: linux
compiler: "clang-6.0"
env: BUILD='Debug' CC=clang-6.0 CXX=clang++-6.0
CXXFLAGS="-fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer"
LDFLAGS="-fsanitize=address,undefined,integer"
addons: *clang60
- os: linux
compiler: "clang-6.0"
env: BUILD='Release' CC=clang-6.0 CXX=clang++-6.0
addons: *clang60
- os: linux
compiler: "gcc-4.7"
env: BUILD='Debug' CC=gcc-4.7 CXX=g++-4.7
dist: trusty
addons: *gcc47
- os: linux
compiler: "gcc-4.8"
env: BUILD='Debug' CC=gcc-4.8 CXX=g++-4.8
dist: trusty
addons: *gcc48
- os: linux
compiler: "gcc-4.9"
env: BUILD='Debug' CC=gcc-4.9 CXX=g++-4.9
COVERAGE=gcov-4.9
CXXFLAGS="--coverage" LDFLAGS="--coverage"
dist: trusty
addons: *gcc49
- os: linux
compiler: "gcc-5"
env: BUILD='Debug' CC=gcc-5 CXX=g++-5
CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
dist: trusty
addons: *gcc5
- os: linux
compiler: "gcc-5"
env: BUILD='Debug' CC=gcc-5 CXX=g++-5
CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"
addons: *gcc5
- os: linux
compiler: "gcc-6"
env: BUILD='Debug' CC=gcc-6 CXX=g++-6
addons: *gcc6
- os: linux
compiler: "gcc-6"
env: BUILD='Debug' CC=gcc-6 CXX=g++-6
PROTOZERO_DATA_VIEW=std::experimental::string_view
addons: *gcc6
- os: linux
compiler: "gcc-6"
env: BUILD='Release' CC=gcc-6 CXX=g++-6
addons: *gcc6
compiler: "gcc-7"
env: BUILD='Debug' CC=gcc-7 CXX=g++-7
COVERAGE=gcov-7
CXXFLAGS="--coverage" LDFLAGS="--coverage"
addons: *gcc7
- os: linux
compiler: "gcc-7"
env: BUILD='Debug' CC=gcc-7 CXX=g++-7
PROTOZERO_DATA_VIEW=std::experimental::string_view
addons: *gcc7
- os: osx
osx_image: xcode7.3
compiler: clang
env: BUILD='Debug'
- os: linux
compiler: "gcc-7"
env: BUILD='Release' CC=gcc-7 CXX=g++-7
addons: *gcc7
- os: osx
osx_image: xcode8.3
compiler: clang
env: BUILD='Debug'
- os: osx
osx_image: xcode9.4
compiler: clang
env: BUILD='Debug'
- os: osx
osx_image: xcode9.4
osx_image: xcode10.1
compiler: clang
env: BUILD='Release'
env: BUILD='Debug'
- os: osx
osx_image: xcode10
osx_image: xcode10.1
compiler: clang
env: BUILD='Release'
......
......@@ -15,6 +15,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
## [1.6.5] - 2018-02-05
### Fixed
- Avoid UB: Do not calculate pointer outside array bounds.
- Specify proto2 syntax in .proto files to appease protoc.
## [1.6.4] - 2018-11-08
### Added
......@@ -331,7 +339,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Make pbf reader and writer code endianess-aware.
[unreleased]: https://github.com/osmcode/libosmium/compare/v1.6.4...HEAD
[unreleased]: https://github.com/osmcode/libosmium/compare/v1.6.5...HEAD
[1.6.5]: https://github.com/osmcode/libosmium/compare/v1.6.4...v1.6.5
[1.6.4]: https://github.com/osmcode/libosmium/compare/v1.6.3...v1.6.4
[1.6.3]: https://github.com/osmcode/libosmium/compare/v1.6.2...v1.6.3
[1.6.2]: https://github.com/osmcode/libosmium/compare/v1.6.1...v1.6.2
......
......@@ -14,7 +14,7 @@ project(protozero)
set(PROTOZERO_VERSION_MAJOR 1)
set(PROTOZERO_VERSION_MINOR 6)
set(PROTOZERO_VERSION_PATCH 4)
set(PROTOZERO_VERSION_PATCH 5)
set(PROTOZERO_VERSION
"${PROTOZERO_VERSION_MAJOR}.${PROTOZERO_VERSION_MINOR}.${PROTOZERO_VERSION_PATCH}")
......@@ -26,7 +26,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(WERROR "Add -Werror flag to build (turns warnings into errors)" ON)
if(MSVC)
add_definitions(-std=c++11 /W3)
add_definitions(/W3)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
else()
add_definitions(-std=c++11 -Wall -Wextra -pedantic -Wsign-compare -Wunused-parameter -Wno-float-equal -Wno-covered-switch-default)
......
......@@ -24,6 +24,9 @@ environment:
autocrlf: false
- config: RelWithDebInfo
autocrlf: false
- config: Debug
autocrlf: false
platform: x86
#-----------------------------------------------------------------------------
......@@ -36,17 +39,32 @@ init:
# halts: "msys2-runtime and catgets are in conflict. Remove catgets?"
# See also: https://github.com/Alexpux/MSYS2-packages/issues/1141
install:
- if [%config%]==[MSYS2] (
C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade --ask=20
&& C:\msys64\usr\bin\pacman -Rc --noconfirm mingw-w64-x86_64-gcc-libs
- if "%config%"=="MSYS2" (
set "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%" &&
pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade --ask=20 &&
pacman -Rc --noconfirm mingw-w64-x86_64-gcc-libs &&
pacman -S --needed --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-doxygen mingw-w64-x86_64-protobuf
)
build_script:
- if [%config%]==[MSYS2] (
build-msys2.bat
- cd c:\projects\protozero
- mkdir build
- cd build
- if "%platform%"=="x64" (
set vcvarsall_arg=amd64
) else (
set vcvarsall_arg=x86
)
- if "%config%"=="MSYS2" (
cmake .. -LA -G "MSYS Makefiles" &&
make VERBOSE=1
) else (
build-appveyor.bat
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall" %vcvarsall_arg% &&
cmake .. -LA -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%config% &&
nmake VERBOSE=1
)
test_script:
- ctest --output-on-failure
#-----------------------------------------------------------------------------
@ECHO OFF
SETLOCAL
SET EL=0
ECHO ~~~~~~ %~f0 ~~~~~~
::show all available env vars
SET
ECHO cmake on AppVeyor
cmake -version
ECHO activating VS cmd prompt && CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST build ECHO deleting build dir... && RD /Q /S build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD build
ECHO config^: %config%
SET CMAKE_CMD=cmake .. ^
-LA -G "Visual Studio 15 2017 Win64"
ECHO calling^: %CMAKE_CMD%
%CMAKE_CMD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET avlogger=
IF /I "%APPVEYOR%"=="True" SET avlogger=/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
msbuild protozero.sln ^
/p:Configuration=%config% ^
%avlogger%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ctest --output-on-failure ^
-C %config% ^
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
GOTO DONE
:ERROR
ECHO ~~~~~~ ERROR %~f0 ~~~~~~
SET EL=%ERRORLEVEL%
:DONE
IF %EL% NEQ 0 ECHO. && ECHO !!! ERRORLEVEL^: %EL% !!! && ECHO.
ECHO ~~~~~~ DONE %~f0 ~~~~~~
EXIT /b %EL%
@ECHO OFF
SETLOCAL
SET EL=0
ECHO =========== %~f0 ===========
SET VERBOSITY_MSBUILD=diagnostic
IF NOT "%1"=="" SET VERBOSITY_MSBUILD=%1
SET platform=x64
SET configuration=Release
CALL build-appveyor.bat %VERBOSITY_MSBUILD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET platform=x86
SET configuration=Debug
CALL build-appveyor.bat %VERBOSITY_MSBUILD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
GOTO DONE
:ERROR
ECHO =========== ERROR %~f0 ===========
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%
:DONE
ECHO =========== DONE %~f0 ===========
EXIT /b %EL%
echo "Adding MSYS2 to path..."
SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
echo %PATH%
echo "Installing MSYS2 packages..."
bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-doxygen mingw-w64-x86_64-protobuf"
echo "Generating makefiles"
mkdir build
cd build
cmake .. -LA -G "MSYS Makefiles"
echo "Building"
make VERBOSE=1
echo "Testing"
ctest --output-on-failure
protozero (1.6.5-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
-- Bas Couwenberg <sebastic@debian.org> Tue, 12 Feb 2019 06:52:35 +0100
protozero (1.6.5-1) unstable; urgency=medium
* New upstream release.
* Bump Standards-Version to 4.3.0, no changes.
-- Bas Couwenberg <sebastic@debian.org> Wed, 06 Feb 2019 16:25:11 +0100
protozero (1.6.4-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
......
......@@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9),
libprotobuf-dev,
protobuf-compiler,
pkg-config
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/debian-gis-team/protozero/
Vcs-Git: https://salsa.debian.org/debian-gis-team/protozero.git -b stretch-backports
Homepage: https://github.com/mapbox/protozero
......
......@@ -55,8 +55,8 @@ public:
* @param length Length of the data.
*/
constexpr data_view(const char* ptr, std::size_t length) noexcept
: m_data(ptr),
m_size(length) {
: m_data{ptr},
m_size{length} {
}
/**
......@@ -65,8 +65,8 @@ public:
* @param str String with the data.
*/
data_view(const std::string& str) noexcept // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
: m_data(str.data()),
m_size(str.size()) {
: m_data{str.data()},
m_size{str.size()} {
}
/**
......@@ -75,8 +75,8 @@ public:
* @param ptr Pointer to the data.
*/
data_view(const char* ptr) noexcept // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
: m_data(ptr),
m_size(std::strlen(ptr)) {
: m_data{ptr},
m_size{std::strlen(ptr)} {
}
/**
......
......@@ -56,7 +56,7 @@ public:
* Default constructor. Create empty iterator_range.
*/
constexpr iterator_range() :
P(iterator{}, iterator{}) {
P{iterator{}, iterator{}} {
}
/**
......@@ -66,8 +66,8 @@ public:
* @param last_iterator Iterator to end of range.
*/
constexpr iterator_range(iterator&& first_iterator, iterator&& last_iterator) :
P(std::forward<iterator>(first_iterator),
std::forward<iterator>(last_iterator)) {
P{std::forward<iterator>(first_iterator),
std::forward<iterator>(last_iterator)} {
}
/// Return iterator to beginning of range.
......@@ -175,7 +175,7 @@ public:
const_fixed_iterator() noexcept = default;
explicit const_fixed_iterator(const char* data) noexcept :
m_data(data) {
m_data{data} {
}
const_fixed_iterator(const const_fixed_iterator&) noexcept = default;
......@@ -323,8 +323,8 @@ public:
const_varint_iterator() noexcept = default;
const_varint_iterator(const char* data, const char* end) noexcept :
m_data(data),
m_end(end) {
m_data{data},
m_end{end} {
}
const_varint_iterator(const const_varint_iterator&) noexcept = default;
......@@ -384,11 +384,11 @@ public:
using reference = value_type&;
const_svarint_iterator() noexcept :
const_varint_iterator<T>() {
const_varint_iterator<T>{} {
}
const_svarint_iterator(const char* data, const char* end) noexcept :
const_varint_iterator<T>(data, end) {
const_varint_iterator<T>{data, end} {
}
const_svarint_iterator(const const_svarint_iterator&) = default;
......
......@@ -55,7 +55,7 @@ public:
* doesn't have to be empty. The pbf_message object will just append data.
*/
explicit pbf_builder(std::string& data) noexcept :
pbf_writer(data) {
pbf_writer{data} {
}
/**
......@@ -67,7 +67,7 @@ public:
*/
template <typename P>
pbf_builder(pbf_writer& parent_writer, P tag) noexcept :
pbf_writer(parent_writer, pbf_tag_type(tag)) {
pbf_writer{parent_writer, pbf_tag_type(tag)} {
}
/// @cond INTERNAL
......
......@@ -78,7 +78,7 @@ public:
*/
template <typename... Args>
pbf_message(Args&&... args) noexcept : // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
pbf_reader(std::forward<Args>(args)...) {
pbf_reader{std::forward<Args>(args)...} {
}
/**
......
......@@ -153,8 +153,8 @@ public:
* @post There is no current field.
*/
explicit pbf_reader(const data_view& view) noexcept
: m_data(view.data()),
m_end(view.data() + view.size()) {
: m_data{view.data()},
m_end{view.data() + view.size()} {
}
/**
......@@ -168,8 +168,8 @@ public:
* @post There is no current field.
*/
pbf_reader(const char* data, std::size_t size) noexcept
: m_data(data),
m_end(data + size) {
: m_data{data},
m_end{data + size} {
}
#ifndef PROTOZERO_STRICT_API
......@@ -185,8 +185,8 @@ public:
* @deprecated Use one of the other constructors.
*/
explicit pbf_reader(const std::pair<const char*, std::size_t>& data) noexcept
: m_data(data.first),
m_end(data.first + data.second) {
: m_data{data.first},
m_end{data.first + data.second} {
}
#endif
......@@ -201,8 +201,8 @@ public:
* @post There is no current field.
*/
explicit pbf_reader(const std::string& data) noexcept
: m_data(data.data()),
m_end(data.data() + data.size()) {
: m_data{data.data()},
m_end{data.data() + data.size()} {
}
/**
......
......@@ -227,7 +227,7 @@ public:
* doesn't have to be empty. The pbf_writer will just append data.
*/
explicit pbf_writer(std::string& data) noexcept :
m_data(&data) {
m_data{&data} {
}
/**
......@@ -247,8 +247,8 @@ public:
* a few very specific cases.
*/
pbf_writer(pbf_writer& parent_writer, pbf_tag_type tag, std::size_t size=0) :
m_data(parent_writer.m_data),
m_parent_writer(&parent_writer) {
m_data{parent_writer.m_data},
m_parent_writer{&parent_writer} {
m_parent_writer->open_submessage(tag, size);
}
......@@ -263,10 +263,10 @@ public:
* be invalid.
*/
pbf_writer(pbf_writer&& other) noexcept :
m_data(other.m_data),
m_parent_writer(other.m_parent_writer),
m_rollback_pos(other.m_rollback_pos),
m_pos(other.m_pos) {
m_data{other.m_data},
m_parent_writer{other.m_parent_writer},
m_rollback_pos{other.m_rollback_pos},
m_pos{other.m_pos} {
other.m_data = nullptr;
other.m_parent_writer = nullptr;
other.m_rollback_pos = 0;
......@@ -941,11 +941,11 @@ namespace detail {
packed_field() = default;
packed_field(pbf_writer& parent_writer, pbf_tag_type tag) :
m_writer(parent_writer, tag) {
m_writer{parent_writer, tag} {
}
packed_field(pbf_writer& parent_writer, pbf_tag_type tag, std::size_t size) :
m_writer(parent_writer, tag, size) {
m_writer{parent_writer, tag, size} {
}
~packed_field() noexcept = default;
......@@ -970,17 +970,17 @@ namespace detail {
public:
packed_field_fixed() :
packed_field() {
packed_field{} {
}
template <typename P>
packed_field_fixed(pbf_writer& parent_writer, P tag) :
packed_field(parent_writer, static_cast<pbf_tag_type>(tag)) {
packed_field{parent_writer, static_cast<pbf_tag_type>(tag)} {
}
template <typename P>
packed_field_fixed(pbf_writer& parent_writer, P tag, std::size_t size) :
packed_field(parent_writer, static_cast<pbf_tag_type>(tag), size * sizeof(T)) {
packed_field{parent_writer, static_cast<pbf_tag_type>(tag), size * sizeof(T)} {
}
void add_element(T value) {
......@@ -995,12 +995,12 @@ namespace detail {
public:
packed_field_varint() :
packed_field() {
packed_field{} {
}
template <typename P>
packed_field_varint(pbf_writer& parent_writer, P tag) :
packed_field(parent_writer, static_cast<pbf_tag_type>(tag)) {
packed_field{parent_writer, static_cast<pbf_tag_type>(tag)} {
}
void add_element(T value) {
......@@ -1015,12 +1015,12 @@ namespace detail {
public:
packed_field_svarint() :
packed_field() {
packed_field{} {
}
template <typename P>
packed_field_svarint(pbf_writer& parent_writer, P tag) :
packed_field(parent_writer, static_cast<pbf_tag_type>(tag)) {
packed_field{parent_writer, static_cast<pbf_tag_type>(tag)} {
}
void add_element(T value) {
......
......@@ -118,7 +118,7 @@ inline void skip_varint(const char** data, const char* end) {
++p;
}
if (p >= begin + max_varint_length) {
if (p - begin >= max_varint_length) {
throw varint_too_long_exception{};
}
......
......@@ -23,12 +23,12 @@ documentation.
#define PROTOZERO_VERSION_MINOR 6
/// The patch number
#define PROTOZERO_VERSION_PATCH 4
#define PROTOZERO_VERSION_PATCH 5
/// The complete version number
#define PROTOZERO_VERSION_CODE (PROTOZERO_VERSION_MAJOR * 10000 + PROTOZERO_VERSION_MINOR * 100 + PROTOZERO_VERSION_PATCH)
/// Version number as string
#define PROTOZERO_VERSION_STRING "1.6.4"
#define PROTOZERO_VERSION_STRING "1.6.5"
#endif // PROTOZERO_VERSION_HPP
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
......