@@ -64,7 +64,7 @@ class raw_ostream {
64
64
// / this buffer.
65
65
char *OutBufStart, *OutBufEnd, *OutBufCur;
66
66
67
- enum BufferKind {
67
+ enum class BufferKind {
68
68
Unbuffered = 0 ,
69
69
InternalBuffer,
70
70
ExternalBuffer
@@ -97,7 +97,8 @@ class raw_ostream {
97
97
static const Colors RESET = Colors::RESET;
98
98
99
99
explicit raw_ostream (bool unbuffered = false )
100
- : BufferMode(unbuffered ? Unbuffered : InternalBuffer) {
100
+ : BufferMode(unbuffered ? BufferKind::Unbuffered
101
+ : BufferKind::InternalBuffer) {
101
102
// Start out ready to flush.
102
103
OutBufStart = OutBufEnd = OutBufCur = nullptr ;
103
104
}
@@ -121,13 +122,13 @@ class raw_ostream {
121
122
// / Set the stream to be buffered, using the specified buffer size.
122
123
void SetBufferSize (size_t Size) {
123
124
flush ();
124
- SetBufferAndMode (new char [Size], Size, InternalBuffer);
125
+ SetBufferAndMode (new char [Size], Size, BufferKind:: InternalBuffer);
125
126
}
126
127
127
128
size_t GetBufferSize () const {
128
129
// If we're supposed to be buffered but haven't actually gotten around
129
130
// to allocating the buffer yet, return the value that would be used.
130
- if (BufferMode != Unbuffered && OutBufStart == nullptr )
131
+ if (BufferMode != BufferKind:: Unbuffered && OutBufStart == nullptr )
131
132
return preferred_buffer_size ();
132
133
133
134
// Otherwise just return the size of the allocated buffer.
@@ -139,7 +140,7 @@ class raw_ostream {
139
140
// / when the stream is being set to unbuffered.
140
141
void SetUnbuffered () {
141
142
flush ();
142
- SetBufferAndMode (nullptr , 0 , Unbuffered);
143
+ SetBufferAndMode (nullptr , 0 , BufferKind:: Unbuffered);
143
144
}
144
145
145
146
size_t GetNumBytesInBuffer () const {
@@ -325,7 +326,7 @@ class raw_ostream {
325
326
// / use only by subclasses which can arrange for the output to go directly
326
327
// / into the desired output buffer, instead of being copied on each flush.
327
328
void SetBuffer (char *BufferStart, size_t Size) {
328
- SetBufferAndMode (BufferStart, Size, ExternalBuffer);
329
+ SetBufferAndMode (BufferStart, Size, BufferKind:: ExternalBuffer);
329
330
}
330
331
331
332
// / Return an efficient buffer size for the underlying output mechanism.
@@ -384,7 +385,7 @@ class raw_pwrite_stream : public raw_ostream {
384
385
class raw_fd_ostream : public raw_pwrite_stream {
385
386
int FD;
386
387
bool ShouldClose;
387
- bool SupportsSeeking;
388
+ bool SupportsSeeking = false ;
388
389
bool ColorEnabled = true ;
389
390
390
391
#ifdef _WIN32
@@ -395,7 +396,7 @@ class raw_fd_ostream : public raw_pwrite_stream {
395
396
396
397
std::error_code EC;
397
398
398
- uint64_t pos;
399
+ uint64_t pos = 0 ;
399
400
400
401
// / See raw_ostream::write_impl.
401
402
void write_impl (const char *Ptr, size_t Size) override ;
0 commit comments