Commit f9688d0e authored by deuce's avatar deuce
Browse files

Fix some of the warnings patched by Marcin Cieslak (Saper). The fixed ones

are where the code was actually "wrong" in some way and the cast was not
intentional.

If the compiler thinks you need to be warned about casting a pointer to an
int of a different size and that's exactly what we mean to do, then we
*should* be getting a warning.
parent 7f6c6e52
......@@ -294,7 +294,7 @@ static BOOL winsock_startup(void)
DLLEXPORT void DLLCALL sbbs_srand()
{
DWORD seed = time(NULL) ^ (DWORD)GetCurrentThreadId();
DWORD seed;
xp_randomize();
#if defined(HAS_DEV_RANDOM) && defined(RANDOM_DEV)
......@@ -304,6 +304,8 @@ DLLEXPORT void DLLCALL sbbs_srand()
read(rf, &seed, sizeof(seed));
close(rf);
}
#else
seed = time(NULL) ^ (DWORD)GetCurrentThreadId()
#endif
srand(seed);
......
......@@ -178,7 +178,7 @@ DWORD RINGBUFCALL RingBufWrite( RingBuf* rb, BYTE* src, DWORD cnt )
#endif
/* allowed to write at pEnd */
max = (((DWORD) rb->pEnd) - ((DWORD) rb->pHead)) + 1;
max = rb->pEnd - rb->pHead + 1;
/*
* we assume the caller has checked that there is enough room. For this reason
......@@ -239,7 +239,7 @@ DWORD RINGBUFCALL RingBufRead( RingBuf* rb, BYTE* dst, DWORD cnt )
cnt = len;
/* allowed to read at pEnd */
max = (((DWORD) rb->pEnd) - ((DWORD) rb->pTail)) + 1;
max = rb->pEnd - rb->pTail + 1;
if( max >= cnt ) {
first = cnt;
......@@ -301,7 +301,7 @@ DWORD RINGBUFCALL RingBufPeek( RingBuf* rb, BYTE* dst, DWORD cnt)
cnt = len;
/* allowed to read at pEnd */
max = (((DWORD) rb->pEnd) - ((DWORD) rb->pTail)) + 1;
max = rb->pEnd - rb->pTail + 1;
if( max >= cnt ) {
first = cnt;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment