From d39c08fe719f39be358b3ffa87cb123d93811d0c Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Mon, 30 Jul 2018 01:03:28 +0300 Subject: [PATCH] Update the IRC module to comply with the new StackStrF changes. --- modules/irc/Common.cpp | 20 ++++++++++---------- modules/irc/Session.cpp | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/irc/Common.cpp b/modules/irc/Common.cpp index b9b12fdd..d8d04d7a 100644 --- a/modules/irc/Common.cpp +++ b/modules/irc/Common.cpp @@ -33,9 +33,9 @@ void IrcFreeMem(void * p) static SQInteger SqGetNick(HSQUIRRELVM vm) { // Attempt to retrieve the value from the stack as a string - StackStrF val(vm, 2, true); + StackStrF val(vm, 2); // Have we failed to retrieve the string? - if (SQ_FAILED(val.mRes)) + if (SQ_FAILED(val.Proc(true))) { return val.mRes; // Propagate the error! } @@ -51,9 +51,9 @@ static SQInteger SqGetNick(HSQUIRRELVM vm) static SQInteger SqGetHost(HSQUIRRELVM vm) { // Attempt to retrieve the value from the stack as a string - StackStrF val(vm, 2, true); + StackStrF val(vm, 2); // Have we failed to retrieve the string? - if (SQ_FAILED(val.mRes)) + if (SQ_FAILED(val.Proc(true))) { return val.mRes; // Propagate the error! } @@ -69,9 +69,9 @@ static SQInteger SqGetHost(HSQUIRRELVM vm) static SQInteger SqStripColorFromMIRC(HSQUIRRELVM vm) { // Attempt to retrieve the value from the stack as a string - StackStrF val(vm, 2, true); + StackStrF val(vm, 2); // Have we failed to retrieve the string? - if (SQ_FAILED(val.mRes)) + if (SQ_FAILED(val.Proc(true))) { return val.mRes; // Propagate the error! } @@ -94,9 +94,9 @@ static SQInteger SqStripColorFromMIRC(HSQUIRRELVM vm) static SQInteger SqConvertColorFromMIRC(HSQUIRRELVM vm) { // Attempt to retrieve the value from the stack as a string - StackStrF val(vm, 2, true); + StackStrF val(vm, 2); // Have we failed to retrieve the string? - if (SQ_FAILED(val.mRes)) + if (SQ_FAILED(val.Proc(true))) { return val.mRes; // Propagate the error! } @@ -119,9 +119,9 @@ static SQInteger SqConvertColorFromMIRC(HSQUIRRELVM vm) static SQInteger SqConvertColorToMIRC(HSQUIRRELVM vm) { // Attempt to retrieve the value from the stack as a string - StackStrF val(vm, 2, true); + StackStrF val(vm, 2); // Have we failed to retrieve the string? - if (SQ_FAILED(val.mRes)) + if (SQ_FAILED(val.Proc(true))) { return val.mRes; // Propagate the error! } diff --git a/modules/irc/Session.cpp b/modules/irc/Session.cpp index 2bf51908..c5b81ff9 100644 --- a/modules/irc/Session.cpp +++ b/modules/irc/Session.cpp @@ -700,7 +700,7 @@ void Session::ForwardEvent(Function & listener, CCStr event, CCStr origin, CCStr // Attempt top execute the callback with the obtained values try { - listener.Execute< CSStr, CSStr, Array & >(event, origin, parameters); + listener.Execute(event, origin, parameters); } catch (const Sqrat::Exception & e) { @@ -744,7 +744,7 @@ void Session::ForwardEvent(Function & listener, Uint32 event, // Attempt top execute the callback with the obtained values try { - listener.Execute< Uint32, CSStr, Array & >(event, origin, parameters); + listener.Execute(event, origin, parameters); } catch (const Sqrat::Exception & e) { @@ -1040,17 +1040,17 @@ static SQInteger FormattedIrcMessageCmd(HSQUIRRELVM vm, SendIrcMessageFunc send_ } // Attempt to retrieve the target from the stack as a string - StackStrF target(vm, 2, false); + StackStrF target(vm, 2); // Have we failed to retrieve the string? - if (SQ_FAILED(target.mRes)) + if (SQ_FAILED(target.Proc(false))) { return target.mRes; // Propagate the error! } // Attempt to retrieve the value from the stack as a string - StackStrF message(vm, 3, true); + StackStrF message(vm, 3); // Have we failed to retrieve the string? - if (SQ_FAILED(message.mRes)) + if (SQ_FAILED(message.Proc(true))) { return message.mRes; // Propagate the error! }