From c87f02c075919337018b534b6f8ef2c97160c883 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Dec 2013 12:59:23 +0300 Subject: add restrict into messagein. --- src/net/messagein.cpp | 11 +++++++---- src/net/messagein.h | 14 +++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 28a16cfbd..4bd472dc1 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -59,7 +59,7 @@ unsigned char MessageIn::readInt8() return value; } -void MessageIn::readCoordinates(uint16_t &x, uint16_t &y) +void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y) { if (mPos + 3 <= mLength) { @@ -108,7 +108,8 @@ uint8_t MessageIn::fromServerDirection(const uint8_t serverDir) } } -void MessageIn::readCoordinates(uint16_t &x, uint16_t &y, uint8_t &direction) +void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y, + uint8_t &restrict direction) { uint8_t serverDir = 0; if (mPos + 3 <= mLength) @@ -138,8 +139,10 @@ void MessageIn::readCoordinates(uint16_t &x, uint16_t &y, uint8_t &direction) PacketCounters::incInBytes(3); } -void MessageIn::readCoordinatePair(uint16_t &srcX, uint16_t &srcY, - uint16_t &dstX, uint16_t &dstY) +void MessageIn::readCoordinatePair(uint16_t &restrict srcX, + uint16_t &restrict srcY, + uint16_t &restrict dstX, + uint16_t &restrict dstY) { if (mPos + 5 <= mLength) { diff --git a/src/net/messagein.h b/src/net/messagein.h index 47527a879..174d08146 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -68,21 +68,25 @@ class MessageIn * Reads a 3-byte block containing tile-based coordinates. Used by * manaserv. */ - virtual void readCoordinates(uint16_t &x, uint16_t &y); + virtual void readCoordinates(uint16_t &restrict x, + uint16_t &restrict y); /** * Reads a special 3 byte block used by eAthena, containing x and y * coordinates and direction. */ - virtual void readCoordinates(uint16_t &x, uint16_t &y, - uint8_t &direction); + virtual void readCoordinates(uint16_t &restrict x, + uint16_t &restrict y, + uint8_t &restrict direction); /** * Reads a special 5 byte block used by eAthena, containing a source * and destination coordinate pair. */ - virtual void readCoordinatePair(uint16_t &srcX, uint16_t &srcY, - uint16_t &dstX, uint16_t &dstY); + virtual void readCoordinatePair(uint16_t &restrict srcX, + uint16_t &restrict srcY, + uint16_t &restrict dstX, + uint16_t &restrict dstY); /** * Skips a given number of bytes. -- cgit v1.2.3-70-g09d2