diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a4b8d32b9..f8e9faca7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20110115 +-------- +arch/linux/ipx.c, main/net_ipx.c: Fixed some compiler warnings + 20110114 -------- main/credits.c, main/menu.c, main/net_udp.c, main/scores.c: Fix compile errors introduced when merging diff --git a/arch/linux/ipx.c b/arch/linux/ipx.c index 86ed126e4..f47078785 100644 --- a/arch/linux/ipx.c +++ b/arch/linux/ipx.c @@ -78,7 +78,8 @@ static int ipx_open_socket(socket_t *sk, int port) } ipxs.sipx_family = AF_IPX; - ipxs.sipx_network = *((unsigned int *)&MyAddress[0]); + memcpy(&ipxs.sipx_network, MyAddress, 4); +// ipxs.sipx_network = *((unsigned int *)&MyAddress[0]); /* ipxs.sipx_network = htonl(MyNetwork); */ bzero(ipxs.sipx_node, 6); /* Please fill in my node name */ ipxs.sipx_port = htons(port); @@ -132,7 +133,8 @@ static int ipx_send_packet(socket_t *mysock, IPXPacket_t *IPXHeader, u_char *dat /* if destination address is 0, then send to my net */ if (ipxs.sipx_network == 0) { - ipxs.sipx_network = *((unsigned int *)&MyAddress[0]); + memcpy(&ipxs.sipx_network, MyAddress, 4); +// ipxs.sipx_network = *((unsigned int *)&MyAddress[0]); } memcpy(&ipxs.sipx_node, IPXHeader->Destination.Node, 6); diff --git a/main/net_ipx.c b/main/net_ipx.c index d84ee08af..7d2375365 100644 --- a/main/net_ipx.c +++ b/main/net_ipx.c @@ -312,8 +312,8 @@ void ipxdrv_send_packet_data( ubyte * data, int datasize, ubyte *network, ubyte if (driver->usepacketnum) { ubyte buf[MAX_IPX_DATA]; - *(uint *)buf = ipx_packetnum++; - + memcpy(buf, &ipx_packetnum, 4); + ipx_packetnum++; memcpy(buf + 4, data, datasize); driver->send_packet(&socket_data, &ipx_header, buf, datasize + 4); } @@ -963,6 +963,7 @@ net_ipx_new_player(IPX_sequence_packet *their) { int objnum; int pnum; + uint server; pnum = their->player.connected; @@ -984,7 +985,8 @@ net_ipx_new_player(IPX_sequence_packet *their) memcpy(Players[pnum].callsign, their->player.callsign, CALLSIGN_LEN+1); memcpy(Netgame.players[pnum].callsign, their->player.callsign, CALLSIGN_LEN+1); - if ( (*(uint *)their->player.protocol.ipx.server) != 0 ) + memcpy(&server, their->player.protocol.ipx.server, 4); + if ( server != 0 ) ipxdrv_get_local_target( their->player.protocol.ipx.server, their->player.protocol.ipx.node, Players[pnum].net_address ); else memcpy(Players[pnum].net_address, their->player.protocol.ipx.node, 6); @@ -1020,6 +1022,7 @@ void net_ipx_welcome_player(IPX_sequence_packet *their) ubyte local_address[6]; int player_num; int i; + uint server; // Don't accept new players if we're ending this level. Its safe to // ignore since they'll request again later @@ -1048,7 +1051,8 @@ void net_ipx_welcome_player(IPX_sequence_packet *their) memset(&IPX_sync_player, 0, sizeof(IPX_sequence_packet)); Network_player_added = 0; - if ( (*(uint *)their->player.protocol.ipx.server) != 0 ) + memcpy(&server, their->player.protocol.ipx.server, 4); + if ( server != 0 ) ipxdrv_get_local_target( their->player.protocol.ipx.server, their->player.protocol.ipx.node, local_address ); else memcpy(local_address, their->player.protocol.ipx.node, 6); @@ -2473,6 +2477,7 @@ void net_ipx_read_sync_packet( ubyte * data ) { int i, j; netgame_info *sp = &Netgame; + uint server; char temp_callsign[CALLSIGN_LEN+1]; @@ -2522,12 +2527,12 @@ void net_ipx_read_sync_packet( ubyte * data ) memcpy( Players[i].callsign, sp->players[i].callsign, CALLSIGN_LEN+1 ); #ifdef WORDS_NEED_ALIGNMENT - uint server; - memcpy(&server, TempPlayersInfo->players[i].protocol.ipx.server, 4); + memcpy(&server, sp->players[i].protocol.ipx.server, 4); if (server != 0) ipxdrv_get_local_target((ubyte *)&server, sp->players[i].protocol.ipx.node, Players[i].net_address); #else // WORDS_NEED_ALIGNMENT - if ( (*(uint *)sp->players[i].protocol.ipx.server) != 0 ) + memcpy(&server, sp->players[i].protocol.ipx.server, 4); + if ( server != 0 ) ipxdrv_get_local_target( sp->players[i].protocol.ipx.server, sp->players[i].protocol.ipx.node, Players[i].net_address ); #endif // WORDS_NEED_ALIGNMENT else