From 2767c88fe4dd51e87e74b8d44cda2a7ea54c63b7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Apr 2025 14:04:32 +0300 Subject: stronger types - better types --- include/m_core.h | 10 ++++------ include/m_netlib.h | 2 +- libs/win32/mir_app.lib | Bin 303882 -> 303972 bytes libs/win64/mir_app.lib | Bin 303988 -> 304078 bytes protocols/Steam/src/steam_ws.cpp | 2 +- src/mir_app/src/mir_app.def | 2 +- src/mir_app/src/mir_app64.def | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/m_core.h b/include/m_core.h index 947c37ed83..a9f7f4d252 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -48,16 +48,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef MIR_APP_EXPORTS #define MIR_APP_EXPORT MIR_EXPORT - typedef struct NetlibUser* HNETLIBUSER; - typedef struct NetlibConnection* HNETLIBCONN; - typedef struct NetlibBoundPort* HNETLIBBIND; #else #define MIR_APP_EXPORT MIR_IMPORT - DECLARE_HANDLE(HNETLIBUSER); - DECLARE_HANDLE(HNETLIBCONN); - DECLARE_HANDLE(HNETLIBBIND); #endif +typedef struct NetlibUser* HNETLIBUSER; +typedef struct NetlibBoundPort* HNETLIBBIND; +typedef struct NetlibConnection* HNETLIBCONN; + typedef struct TMO_IntMenuItem* HGENMENU; class CMPluginBase; diff --git a/include/m_netlib.h b/include/m_netlib.h index f02d1e890f..3ff4f971d8 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -785,7 +785,7 @@ public: MWebSocket(); ~MWebSocket(); - __forceinline HANDLE getConn() const { return m_hConn; } + __forceinline HNETLIBCONN getConn() const { return m_hConn; } // packet processor virtual void process(const uint8_t *buf, size_t cbLen) = 0; diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index c83fd58fce..fcad461a27 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index 4366c3e67d..36010d730a 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/protocols/Steam/src/steam_ws.cpp b/protocols/Steam/src/steam_ws.cpp index b42c217172..e7c98357d5 100644 --- a/protocols/Steam/src/steam_ws.cpp +++ b/protocols/Steam/src/steam_ws.cpp @@ -170,7 +170,7 @@ void CSteamProto::ProcessMessage(const uint8_t *buf, size_t cbLen) auto md = g_plugin.messages.find(msgType); if (md == g_plugin.messages.end()) { debugLogA("Received message of type %d", msgType); - Netlib_Dump(HNETLIBCONN(m_ws->getConn()), buf, cbLen, false, 0); + Netlib_Dump(m_ws->getConn(), buf, cbLen, false, 0); } else if (auto *pMessage = protobuf_c_message_unpack(md->second, 0, cbLen, buf)) { debugLogA("Received known message:\n%s", protobuf_c_text_to_string(*pMessage).c_str()); diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 045183f86f..253c54a094 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -995,7 +995,7 @@ Proto_CanDeleteHistory @1118 NONAME ?RemakeLog@CSrmmBaseDialog@@UAEXXZ @1126 NONAME ?ProcessToolbarHotkey@CSrmmBaseDialog@@AAEXH@Z @1127 NONAME ?iHistoryMode@Srmm@@3V?$CMOption@E@@A @1128 NONAME -?getConn@MWebSocket@@QBEPAXXZ @1129 NONAME +?getConn@MWebSocket@@QBEPAUNetlibConnection@@XZ @1129 NONAME ?Chat_GetStatus@@YGPAUSTATUSINFO@@PAUSESSION_INFO@@PBUUSERINFO@@@Z @1130 NONAME ?SetBirthday@Contact@@YGXIHHH@Z @1131 NONAME ??0JsonReply@@QAE@PAUMHttpResponse@@@Z @1132 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 097f6a94fa..61117b7741 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -995,7 +995,7 @@ Proto_CanDeleteHistory @1118 NONAME ?RemakeLog@CSrmmBaseDialog@@UEAAXXZ @1126 NONAME ?ProcessToolbarHotkey@CSrmmBaseDialog@@AEAAX_J@Z @1127 NONAME ?iHistoryMode@Srmm@@3V?$CMOption@E@@A @1128 NONAME -?getConn@MWebSocket@@QEBAPEAXXZ @1129 NONAME +?getConn@MWebSocket@@QEBAPEAUNetlibConnection@@XZ @1129 NONAME ?Chat_GetStatus@@YAPEAUSTATUSINFO@@PEAUSESSION_INFO@@PEBUUSERINFO@@@Z @1130 NONAME ?SetBirthday@Contact@@YAXIHHH@Z @1131 NONAME ??0JsonReply@@QEAA@PEAUMHttpResponse@@@Z @1132 NONAME -- cgit v1.2.3