From 4d38b4974e27dded1c8d542da3f9ec9e5295fbaf Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sun, 18 Aug 2013 12:56:51 +0300 Subject: [PATCH] Minor changes. --- projects/sgconf/common_sg.cpp | 4 ++-- stglibs/srvconf.lib/servconf.cpp | 25 ++++++------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/projects/sgconf/common_sg.cpp b/projects/sgconf/common_sg.cpp index ca1aa50c..38520c52 100644 --- a/projects/sgconf/common_sg.cpp +++ b/projects/sgconf/common_sg.cpp @@ -434,8 +434,8 @@ GetUserData cbdata(request, false); int res = 0; if (isMessage) { - sc.SetSendMessageCb(RecvSetUserAnswer, &cbdata); - res = sc.MsgUser(str.c_str()); + sc.SetSendMessageCallback(RecvSetUserAnswer, &cbdata); + res = sc.SendMessage(str.c_str()); } else { diff --git a/stglibs/srvconf.lib/servconf.cpp b/stglibs/srvconf.lib/servconf.cpp index d48424e0..f2498ef5 100644 --- a/stglibs/srvconf.lib/servconf.cpp +++ b/stglibs/srvconf.lib/servconf.cpp @@ -18,12 +18,6 @@ * Author : Boris Mikhailenko */ - /* - $Revision: 1.8 $ - $Date: 2010/08/04 00:40:38 $ - $Author: faust $ - */ - #include "stg/servconf.h" #include "stg/common.h" @@ -31,10 +25,8 @@ #include #include -using namespace std; - //----------------------------------------------------------------------------- -int AnsRecv(void * data, list * list1) +int AnsRecv(void * data, std::list * list1) { SERVCONF * sc = static_cast(data); @@ -46,7 +38,7 @@ char ans[ENC_MSG_LEN + 1]; int len, done = 0; //loop parsing -list::iterator node; +std::list::iterator node; node = list1->begin(); while (node != list1->end()) @@ -64,7 +56,6 @@ while (node != list1->end()) return st_xml_parse_error; } ++node; - } return st_ok; @@ -72,22 +63,18 @@ return st_ok; //----------------------------------------------------------------------------- void Start(void *data, const char *el, const char **attr) { -SERVCONF * sc; -sc = (SERVCONF*)data; +SERVCONF * sc = static_cast(data); sc->Start(el, attr); } //----------------------------------------------------------------------------- -void End(void *data, const char *el) +void End(void * data, const char * el) { -SERVCONF * sc; -sc = (SERVCONF*)data; +SERVCONF * sc = static_cast(data); sc->End(el); } //----------------------------------------------------------------------------- SERVCONF::SERVCONF() - : currParser(NULL), - RecvSendMessageCb(NULL), - sendMessageDataCb(NULL) + : currParser(NULL) { parser = XML_ParserCreate(NULL); nt.SetRxCallback(this, AnsRecv); -- 2.43.2