diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-09-10 13:19:41 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-01 21:17:12 +0100 |
commit | 6881c895ab317bd302addac5f228b7367136017f (patch) | |
tree | 18d1119f59209147d97e873c3dbc9be36e429aaf /common/rdr/RandomStream.cxx | |
parent | baca73d03217a1c219d9c4f024ffcd39f85fd322 (diff) | |
download | tigervnc-6881c895ab317bd302addac5f228b7367136017f.tar.gz tigervnc-6881c895ab317bd302addac5f228b7367136017f.zip |
Use stdint types
Avoid having our own custom stuff and instead use the modern, standard
types, for familiarity.
Diffstat (limited to 'common/rdr/RandomStream.cxx')
-rw-r--r-- | common/rdr/RandomStream.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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; |