Skip to content

Commit bbaedee

Browse files
mrotteveeldyemanov
andcommitted
Apply suggestions from code review
Co-authored-by: Dmitry Yemanov <[email protected]>
1 parent 25ab8f8 commit bbaedee

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/common/classes/MsgPrint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ int decode(int64_t value, char* const rc, int radix)
133133
// for smallest representation in text form.
134134
int decode(double value, char* const rc, const size_t sz)
135135
{
136-
int n = snprintf(rc, sz, "%g", value);
136+
const int n = snprintf(rc, sz, "%g", value);
137137
return std::min(n, static_cast<int>(sz - 1));
138138
}
139139

@@ -204,7 +204,7 @@ int MsgPrintHelper(BaseStream& out_stream, const safe_cell& item)
204204
case safe_cell::at_double:
205205
{
206206
char s[DECODE_BUF_SIZE];
207-
int n = decode(item.d_value, s, sizeof(s));
207+
const int n = decode(item.d_value, s, sizeof(s));
208208
return out_stream.write(s, n);
209209
}
210210
case safe_cell::at_str:

src/common/pretty.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ struct ctl
6161
SSHORT ctl_level;
6262
TEXT ctl_buffer[PRETTY_BUFFER_SIZE];
6363

64-
void reset() noexcept {
64+
void reset() noexcept
65+
{
6566
ctl_ptr = ctl_buffer;
6667
}
6768

68-
size_t remaining() const noexcept {
69+
size_t remaining() const noexcept
70+
{
6971
if (!ctl_ptr)
7072
return 0;
7173
return sizeof(ctl_buffer) - (ctl_ptr - ctl_buffer);

0 commit comments

Comments
 (0)