git.stg.codes
/
stg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0093be0
)
[NY] Code deduplication.
author
Maxim Mamontov
<faust.madf@gmail.com>
Sun, 15 Sep 2013 01:30:53 +0000
(
04:30
+0300)
committer
Maxim Mamontov
<faust.madf@gmail.com>
Sun, 15 Sep 2013 01:30:53 +0000
(
04:30
+0300)
projects/sgconf/common_sg.cpp
patch
|
blob
|
history
diff --git
a/projects/sgconf/common_sg.cpp
b/projects/sgconf/common_sg.cpp
index 06fd98237ca55fbc89c6a329ea9f76c6edaec28c..1db7c9c472031d7b710cce5db7367aea50433506 100644
(file)
--- a/
projects/sgconf/common_sg.cpp
+++ b/
projects/sgconf/common_sg.cpp
@@
-294,14
+294,7
@@
void ConvertFromKOI8(const std::string & src, std::string * dst)
ConvertKOI8(src, dst, FROM_KOI8);
}
//-----------------------------------------------------------------------------
ConvertKOI8(src, dst, FROM_KOI8);
}
//-----------------------------------------------------------------------------
-void SendMessageCallback(bool result, const std::string & reason, void * d)
-{
-ResultData * data = static_cast<ResultData *>(d);
-data->result = result;
-data->reason = reason;
-}
-//-----------------------------------------------------------------------------
-void RecvSetUserAnswer(bool result, const std::string & reason, void * d)
+void ResultCallback(bool result, const std::string & reason, void * d)
{
ResultData * data = static_cast<ResultData *>(d);
data->result = result;
{
ResultData * data = static_cast<ResultData *>(d);
data->result = result;
@@
-447,7
+440,7
@@
bool ProcessSetUser(const std::string & server,
SERVCONF sc(server, port, login, password);
ResultData data;
SERVCONF sc(server, port, login, password);
ResultData data;
-int res = sc.ChgUser(str.c_str(), Re
cvSetUserAnswer
, &data);
+int res = sc.ChgUser(str.c_str(), Re
sultCallback
, &data);
if (res == st_ok && data.result)
{
if (res == st_ok && data.result)
{
@@
-470,7
+463,7
@@
bool ProcessSendMessage(const std::string & server, uint16_t port,
SERVCONF sc(server, port, login, password);
ResultData data;
SERVCONF sc(server, port, login, password);
ResultData data;
-int res = sc.SendMessage(requestString.c_str(),
SendMessage
Callback, &data);
+int res = sc.SendMessage(requestString.c_str(),
Result
Callback, &data);
if (res == st_ok && data.result)
{
if (res == st_ok && data.result)
{