Skip to content

Commit

Permalink
vrpn_Connection: Fix warnings when compiling as C++17.
Browse files Browse the repository at this point in the history
"register" designation for variables hasn't really been useful for years.
  • Loading branch information
rpavlik committed Mar 12, 2019
1 parent 1c13784 commit c1b1b85
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions vrpn_Connection.C
Expand Up @@ -1825,8 +1825,8 @@ int vrpn_noint_select(int width, fd_set *readfds, fd_set *writefds,

int vrpn_noint_block_write(int outfile, const char buffer[], size_t length)
{
register int sofar = 0; /* How many characters sent so far */
register int ret; /* Return value from write() */
int sofar = 0; /* How many characters sent so far */
int ret; /* Return value from write() */

do {
/* Try to write the remaining data */
Expand Down Expand Up @@ -1860,8 +1860,8 @@ int vrpn_noint_block_write(int outfile, const char buffer[], size_t length)

int vrpn_noint_block_read(int infile, char buffer[], size_t length)
{
register int sofar; /* How many we read so far */
register int ret; /* Return value from the read() */
int sofar; /* How many we read so far */
int ret; /* Return value from the read() */

// TCH 4 Jan 2000 - hackish - Cygwin will block forever on a 0-length
// read(), and from the man pages this is close enough to in-spec that
Expand Down Expand Up @@ -1957,9 +1957,8 @@ int vrpn_noint_block_read(SOCKET insock, char *buffer, size_t length)

int vrpn_noint_block_read_timeout(SOCKET infile, char buffer[], size_t length,
struct timeval *timeout)
{
size_t sofar; /* How many we read so far */
register int ret; /* Return value from the read() */
{
int ret; /* Return value from the read() */
struct timeval timeout2;
struct timeval *timeout2ptr;
struct timeval start, stop, now;
Expand Down Expand Up @@ -1988,7 +1987,7 @@ int vrpn_noint_block_read_timeout(SOCKET infile, char buffer[], size_t length,
timeout2ptr = timeout;
}

sofar = 0;
size_t sofar = 0;/* How many we read so far */
do {
int sel_ret;
fd_set readfds, exceptfds;
Expand Down Expand Up @@ -2030,7 +2029,7 @@ int vrpn_noint_block_read_timeout(SOCKET infile, char buffer[], size_t length,
}

#ifndef VRPN_USE_WINSOCK_SOCKETS
ret = read(infile, buffer + sofar, length - sofar);
int ret = read(infile, buffer + sofar, length - sofar);
sofar += ret;

/* Ignore interrupted system calls - retry */
Expand All @@ -2040,8 +2039,7 @@ int vrpn_noint_block_read_timeout(SOCKET infile, char buffer[], size_t length,
}
#else
{
int nread;
nread = recv(infile, buffer + sofar,
int nread = recv(infile, buffer + sofar,
static_cast<int>(length - sofar), 0);
sofar += nread;
ret = nread;
Expand Down

0 comments on commit c1b1b85

Please sign in to comment.