Skip to content

Commit b3dc949

Browse files
committed
#211-fix c++ and c standards for every projects, configurations and platforms
Done. Validated. Led to a type casting fixing for 32-bits architectures.
1 parent 96ccdf7 commit b3dc949

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cpp-strings/cppstrings.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ namespace pcs // i.e. "pythonic c++ strings"
10811081
if (slice.step() == 1) {
10821082
slice.begin(*this);
10831083
if (slice.start() < slice.stop())
1084-
return this->substr(slice.start(), slice.stop() - slice.start() + 1);
1084+
return this->substr(size_type(slice.start()), size_type(slice.stop() - slice.start() + 1));
10851085
else
10861086
return CppStringT();
10871087
}
@@ -1092,15 +1092,15 @@ namespace pcs // i.e. "pythonic c++ strings"
10921092
if (slice.step() == -1) {
10931093
slice.begin(*this);
10941094
if (slice.stop() < slice.start()) {
1095-
res = this->substr(slice.stop(), slice.start() - slice.stop() + 1);
1095+
res = this->substr(size_type(slice.stop()), size_type(slice.start() - slice.stop() + 1));
10961096
std::ranges::reverse(res); // notice: may use vectorization if available
10971097
}
10981098
return res;
10991099
}
11001100

11011101
// finally, no trivial optimization -- and naive implementation...
11021102
for (slice.begin(*this); !slice.end(); ++slice)
1103-
res += (*this)[*slice];
1103+
res += (*this)[size_type(*slice)];
11041104

11051105
return res;
11061106
}

0 commit comments

Comments
 (0)