mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
fix compile errors due to stricter compiler post debian upgrade
This commit is contained in:
parent
72a78100b1
commit
8b888b8d96
3 changed files with 8 additions and 6 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
|
@ -144,8 +144,8 @@ do_rooms( int sockfd, int lang, int nPlayers )
|
||||||
{
|
{
|
||||||
unsigned char msg[] = { 0, /* protocol */
|
unsigned char msg[] = { 0, /* protocol */
|
||||||
PRX_PUB_ROOMS,
|
PRX_PUB_ROOMS,
|
||||||
lang,
|
(unsigned char)lang,
|
||||||
nPlayers };
|
(unsigned char)nPlayers };
|
||||||
unsigned short len = htons( sizeof(msg) );
|
unsigned short len = htons( sizeof(msg) );
|
||||||
write( sockfd, &len, sizeof(len) );
|
write( sockfd, &len, sizeof(len) );
|
||||||
write( sockfd, msg, sizeof(msg) );
|
write( sockfd, msg, sizeof(msg) );
|
||||||
|
@ -184,7 +184,7 @@ write_connnames( int sockfd, char cmd,
|
||||||
len += 1 + strlen( connNames[ii] );
|
len += 1 + strlen( connNames[ii] );
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char hdr[] = { 0, cmd };
|
unsigned char hdr[] = { 0, (unsigned char)cmd };
|
||||||
unsigned short netNConnNames = htons( nConnNames );
|
unsigned short netNConnNames = htons( nConnNames );
|
||||||
netlen = sizeof(hdr) + sizeof( netNConnNames ) + len;
|
netlen = sizeof(hdr) + sizeof( netNConnNames ) + len;
|
||||||
netlen = htons( netlen );
|
netlen = htons( netlen );
|
||||||
|
@ -277,6 +277,7 @@ do_fetch( int sockfd, const char** connNames, int nConnNames,
|
||||||
unsigned char reply[1024];
|
unsigned char reply[1024];
|
||||||
int nRead = read_packet( sockfd, reply, sizeof(reply) );
|
int nRead = read_packet( sockfd, reply, sizeof(reply) );
|
||||||
if ( nRead > 2 ) {
|
if ( nRead > 2 ) {
|
||||||
|
int ii;
|
||||||
const unsigned char* bufp = reply;
|
const unsigned char* bufp = reply;
|
||||||
const unsigned char* const end = bufp + nRead;
|
const unsigned char* const end = bufp + nRead;
|
||||||
|
|
||||||
|
@ -292,7 +293,7 @@ do_fetch( int sockfd, const char** connNames, int nConnNames,
|
||||||
STDOUT -- e.g. by passing in named pipes to correspond to each
|
STDOUT -- e.g. by passing in named pipes to correspond to each
|
||||||
deviceid provided */
|
deviceid provided */
|
||||||
|
|
||||||
for ( int ii = 0; ii < count && bufp < end; ++ii ) {
|
for ( ii = 0; ii < count && bufp < end; ++ii ) {
|
||||||
int fd = STDOUT_FILENO;
|
int fd = STDOUT_FILENO;
|
||||||
int nbsfd = -1;
|
int nbsfd = -1;
|
||||||
unsigned short countPerDev;
|
unsigned short countPerDev;
|
||||||
|
@ -350,7 +351,6 @@ do_fetch( int sockfd, const char** connNames, int nConnNames,
|
||||||
nwritten = write( fd, &len, sizeof(len) );
|
nwritten = write( fd, &len, sizeof(len) );
|
||||||
assert( nwritten == sizeof(len) );
|
assert( nwritten == sizeof(len) );
|
||||||
|
|
||||||
int ii;
|
|
||||||
for ( ii = 0; -1 != nbsfd; ++ii ) {
|
for ( ii = 0; -1 != nbsfd; ++ii ) {
|
||||||
short len;
|
short len;
|
||||||
ssize_t nRead = read( nbsfd, &len, sizeof(len) );
|
ssize_t nRead = read( nbsfd, &len, sizeof(len) );
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* -*- compile-command: "make MEMDEBUG=TRUE -j3"; -*- */
|
/* -*- compile-command: "make -j3"; -*- */
|
||||||
/*
|
/*
|
||||||
* Copyright 2013 by Eric House (xwords@eehouse.org). All rights reserved.
|
* Copyright 2013 by Eric House (xwords@eehouse.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
#include "udpack.h"
|
#include "udpack.h"
|
||||||
#include "mlock.h"
|
#include "mlock.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue