From 6881c895ab317bd302addac5f228b7367136017f Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sat, 10 Sep 2022 13:19:41 +0200 Subject: Use stdint types Avoid having our own custom stuff and instead use the modern, standard types, for familiarity. --- common/rdr/RandomStream.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/rdr/RandomStream.cxx') diff --git a/common/rdr/RandomStream.cxx b/common/rdr/RandomStream.cxx index c9be704c..79a1a0f7 100644 --- a/common/rdr/RandomStream.cxx +++ b/common/rdr/RandomStream.cxx @@ -86,14 +86,14 @@ RandomStream::~RandomStream() { bool RandomStream::fillBuffer() { #ifdef RFB_HAVE_WINCRYPT if (provider) { - if (!CryptGenRandom(provider, availSpace(), (U8*)end)) + if (!CryptGenRandom(provider, availSpace(), (uint8_t*)end)) throw rdr::SystemException("unable to CryptGenRandom", GetLastError()); end += availSpace(); } else { #else #ifndef WIN32 if (fp) { - size_t n = fread((U8*)end, 1, availSpace(), fp); + size_t n = fread((uint8_t*)end, 1, availSpace(), fp); if (n <= 0) throw rdr::SystemException("reading /dev/urandom or /dev/random failed", errno); @@ -104,7 +104,7 @@ bool RandomStream::fillBuffer() { #endif #endif for (size_t i=availSpace(); i>0; i--) - *(U8*)end++ = (int) (256.0*rand()/(RAND_MAX+1.0)); + *(uint8_t*)end++ = (int) (256.0*rand()/(RAND_MAX+1.0)); } return true; -- cgit v1.2.3