Skip to content

Commit

Permalink
Revert "Use UZ for std::size_t literal values."
Browse files Browse the repository at this point in the history
Visual Studio 2022 compiler does not support this.

This reverts commit b91c12d.
  • Loading branch information
wilx committed Nov 11, 2024
1 parent 11066ad commit 446bd55
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/log4cplus/socketappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ namespace log4cplus
{

#ifndef UNICODE
std::size_t const LOG4CPLUS_MAX_MESSAGE_SIZE = 8UZ*1024;
std::size_t const LOG4CPLUS_MAX_MESSAGE_SIZE = 8*1024;
#else
std::size_t const LOG4CPLUS_MAX_MESSAGE_SIZE = 2UZ*8*1024;
std::size_t const LOG4CPLUS_MAX_MESSAGE_SIZE = 2*8*1024;
#endif


Expand Down
2 changes: 1 addition & 1 deletion src/stringhelper-clocale.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tostring_internal (std::string & result, wchar_t const * src, std::size_t size)
while (src_it != src_end_it)
{
std::size_t ret = std::wcrtomb (&result_buf[0], *src_it, &mbs);
if (ret == -1UZ)
if (ret == static_cast<std::size_t>(-1))
{
result.push_back ('?');
clear_mbstate (mbs);
Expand Down
2 changes: 1 addition & 1 deletion src/stringhelper-iconv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ iconv_conv (std::basic_string<DestType> & result, char const * destenc,
std::size_t outbytesleft = result_size * sizeof (outbuf_type);

std::size_t res;
std::size_t const error_retval = -1UZ;
std::size_t const error_retval = static_cast<std::size_t>(-1);

while (inbytesleft != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/timehelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ getFormattedTime(const log4cplus::tstring& fmt_orig,
// both too small buffer and invalid format string by returning 0
// without changing errno.
std::size_t const buffer_size_max
= (std::max) (1024UZ, buffer_size * 16);
= (std::max) (static_cast<std::size_t>(1024), buffer_size * 16);

buffer_size = (std::max) (buffer_size, gft_sp.buffer.capacity());

Expand Down

0 comments on commit 446bd55

Please sign in to comment.