Modernize: replace typedef with using

This commit is contained in:
badaix 2020-09-21 16:26:04 +02:00
parent f388449c0a
commit f1e672d375
7 changed files with 12 additions and 14 deletions

View file

@ -27,7 +27,7 @@ struct DNSServiceRefDeleter
}
};
typedef std::unique_ptr<DNSServiceRef, DNSServiceRefDeleter> DNSServiceHandle;
using DNSServiceHandle = std::unique_ptr<DNSServiceRef, DNSServiceRefDeleter>;
string BonjourGetError(DNSServiceErrorType error)
{

View file

@ -28,10 +28,10 @@ public:
#if defined(HAS_AVAHI)
#include "browse_avahi.hpp"
typedef BrowseAvahi BrowseZeroConf;
using BrowseZeroConf = BrowseAvahi;
#elif defined(HAS_BONJOUR)
#include "browse_bonjour.hpp"
typedef BrowseBonjour BrowseZeroConf;
using BrowseZeroConf = BrowseBonjour;
#endif
#endif

View file

@ -24,12 +24,10 @@
#include "player.hpp"
typedef int (*AndroidAudioCallback)(short* buffer, int num_samples);
/// OpenSL Audio Player
/// Android Oboe Audio Player
/**
* Player implementation for Oboe
* Player implementation for Android Oboe
*/
class OboePlayer : public Player, public oboe::AudioStreamCallback
{

View file

@ -35,8 +35,8 @@ using json = nlohmann::json;
struct ClientInfo;
struct Group;
typedef std::shared_ptr<ClientInfo> ClientInfoPtr;
typedef std::shared_ptr<Group> GroupPtr;
using ClientInfoPtr = std::shared_ptr<ClientInfo>;
using GroupPtr = std::shared_ptr<Group>;
template <typename T>

View file

@ -35,10 +35,10 @@ protected:
#if defined(HAS_AVAHI)
#include "publish_avahi.hpp"
typedef PublishAvahi PublishZeroConf;
using PublishZeroConf = PublishAvahi;
#elif defined(HAS_BONJOUR)
#include "publish_bonjour.hpp"
typedef PublishBonjour PublishZeroConf;
using PublishZeroConf = PublishBonjour;
#endif
#endif

View file

@ -79,8 +79,8 @@ public:
}
// Implement the ConstBufferSequence requirements.
typedef boost::asio::const_buffer value_type;
typedef const boost::asio::const_buffer* const_iterator;
using value_type = boost::asio::const_buffer;
using const_iterator = const boost::asio::const_buffer*;
const boost::asio::const_buffer* begin() const
{
return &buffer_;

View file

@ -34,7 +34,7 @@ namespace
{
string hex2str(string input)
{
typedef unsigned char byte;
using byte = unsigned char;
unsigned long x = strtoul(input.c_str(), nullptr, 16);
byte a[] = {byte(x >> 24), byte(x >> 16), byte(x >> 8), byte(x), 0};
return string((char*)a);