-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ def generateFunction(className, functionName, wrapArgs, callArgs): | |
function += "\t}\n" | ||
function += "#endif // ACCESS_" + className + "_" + functionName + "_ALL\n" | ||
function += "\n" | ||
function += "\tExecEvent *ie = new ExecEvent(boost::bind(&impl_" + className + "_" + functionName + ", " + ", ".join(callArgs) + "));\n" | ||
function += "\tExecEvent *ie = new ExecEvent(std::bind(&impl_" + className + "_" + functionName + ", " + ", ".join(callArgs) + "));\n" | ||
function += "\tQCoreApplication::instance()->postEvent(mi, ie);\n" | ||
function += "}\n" | ||
|
||
|
@@ -111,9 +111,7 @@ def main(): | |
|
||
wrapperContent = create_disclaimerComment() | ||
|
||
# Include boost-bind as we'll need it later | ||
wrapperContent += "\n#include <boost/bind/bind.hpp>\n\n" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we should include |
||
|
||
wrapperContent +="\n#include <functional>\n\n" | ||
|
||
className = "" | ||
for currentLine in generatedIceHeader.split("\n"): | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -6,15 +6,13 @@ | |||||||
#ifndef MUMBLE_USER_H_ | ||||||||
#define MUMBLE_USER_H_ | ||||||||
|
||||||||
#ifndef Q_MOC_RUN | ||||||||
# include <boost/optional.hpp> | ||||||||
#endif | ||||||||
|
||||||||
#include <QtCore/QByteArray> | ||||||||
#include <QtCore/QDateTime> | ||||||||
#include <QtCore/QList> | ||||||||
#include <QtCore/QString> | ||||||||
|
||||||||
#include <optional> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We (mostly) try to keep different headers in different include blocks. That is, different blocks per library. |
||||||||
|
||||||||
class Channel; | ||||||||
|
||||||||
class User { | ||||||||
|
@@ -46,7 +44,7 @@ class User { | |||||||
struct UserInfo { | ||||||||
int user_id; | ||||||||
QString name; | ||||||||
boost::optional< int > last_channel; | ||||||||
std::optional< int > last_channel; | ||||||||
QDateTime last_active; | ||||||||
|
||||||||
UserInfo() : user_id(-1) {} | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,6 @@ | |
#include <QObject> | ||
#include <QThread> | ||
|
||
#include <boost/array.hpp> | ||
#include <boost/shared_ptr.hpp> | ||
|
||
#include <cstdint> | ||
#include <fstream> | ||
#include <list> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to include |
||
|
@@ -34,7 +31,7 @@ | |
class AudioInput; | ||
struct OpusEncoder; | ||
struct ReNameNoiseDenoiseState; | ||
typedef boost::shared_ptr< AudioInput > AudioInputPtr; | ||
typedef std::shared_ptr< AudioInput > AudioInputPtr; | ||
|
||
/** | ||
* A chunk of audio data to process | ||
|
@@ -195,7 +192,7 @@ class AudioInput : public QThread { | |
bool selectCodec(); | ||
void selectNoiseCancel(); | ||
|
||
typedef boost::array< unsigned char, 960 > EncodingOutputBuffer; | ||
typedef std::array< unsigned char, 960 > EncodingOutputBuffer; | ||
|
||
int encodeOpusFrame(short *source, int size, EncodingOutputBuffer &buffer); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ AudioOutputPtr AudioOutputRegistrar::newFromChoice(QString choice) { | |
} | ||
|
||
AudioOutputRegistrar *r = nullptr; | ||
foreach (AudioOutputRegistrar *aor, *qmNew) | ||
for (AudioOutputRegistrar *aor : *qmNew) | ||
if (!r || (aor->priority > r->priority)) | ||
r = aor; | ||
if (r) { | ||
|
@@ -508,9 +508,9 @@ bool AudioOutput::mix(void *outbuff, unsigned int frameCount) { | |
bool validListener = false; | ||
|
||
// Initialize recorder if recording is enabled | ||
boost::shared_array< float > recbuff; | ||
std::shared_ptr<float[]> recbuff; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't do that already, we should add a |
||
if (recorder) { | ||
recbuff = boost::shared_array< float >(new float[frameCount]); | ||
recbuff = std::make_shared<float[]>(frameCount); | ||
memset(recbuff.get(), 0, sizeof(float) * frameCount); | ||
recorder->prepareBufferAdds(); | ||
} | ||
|
@@ -654,7 +654,7 @@ bool AudioOutput::mix(void *outbuff, unsigned int frameCount) { | |
|
||
if (!recorder->isInMixDownMode()) { | ||
recorder->addBuffer(speech->p, recbuff, static_cast< int >(frameCount)); | ||
recbuff = boost::shared_array< float >(new float[frameCount]); | ||
recbuff = std::make_shared<float[]>(frameCount); | ||
memset(recbuff.get(), 0, sizeof(float) * frameCount); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,8 @@ | |
|
||
#include <QtCore/QObject> | ||
#include <QtCore/QThread> | ||
#include <boost/shared_ptr.hpp> | ||
|
||
#include <memory> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separate include blocks |
||
|
||
#include "MumbleProtocol.h" | ||
|
||
|
@@ -44,7 +45,7 @@ class ClientUser; | |
class AudioOutputBuffer; | ||
class AudioOutputToken; | ||
|
||
typedef boost::shared_ptr< AudioOutput > AudioOutputPtr; | ||
typedef std::shared_ptr< AudioOutput > AudioOutputPtr; | ||
|
||
class AudioOutputRegistrar { | ||
private: | ||
|
There was a problem hiding this comment.
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