Skip to content

Commit f5bffaa

Browse files
Add explicit static cast from std::size_t to std::streamsize
The explcit cast avoids narrowing error.
1 parent c8eb4d3 commit f5bffaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nvbench/json_printer.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ void json_printer::do_process_bulk_data_float64(state &state,
194194
// if buffer is full, write it out and wrap around
195195
if (bytes_in_buffer == buffer_nbytes)
196196
{
197-
out.write(buffer, buffer_nbytes);
197+
out.write(buffer, static_cast<std::streamsize>(buffer_nbytes));
198198
bytes_in_buffer = 0;
199199
}
200200
} // end of foreach value64 in data
201201

202202
if (bytes_in_buffer)
203203
{
204-
out.write(buffer, bytes_in_buffer);
204+
out.write(buffer, static_cast<std::streamsize>(bytes_in_buffer));
205205
bytes_in_buffer = 0;
206206
}
207207
}

0 commit comments

Comments
 (0)