fix compile errors due to stricter compiler post debian upgrade

This commit is contained in:
Eric House 2013-05-29 06:36:54 -07:00
parent 72a78100b1
commit 8b888b8d96
3 changed files with 8 additions and 6 deletions

View file

@ -21,6 +21,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <assert.h>
#include <algorithm>

View file

@ -144,8 +144,8 @@ do_rooms( int sockfd, int lang, int nPlayers )
{
unsigned char msg[] = { 0, /* protocol */
PRX_PUB_ROOMS,
lang,
nPlayers };
(unsigned char)lang,
(unsigned char)nPlayers };
unsigned short len = htons( sizeof(msg) );
write( sockfd, &len, sizeof(len) );
write( sockfd, msg, sizeof(msg) );
@ -184,7 +184,7 @@ write_connnames( int sockfd, char cmd,
len += 1 + strlen( connNames[ii] );
}
unsigned char hdr[] = { 0, cmd };
unsigned char hdr[] = { 0, (unsigned char)cmd };
unsigned short netNConnNames = htons( nConnNames );
netlen = sizeof(hdr) + sizeof( netNConnNames ) + len;
netlen = htons( netlen );
@ -277,6 +277,7 @@ do_fetch( int sockfd, const char** connNames, int nConnNames,
unsigned char reply[1024];
int nRead = read_packet( sockfd, reply, sizeof(reply) );
if ( nRead > 2 ) {
int ii;
const unsigned char* bufp = reply;
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
deviceid provided */
for ( int ii = 0; ii < count && bufp < end; ++ii ) {
for ( ii = 0; ii < count && bufp < end; ++ii ) {
int fd = STDOUT_FILENO;
int nbsfd = -1;
unsigned short countPerDev;
@ -350,7 +351,6 @@ do_fetch( int sockfd, const char** connNames, int nConnNames,
nwritten = write( fd, &len, sizeof(len) );
assert( nwritten == sizeof(len) );
int ii;
for ( ii = 0; -1 != nbsfd; ++ii ) {
short len;
ssize_t nRead = read( nbsfd, &len, sizeof(len) );

View file

@ -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.
*
@ -17,6 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <unistd.h>
#include "udpack.h"
#include "mlock.h"