Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REFAC(client,server): boost calls replaced with STL ones #6731

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

g-virus-dev
Copy link

@g-virus-dev g-virus-dev commented Feb 19, 2025

This commit replaces boost calls with STL ones

Copy link
Member

@Krzmbrzl Krzmbrzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking, I am quite happy with this PR. I think using nullopt_t instead of {} might make the code a bit clearer in some cases but it's not a major thing. So if someone else (especially @g-virus-dev) disagrees, this is nothing I'll insist on.

Mostly the changes need to be split into different commits where each commit contains all code changes related to a single logical refactoring. Once this is all done, the code needs to be formatted to conform to our formatting rules but this has to be done with clang-format v10 for now so I could also do this in the end.

Finally, with Boost Accumulators I am not sure whether completely removing Boost is the way to go. I usually prefer reusing existing libs instead of having to reimplement their functionality (especially Boost as that's pretty much omnipresent in the C++ ecosystem).

.gitignore Outdated
@@ -17,7 +17,7 @@ indent.sh
*.vcxproj
*.vcxproj.*
*~
*.pro.user
*.user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the relation of this change to removing the Boost dependency?

@@ -45,7 +45,7 @@ BonjourServiceResolver::BonjourServiceResolver(QObject *p) : QObject(p) {
}

BonjourServiceResolver::~BonjourServiceResolver() {
foreach(ResolveRecord *rr, qmResolvers)
for (ResolveRecord *rr : qmResolvers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While these changes are very much welcome, I would prefer having them in a separate commit that is disentangled from the Boost removal.

@@ -111,10 +111,6 @@ def main():

wrapperContent = create_disclaimerComment()

# Include boost-bind as we'll need it later
wrapperContent += "\n#include <boost/bind/bind.hpp>\n\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should include <function> instead.

@@ -180,7 +180,7 @@ target_link_libraries(shared
OpenSSL::SSL
Qt6::Core
Qt6::Network
Qt6::Xml
Qt6::Xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated formatting change - please remove as tabs are used above it as well.

Comment on lines 19 to 22
const QString& hostname() const;
quint16 port() const;
qint64 priority() const;
const QList< HostAddress >& addresses() const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes have nothing to do with removal of Boost and should therefore be in a separate commit

Comment on lines -15 to -18
#ifndef Q_MOC_RUN
# include <boost/scoped_ptr.hpp>
# include <boost/shared_array.hpp>
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<memory>

Comment on lines 1873 to 1874
for (ChanACL* a : c->qlACL)
delete a;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave explicit braces in the code.

const MumbleProto::ACL_ChanGroup &group = msg.groups(i);
g = new Group(c, u8(group.name()));
Group* g = new Group(c, u8(group.name()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another independent changeset

foreach (c, chans) {
foreach (User *p, c->qlUsers)
for (const auto& c : chans) {
for (User *p : c->qlUsers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While touching this code, please add explicit braces around loop body

@@ -62,8 +62,10 @@ void LimitTest::testLimits(QCoreApplication &a) {
if ((count & 1023) == 0)
qWarning("%d descriptors...", count);
}
foreach (QFile *qf, ql)

for (QFile *qf : ql)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add explicit braces

This commit replaces boost classes with its STL alternatives
This commit replaces boost calls that can be simply replaced with STL ones
@g-virus-dev g-virus-dev changed the title REFAC(client,server): removed boost REFAC(client,server): boost calls replaced with STL ones Feb 27, 2025
Copy link
Member

@Hartmnt Hartmnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also looks like you introduced a lot of unrelated whitespace changes. Please use clang-format in version 10 (!) on these files. This should be done for each commit separately, not once in the end. Otherwise, we end up with single commits that are not passing the CI.

Furthermore, you added a merge commit by accident.

@@ -45,7 +45,7 @@ list(APPEND CMAKE_MODULE_PATH
)

if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say please use a separate, dedicated commit just to raise the C++ version

In this dedicated commit, also change this doc: https://github.com/mumble-voip/mumble/blob/master/docs/dev/build-instructions/README.md to include cpp20 instead of 17

@Hartmnt
Copy link
Member

Hartmnt commented Feb 27, 2025

And your changes are not compiling quite yet. See CI logs for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants