diff options
author | alberth <alberth@openttd.org> | 2009-06-01 11:43:36 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-06-01 11:43:36 +0000 |
commit | bab70a823dd810e1d4477f0c01d3a7b3e9b19ac8 (patch) | |
tree | 2668a1043fb310d44e67f4deb07871519d406a55 /src/network | |
parent | 5e91bf0ad20e0c60b31e190a1f02f184020238de (diff) | |
download | openttd-bab70a823dd810e1d4477f0c01d3a7b3e9b19ac8.tar.xz |
(svn r16491) -Codechange: Added parentheses around bitwise operators for code style.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/core/host.cpp | 2 | ||||
-rw-r--r-- | src/network/network.cpp | 2 | ||||
-rw-r--r-- | src/network/network_chat_gui.cpp | 2 | ||||
-rw-r--r-- | src/network/network_server.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index 917de0a2f..7adb64f01 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -173,7 +173,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // !G strecpy(r.ifr_name, req->ifr_name, lastof(r.ifr_name)); if (ioctl(sock, SIOCGIFFLAGS, &r) != -1 && - r.ifr_flags & IFF_BROADCAST && + (r.ifr_flags & IFF_BROADCAST) && ioctl(sock, SIOCGIFBRDADDR, &r) != -1) { NetworkAddress addr(&r.ifr_broadaddr, sizeof(sockaddr)); if (!broadcast->Contains(addr)) *broadcast->Append() = addr; diff --git a/src/network/network.cpp b/src/network/network.cpp index 266ce506d..32b1cb683 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -462,7 +462,7 @@ void NetworkCloseClient(NetworkClientSocket *cs) } /* When the client was PRE_ACTIVE, the server was in pause mode, so unpause */ - if (cs->status == STATUS_PRE_ACTIVE && _pause_mode & PM_PAUSED_JOIN) { + if (cs->status == STATUS_PRE_ACTIVE && (_pause_mode & PM_PAUSED_JOIN)) { DoCommandP(0, PM_PAUSED_JOIN, 0, CMD_PAUSE); NetworkServerSendChat(NETWORK_ACTION_SERVER_MESSAGE, DESTTYPE_BROADCAST, 0, "", CLIENT_ID_SERVER, NETWORK_SERVER_MESSAGE_GAME_UNPAUSED_CONNECT_FAIL); } diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 4284f15d7..d3fa7245c 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -96,7 +96,7 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint8 duration, const char * /* The default colour for a message is company colour. Replace this with * white for any additional lines */ - cmsg->colour = (bufp == buf && colour & IS_PALETTE_COLOUR) ? colour : TC_WHITE; + cmsg->colour = (bufp == buf && (colour & IS_PALETTE_COLOUR)) ? colour : TC_WHITE; cmsg->end_date = _date + duration; bufp += strlen(bufp) + 1; // jump to 'next line' in the formatted string diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 8b1a5b669..d0bdb4fd4 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -866,8 +866,8 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND) } - if (GetCommandFlags(cp.cmd) & CMD_SERVER && ci->client_id != CLIENT_ID_SERVER) { - IConsolePrintF(CC_ERROR, "WARNING: server only command from client %d (IP: %s), kicking...", ci->client_id, GetClientIP(ci)); + if ((GetCommandFlags(cp.cmd) & CMD_SERVER) && ci->client_id != CLIENT_ID_SERVER) { + IConsolePrintF(CC_ERROR, "WARNING: server only command from: client %d (IP: %s), kicking...", ci->client_id, GetClientIP(ci)); SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_KICKED); return; } |