Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 3f1b6d3

Browse files
authored
Merge pull request #731 from lukaszstolarczuk/merge-stable1.8-to-stable1.9
Merge stable-1.8 into stable-1.9
2 parents 0be10b8 + 2e262d8 commit 3f1b6d3

File tree

12 files changed

+104
-260
lines changed

12 files changed

+104
-260
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ if(BUILD_TESTS OR BUILD_EXAMPLES)
167167
find_package(LIBPMEM REQUIRED ${LIBPMEM_REQUIRED_VERSION})
168168
endif()
169169

170-
if (LIBPMEMOBJ_VERSION)
170+
if (LIBPMEMOBJ_VERSION AND LIBPMEMOBJ_VERSION MATCHES "[0-9]+[.][0-9]+.*")
171171
string(REGEX REPLACE "\\+git.*" "" LIBPMEMOBJ_VERSION_SHORT ${LIBPMEMOBJ_VERSION})
172172
string(REGEX REPLACE "-rc.*" "" LIBPMEMOBJ_VERSION_SHORT ${LIBPMEMOBJ_VERSION_SHORT})
173173
string(REPLACE "." ";" VERSION_LIST ${LIBPMEMOBJ_VERSION_SHORT})

include/libpmemobj++/container/detail/contiguous_iterator.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2019, Intel Corporation
2+
* Copyright 2018-2020, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -175,7 +175,7 @@ struct contiguous_iterator {
175175
/**
176176
* Element access operator.
177177
*/
178-
Reference operator[](std::size_t n)
178+
Reference operator[](std::ptrdiff_t n)
179179
{
180180
return ptr[n];
181181
}
@@ -259,7 +259,7 @@ struct range_snapshotting_iterator
259259
*
260260
* Adds element to a transaction.
261261
*/
262-
reference operator[](std::size_t n)
262+
reference operator[](std::ptrdiff_t n)
263263
{
264264
detail::conditional_add_to_tx(&this->ptr[n], 1,
265265
POBJ_XADD_ASSUME_INITIALIZED);
@@ -409,7 +409,7 @@ struct basic_contiguous_iterator
409409
*
410410
* Adds range containing specified element to a transaction.
411411
*/
412-
reference operator[](std::size_t n)
412+
reference operator[](std::ptrdiff_t n)
413413
{
414414
detail::conditional_add_to_tx(&this->ptr[n], 1,
415415
POBJ_XADD_ASSUME_INITIALIZED);

include/libpmemobj++/slice.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ class slice {
134134
if (idx >= size())
135135
throw std::out_of_range("pmem::obj::slice");
136136

137-
return it_begin[idx];
137+
return it_begin[static_cast<typename std::iterator_traits<
138+
Iterator>::difference_type>(idx)];
138139
}
139140

140141
/**
@@ -143,7 +144,8 @@ class slice {
143144
*/
144145
reference operator[](size_type idx)
145146
{
146-
return it_begin[idx];
147+
return it_begin[static_cast<typename std::iterator_traits<
148+
Iterator>::difference_type>(idx)];
147149
}
148150

149151
size_type

tests/array_iterator/array_iterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2019, Intel Corporation
2+
* Copyright 2018-2020, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -64,7 +64,7 @@ struct Test1 {
6464

6565
swap(it, it2);
6666

67-
it2[c.size() - 1] = 10;
67+
it2[static_cast<std::ptrdiff_t>(c.size() - 1)] = 10;
6868
it[20] = 20;
6969

7070
UT_ASSERT(c[c.size() - 1] == 10);

tests/concurrent_hash_map_pmreorder_insert_erase_mt/concurrent_hash_map_pmreorder_insert_erase_mt.cpp

Lines changed: 0 additions & 236 deletions
This file was deleted.

utils/docker/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#
4545

4646
set -e
47+
source $(dirname $0)/valid-branches.sh
4748

4849
# Environment variables that can be customized (default values are after dash):
4950
export KEEP_CONTAINER=${KEEP_CONTAINER:-0}
@@ -112,8 +113,8 @@ fi
112113

113114
if [ -n "$DNS_SERVER" ]; then DNS_SETTING=" --dns=$DNS_SERVER "; fi
114115

115-
# Only run doc update on pmem/libpmemobj-cpp master branch
116-
if [[ "$TRAVIS_BRANCH" != "master" || "$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_REPO_SLUG" != "${GITHUB_REPO}" ]]; then
116+
# Only run doc update on $GITHUB_REPO master or stable branch
117+
if [[ -z "${TRAVIS_BRANCH}" || -z "${TARGET_BRANCHES[${TRAVIS_BRANCH}]}" || "$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_REPO_SLUG" != "${GITHUB_REPO}" ]]; then
117118
AUTO_DOC_UPDATE=0
118119
fi
119120

utils/docker/images/Dockerfile.fedora-rawhide

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
FROM fedora:rawhide
3939
MAINTAINER szymom.romik@intel.com
4040

41+
# Additional parameters to build docker without building components
42+
ARG SKIP_VALGRIND_BUILD
43+
ARG SKIP_PMDK_BUILD
44+
4145
# Install basic tools
4246
RUN dnf update -y \
4347
&& dnf install -y \

utils/docker/images/Dockerfile.ubuntu-19.10

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
FROM ubuntu:19.10
3939
MAINTAINER szymon.romik@intel.com
4040

41+
# Additional parameters to build docker without building components
42+
ARG SKIP_VALGRIND_BUILD
43+
ARG SKIP_PMDK_BUILD
44+
4145
ENV DEBIAN_FRONTEND noninteractive
4246

4347
# Update the Apt cache and install basic tools

utils/docker/images/install-pmdk.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ PACKAGE_MANAGER=$1
4141
# tag: 1.8, 31.01.2020
4242
PMDK_VERSION="1.8"
4343

44+
if [ "${SKIP_PMDK_BUILD}" ]; then
45+
echo "Variable 'SKIP_PMDK_BUILD' is set; skipping building PMDK"
46+
exit
47+
fi
48+
4449
git clone https://github.com/pmem/pmdk
4550
cd pmdk
4651
git checkout $PMDK_VERSION

utils/docker/images/install-valgrind.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636

3737
set -e
3838

39+
if [ "${SKIP_VALGRIND_BUILD}" ]; then
40+
echo "Variable 'SKIP_VALGRIND_BUILD' is set; skipping building valgrind (pmem's fork)"
41+
exit
42+
fi
43+
3944
git clone --recursive https://github.com/pmem/valgrind.git
4045
cd valgrind
4146
# pmem-3.15: Merge pull request #73 from kkajrewicz/fix-memcheck

0 commit comments

Comments
 (0)