MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / convert_rwcount

Function convert_rwcount

extlibs/fmt/src/os.cc:62–64  ·  view source on GitHub ↗

On Windows the count argument to read and write is unsigned, so convert it from size_t preventing integer overflow.

Source from the content-addressed store, hash-verified

60// On Windows the count argument to read and write is unsigned, so convert
61// it from size_t preventing integer overflow.
62inline unsigned convert_rwcount(std::size_t count) {
63 return count <= UINT_MAX ? static_cast<unsigned>(count) : UINT_MAX;
64}
65#else
66// Return type of read and write functions.
67using RWResult = ssize_t;

Callers 2

readMethod · 0.85
writeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected