1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

AK: Rename the common integer typedefs to make it obvious what they are.

These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
This commit is contained in:
Andreas Kling 2019-07-03 21:17:35 +02:00
parent c4c4bbc5ba
commit 27f699ef0c
208 changed files with 1603 additions and 1621 deletions

View file

@ -27,21 +27,21 @@ public:
virtual void attach(FileDescription&) override;
virtual void detach(FileDescription&) override;
virtual bool can_read(FileDescription&) const override;
virtual ssize_t read(FileDescription&, byte*, ssize_t) override;
virtual ssize_t write(FileDescription&, const byte*, ssize_t) override;
virtual ssize_t read(FileDescription&, u8*, ssize_t) override;
virtual ssize_t write(FileDescription&, const u8*, ssize_t) override;
virtual bool can_write(FileDescription&) const override;
virtual ssize_t sendto(FileDescription&, const void*, size_t, int, const sockaddr*, socklen_t) override;
virtual ssize_t recvfrom(FileDescription&, void*, size_t, int flags, sockaddr*, socklen_t*) override;
void did_receive(const IPv4Address& peer_address, word peer_port, ByteBuffer&&);
void did_receive(const IPv4Address& peer_address, u16 peer_port, ByteBuffer&&);
const IPv4Address& local_address() const;
word local_port() const { return m_local_port; }
void set_local_port(word port) { m_local_port = port; }
u16 local_port() const { return m_local_port; }
void set_local_port(u16 port) { m_local_port = port; }
const IPv4Address& peer_address() const { return m_peer_address; }
word peer_port() const { return m_peer_port; }
void set_peer_port(word port) { m_peer_port = port; }
u16 peer_port() const { return m_peer_port; }
void set_peer_port(u16 port) { m_peer_port = port; }
protected:
IPv4Socket(int type, int protocol);
@ -70,16 +70,16 @@ private:
struct ReceivedPacket {
IPv4Address peer_address;
word peer_port;
u16 peer_port;
ByteBuffer data;
};
SinglyLinkedList<ReceivedPacket> m_receive_queue;
word m_local_port { 0 };
word m_peer_port { 0 };
u16 m_local_port { 0 };
u16 m_peer_port { 0 };
dword m_bytes_received { 0 };
u32 m_bytes_received { 0 };
bool m_can_read { false };
};