Skip to content

Commit 9334cae

Browse files
Merge branch 'main' into utf8_range_dep
2 parents b4ddcda + 9978ec3 commit 9334cae

8 files changed

+19
-37
lines changed

src/google/protobuf/io/gzip_stream.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ namespace protobuf {
5656
namespace io {
5757

5858
// A ZeroCopyInputStream that reads compressed data through zlib
59-
class PROTOBUF_EXPORT GzipInputStream PROTOBUF_FUTURE_FINAL
60-
: public ZeroCopyInputStream {
59+
class PROTOBUF_EXPORT GzipInputStream final : public ZeroCopyInputStream {
6160
public:
6261
// Format key for constructor
6362
enum Format {
@@ -105,8 +104,7 @@ class PROTOBUF_EXPORT GzipInputStream PROTOBUF_FUTURE_FINAL
105104
void DoNextOutput(const void** data, int* size);
106105
};
107106

108-
class PROTOBUF_EXPORT GzipOutputStream PROTOBUF_FUTURE_FINAL
109-
: public ZeroCopyOutputStream {
107+
class PROTOBUF_EXPORT GzipOutputStream final : public ZeroCopyOutputStream {
110108
public:
111109
// Format key for constructor
112110
enum Format {

src/google/protobuf/io/zero_copy_stream_impl.h

+9-12
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ namespace io {
6262
// The latter will introduce an extra layer of buffering, harming performance.
6363
// Also, it's conceivable that FileInputStream could someday be enhanced
6464
// to use zero-copy file descriptors on OSs which support them.
65-
class PROTOBUF_EXPORT FileInputStream PROTOBUF_FUTURE_FINAL
66-
: public ZeroCopyInputStream {
65+
class PROTOBUF_EXPORT FileInputStream final : public ZeroCopyInputStream {
6766
public:
6867
// Creates a stream that reads from the given Unix file descriptor.
6968
// If a block_size is given, it specifies the number of bytes that
@@ -98,7 +97,7 @@ class PROTOBUF_EXPORT FileInputStream PROTOBUF_FUTURE_FINAL
9897
int64_t ByteCount() const override;
9998

10099
private:
101-
class PROTOBUF_EXPORT CopyingFileInputStream PROTOBUF_FUTURE_FINAL
100+
class PROTOBUF_EXPORT CopyingFileInputStream final
102101
: public CopyingInputStream {
103102
public:
104103
CopyingFileInputStream(int file_descriptor);
@@ -141,7 +140,7 @@ class PROTOBUF_EXPORT FileInputStream PROTOBUF_FUTURE_FINAL
141140
// harming performance. Also, it's conceivable that FileOutputStream could
142141
// someday be enhanced to use zero-copy file descriptors on OSs which
143142
// support them.
144-
class PROTOBUF_EXPORT FileOutputStream PROTOBUF_FUTURE_FINAL
143+
class PROTOBUF_EXPORT FileOutputStream final
145144
: public CopyingOutputStreamAdaptor {
146145
public:
147146
// Creates a stream that writes to the given Unix file descriptor.
@@ -173,7 +172,7 @@ class PROTOBUF_EXPORT FileOutputStream PROTOBUF_FUTURE_FINAL
173172
int GetErrno() const { return copying_output_.GetErrno(); }
174173

175174
private:
176-
class PROTOBUF_EXPORT CopyingFileOutputStream PROTOBUF_FUTURE_FINAL
175+
class PROTOBUF_EXPORT CopyingFileOutputStream final
177176
: public CopyingOutputStream {
178177
public:
179178
CopyingFileOutputStream(int file_descriptor);
@@ -207,8 +206,7 @@ class PROTOBUF_EXPORT FileOutputStream PROTOBUF_FUTURE_FINAL
207206
//
208207
// Note that for reading files (or anything represented by a file descriptor),
209208
// FileInputStream is more efficient.
210-
class PROTOBUF_EXPORT IstreamInputStream PROTOBUF_FUTURE_FINAL
211-
: public ZeroCopyInputStream {
209+
class PROTOBUF_EXPORT IstreamInputStream final : public ZeroCopyInputStream {
212210
public:
213211
// Creates a stream that reads from the given C++ istream.
214212
// If a block_size is given, it specifies the number of bytes that
@@ -225,7 +223,7 @@ class PROTOBUF_EXPORT IstreamInputStream PROTOBUF_FUTURE_FINAL
225223
int64_t ByteCount() const override;
226224

227225
private:
228-
class PROTOBUF_EXPORT CopyingIstreamInputStream PROTOBUF_FUTURE_FINAL
226+
class PROTOBUF_EXPORT CopyingIstreamInputStream final
229227
: public CopyingInputStream {
230228
public:
231229
CopyingIstreamInputStream(std::istream* input);
@@ -253,8 +251,7 @@ class PROTOBUF_EXPORT IstreamInputStream PROTOBUF_FUTURE_FINAL
253251
//
254252
// Note that for writing files (or anything represented by a file descriptor),
255253
// FileOutputStream is more efficient.
256-
class PROTOBUF_EXPORT OstreamOutputStream PROTOBUF_FUTURE_FINAL
257-
: public ZeroCopyOutputStream {
254+
class PROTOBUF_EXPORT OstreamOutputStream final : public ZeroCopyOutputStream {
258255
public:
259256
// Creates a stream that writes to the given C++ ostream.
260257
// If a block_size is given, it specifies the size of the buffers
@@ -271,7 +268,7 @@ class PROTOBUF_EXPORT OstreamOutputStream PROTOBUF_FUTURE_FINAL
271268
int64_t ByteCount() const override;
272269

273270
private:
274-
class PROTOBUF_EXPORT CopyingOstreamOutputStream PROTOBUF_FUTURE_FINAL
271+
class PROTOBUF_EXPORT CopyingOstreamOutputStream final
275272
: public CopyingOutputStream {
276273
public:
277274
CopyingOstreamOutputStream(std::ostream* output);
@@ -301,7 +298,7 @@ class PROTOBUF_EXPORT OstreamOutputStream PROTOBUF_FUTURE_FINAL
301298
// ConcatenatingInputStream may do odd things. It is suggested that you do
302299
// not use ConcatenatingInputStream on streams that might produce read errors
303300
// other than end-of-stream.
304-
class PROTOBUF_EXPORT ConcatenatingInputStream PROTOBUF_FUTURE_FINAL
301+
class PROTOBUF_EXPORT ConcatenatingInputStream final
305302
: public ZeroCopyInputStream {
306303
public:
307304
// All streams passed in as well as the array itself must remain valid

src/google/protobuf/io/zero_copy_stream_impl_lite.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ namespace io {
6868
// ===================================================================
6969

7070
// A ZeroCopyInputStream backed by an in-memory array of bytes.
71-
class PROTOBUF_EXPORT ArrayInputStream PROTOBUF_FUTURE_FINAL
72-
: public ZeroCopyInputStream {
71+
class PROTOBUF_EXPORT ArrayInputStream final : public ZeroCopyInputStream {
7372
public:
7473
// Create an InputStream that returns the bytes pointed to by "data".
7574
// "data" remains the property of the caller but must remain valid until
@@ -105,8 +104,7 @@ class PROTOBUF_EXPORT ArrayInputStream PROTOBUF_FUTURE_FINAL
105104
// ===================================================================
106105

107106
// A ZeroCopyOutputStream backed by an in-memory array of bytes.
108-
class PROTOBUF_EXPORT ArrayOutputStream PROTOBUF_FUTURE_FINAL
109-
: public ZeroCopyOutputStream {
107+
class PROTOBUF_EXPORT ArrayOutputStream final : public ZeroCopyOutputStream {
110108
public:
111109
// Create an OutputStream that writes to the bytes pointed to by "data".
112110
// "data" remains the property of the caller but must remain valid until
@@ -140,8 +138,7 @@ class PROTOBUF_EXPORT ArrayOutputStream PROTOBUF_FUTURE_FINAL
140138
// ===================================================================
141139

142140
// A ZeroCopyOutputStream which appends bytes to a string.
143-
class PROTOBUF_EXPORT StringOutputStream PROTOBUF_FUTURE_FINAL
144-
: public ZeroCopyOutputStream {
141+
class PROTOBUF_EXPORT StringOutputStream final : public ZeroCopyOutputStream {
145142
public:
146143
// Create a StringOutputStream which appends bytes to the given string.
147144
// The string remains property of the caller, but it is mutated in arbitrary
@@ -364,8 +361,7 @@ class PROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStream {
364361

365362
// A ZeroCopyInputStream which wraps some other stream and limits it to
366363
// a particular byte count.
367-
class PROTOBUF_EXPORT LimitingInputStream PROTOBUF_FUTURE_FINAL
368-
: public ZeroCopyInputStream {
364+
class PROTOBUF_EXPORT LimitingInputStream final : public ZeroCopyInputStream {
369365
public:
370366
LimitingInputStream(ZeroCopyInputStream* input, int64_t limit);
371367
~LimitingInputStream() override;

src/google/protobuf/port_def.inc

-7
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and
208208
// Owner: mordberg@
209209
#define PROTOBUF_FUTURE_MAP_PAIR_UPGRADE 1
210210

211-
// Used on classes that are historically not marked as final, but that may be
212-
// marked final in future (breaking) releases.
213-
// Owner: kfm@
214-
#define PROTOBUF_FUTURE_FINAL final
215-
216211
// Used to remove the RTTI checks for `DefaultFieldComparator`.
217212
// Owner: kfm@
218213
#define PROTOBUF_FUTURE_REMOVE_DEFAULT_FIELD_COMPARATOR 1
@@ -221,8 +216,6 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and
221216
// Owner: mkruskal@
222217
#define PROTOBUF_FUTURE_REMOVE_CLEARED_API 1
223218

224-
#else
225-
#define PROTOBUF_FUTURE_FINAL
226219
#endif
227220

228221
#ifdef PROTOBUF_VERSION

src/google/protobuf/port_undef.inc

-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
#undef PROTOBUF_EXPORT_TEMPLATE_DEFINE
8989
#undef PROTOBUF_ALIGNAS
9090
#undef PROTOBUF_FINAL
91-
#undef PROTOBUF_FUTURE_FINAL
9291
#undef PROTOBUF_THREAD_LOCAL
9392
#undef PROTOBUF_LITTLE_ENDIAN
9493
#undef PROTOBUF_BIG_ENDIAN
@@ -123,8 +122,6 @@
123122
#undef PROTOBUF_FUTURE_REMOVE_CLEARED_API
124123
#endif
125124

126-
#undef PROTOBUF_FUTURE_FINAL
127-
128125
// Restore macros that may have been #undef'd in port_def.inc.
129126

130127
#ifdef PROTOBUF_DID_UNDEF_PACKAGE

src/google/protobuf/repeated_ptr_field.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,9 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
11601160
//
11611161
// This method cannot be called when the repeated field is on an arena; doing
11621162
// so will trigger a GOOGLE_ABSL_DCHECK-failure.
1163+
PROTOBUF_NODISCARD
11631164
ABSL_DEPRECATED("This will be removed in a future release")
1164-
PROTOBUF_NODISCARD Element* ReleaseCleared();
1165+
Element* ReleaseCleared();
11651166
#endif // !PROTOBUF_FUTURE_REMOVE_CLEARED_API
11661167

11671168
// Removes the element referenced by position.

src/google/protobuf/util/field_comparator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class PROTOBUF_EXPORT SimpleFieldComparator : public FieldComparator {
258258
};
259259

260260
// Default field comparison: use the basic implementation of FieldComparator.
261-
class PROTOBUF_EXPORT DefaultFieldComparator PROTOBUF_FUTURE_FINAL
261+
class PROTOBUF_EXPORT DefaultFieldComparator final
262262
: public SimpleFieldComparator {
263263
public:
264264
ComparisonResult Compare(const Message& message_1, const Message& message_2,

update_subtrees.sh

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eux
44

5-
cd $(dirname $0)/..
5+
cd $(dirname $0)
66

77
git subtree pull --prefix third_party/utf8_range \
88
https://github.com/protocolbuffers/utf8_range.git main --squash

0 commit comments

Comments
 (0)