Skip to content

Commit

Permalink
Merge branch '3.7.9-rc' into 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Mar 24, 2023
2 parents 7d29cb7 + 0d92ee5 commit b5a6cca
Show file tree
Hide file tree
Showing 1,026 changed files with 10,211 additions and 39,029 deletions.
105 changes: 0 additions & 105 deletions cpp11/C++11 demos (Universal Windows).sln

This file was deleted.

10 changes: 5 additions & 5 deletions cpp11/Chat/client/ChatUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ string
ChatUtils::unstripHtml(const string& s)
{
string out = s;
for(unsigned int count = 0; count < sizeof(htmlEntities) / sizeof(htmlEntities[0]); ++count)
for(const HtmlEntity& entity : htmlEntities)
{
for(string::size_type pos = out.find(htmlEntities[count].first);
for(string::size_type pos = out.find(entity.first);
pos != string::npos;
pos = out.find(htmlEntities[count].first, pos))
pos = out.find(entity.first, pos))
{
out.replace(pos, htmlEntities[count].first.size(), htmlEntities[count].second);
out.replace(pos, entity.first.size(), entity.second);
}
}
return out;
Expand All @@ -36,7 +36,7 @@ string
ChatUtils::trim(const string& s)
{
static const string delims = "\t\r\n ";
string::size_type last = s.find_last_not_of(delims);
const string::size_type last = s.find_last_not_of(delims);
if(last != string::npos)
{
return s.substr(s.find_first_not_of(delims), last+1);
Expand Down
12 changes: 6 additions & 6 deletions cpp11/Chat/client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ChatRoomCallbackI : public Chat::ChatRoomCallback
virtual void
init(Ice::StringSeq names, const Ice::Current&) override
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "Users: ";
for(auto it = names.begin(); it != names.end();)
{
Expand All @@ -44,21 +44,21 @@ class ChatRoomCallbackI : public Chat::ChatRoomCallback
virtual void
join(long long, string name, const Ice::Current&) override
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << ">>>> " << name << " joined." << endl;
}

virtual void
leave(long long, string name, const Ice::Current&) override
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "<<<< " << name << " left." << endl;
}

virtual void
send(long long, string name, string message, const Ice::Current&) override
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << name << " > " << ChatUtils::unstripHtml(message) << endl;
}
};
Expand Down Expand Up @@ -156,7 +156,7 @@ class ChatClient : public Glacier2::Application
{
if(s.size() > maxMessageSize)
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "Message length exceeded, maximum length is " << maxMessageSize << " characters.";
}
else
Expand All @@ -175,7 +175,7 @@ class ChatClient : public Glacier2::Application
void
menu()
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "enter /quit to exit." << endl;
}
};
Expand Down
22 changes: 11 additions & 11 deletions cpp11/Chat/client/PollingClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class GetUpdatesTask
{
public:

GetUpdatesTask(const shared_ptr<PollingChat::PollingChatSessionPrx>& session) :
explicit GetUpdatesTask(const shared_ptr<PollingChat::PollingChatSessionPrx>& session) :
_session(session)
{
}

~GetUpdatesTask()
{
{
lock_guard<mutex> lock(_mutex);
const lock_guard<mutex> lock(_mutex);
_done = true;
}
_cond.notify_all();
Expand Down Expand Up @@ -67,23 +67,23 @@ class GetUpdatesTask
auto joinedEvt = dynamic_pointer_cast<PollingChat::UserJoinedEvent>(u);
if(joinedEvt)
{
lock_guard<mutex> lkg(coutMutex);
const lock_guard<mutex> lkg(coutMutex);
cout << ">>>> " << joinedEvt->name << " joined." << endl;
}
else
{
auto leftEvt = dynamic_pointer_cast<PollingChat::UserLeftEvent>(u);
if(leftEvt)
{
lock_guard<mutex> lkg(coutMutex);
const lock_guard<mutex> lkg(coutMutex);
cout << ">>>> " << leftEvt->name << " left." << endl;
}
else
{
auto messageEvt = dynamic_pointer_cast<PollingChat::MessageEvent>(u);
if(messageEvt)
{
lock_guard<mutex> lkg(coutMutex);
const lock_guard<mutex> lkg(coutMutex);
cout << messageEvt->name << " > " << ChatUtils::unstripHtml(messageEvt->message) << endl;
}
}
Expand All @@ -93,7 +93,7 @@ class GetUpdatesTask
catch(const Ice::LocalException& ex)
{
{
lock_guard<mutex> lkg(_mutex);
const lock_guard<mutex> lkg(_mutex);
_done = true;
}
if(!dynamic_cast<const Ice::ObjectNotExistException*>(&ex))
Expand All @@ -112,7 +112,7 @@ class GetUpdatesTask

bool isDone() const
{
lock_guard<mutex> lock(const_cast<mutex&>(_mutex));
const lock_guard<mutex> lock(const_cast<mutex&>(_mutex));
return _done;
}

Expand Down Expand Up @@ -157,7 +157,7 @@ main(int argc, char* argv[])
initData.properties->setProperty("OverrideSessionEndpoints", "1");
}

Ice::CommunicatorHolder ich(argc, argv, initData);
const Ice::CommunicatorHolder ich(argc, argv, initData);

if(argc > 1)
{
Expand Down Expand Up @@ -242,7 +242,7 @@ run(const shared_ptr<Ice::Communicator>& communicator)

auto users = session->getInitialUsers();
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "Users: ";
for(auto it = users.begin(); it != users.end();)
{
Expand Down Expand Up @@ -278,7 +278,7 @@ run(const shared_ptr<Ice::Communicator>& communicator)
{
if(s.size() > maxMessageSize)
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "Message length exceeded, maximum length is " << maxMessageSize << " characters.";
}
else
Expand Down Expand Up @@ -316,6 +316,6 @@ run(const shared_ptr<Ice::Communicator>& communicator)
void
menu()
{
lock_guard<mutex> lock(coutMutex);
const lock_guard<mutex> lock(coutMutex);
cout << "enter /quit to exit." << endl;
}
Loading

0 comments on commit b5a6cca

Please sign in to comment.