From 8bb7fa64a9d1abed9b563eca9f95d3ac1a8b6cdc Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 7 Mar 2023 10:07:04 -0400 Subject: T{Tcp,}Socket: Make `send(u8 *, size_t)` return the proper type --- context.h | 4 ++-- include/pso/TSocket.h | 2 +- include/pso/TTcpSocket.h | 2 +- src/pso/TTcpSocket.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/context.h b/context.h index 5bdb45c..559f196 100644 --- a/context.h +++ b/context.h @@ -1126,7 +1126,7 @@ public: virtual short close() = 0; virtual void recv() = 0; virtual short send(u8 *data) = 0; - virtual int send(u8 *data, size_t size) = 0; + virtual short send(u8 *data, size_t size) = 0; int resolve_domain(char *domain); void set_ip_address(u32 addr); @@ -1186,7 +1186,7 @@ public: virtual short close() override; virtual void recv() override; virtual short send(u8 *data) override; - virtual int send(u8 *data, size_t size) override; + virtual short send(u8 *data, size_t size) override; short stat(); void some_stub(); diff --git a/include/pso/TSocket.h b/include/pso/TSocket.h index 6f79e13..e4c5c5e 100644 --- a/include/pso/TSocket.h +++ b/include/pso/TSocket.h @@ -43,7 +43,7 @@ public: virtual short close() = 0; virtual void recv() = 0; virtual short send(u8 *data) = 0; - virtual int send(u8 *data, size_t size) = 0; + virtual short send(u8 *data, size_t size) = 0; int resolve_domain(char *domain); void set_ip_address(u32 addr); diff --git a/include/pso/TTcpSocket.h b/include/pso/TTcpSocket.h index 6f18c3c..3373e3b 100644 --- a/include/pso/TTcpSocket.h +++ b/include/pso/TTcpSocket.h @@ -29,7 +29,7 @@ public: virtual short close() override; virtual void recv() override; virtual short send(u8 *data) override; - virtual int send(u8 *data, size_t size) override; + virtual short send(u8 *data, size_t size) override; short stat(); void some_stub(); diff --git a/src/pso/TTcpSocket.cpp b/src/pso/TTcpSocket.cpp index beb5565..949f962 100644 --- a/src/pso/TTcpSocket.cpp +++ b/src/pso/TTcpSocket.cpp @@ -93,7 +93,7 @@ void TTcpSocket::notify(short size, short sock_fd) { } } -int TTcpSocket::send(u8 *data, size_t size) { +short TTcpSocket::send(u8 *data, size_t size) { if (sock_fd() != -1) { if (!m_is_encrypted) { m_send_crypt.encrypt(data, size); -- cgit v1.2.3-13-gbd6f