diff --git a/src/account.cpp b/src/account.cpp index a9a123ebdbb3043a9ebc659bc1446a91118c523a..25c87abcc8fe43f222d413c7faad17e0120662c6 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -54,7 +54,10 @@ #include "system_codec_container.h" #include "ice_transport.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <yaml-cpp/yaml.h> +#pragma GCC diagnostic pop #include "upnp/upnp_control.h" #include "ip_utils.h" diff --git a/src/fileutils.cpp b/src/fileutils.cpp index d9acb442b6c7e9ff1eae9ad6d4129d60d40807f2..d5d7beb3696a7f76188429b3fcab2719b9efdfcd 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -332,7 +332,7 @@ get_cache_dir() } else { #ifdef __ANDROID__ return get_home_dir() + DIR_SEPARATOR_STR + PACKAGE; -#elif __APPLE__ +#elif defined(__APPLE__) return get_home_dir() + DIR_SEPARATOR_STR + "Library" + DIR_SEPARATOR_STR + "Caches" + DIR_SEPARATOR_STR + PACKAGE; @@ -382,7 +382,7 @@ get_data_dir() { #ifdef __ANDROID__ return get_program_dir(); -#elif __APPLE__ +#elif defined(__APPLE__) return get_home_dir() + DIR_SEPARATOR_STR + "Library" + DIR_SEPARATOR_STR + "Application Support" + DIR_SEPARATOR_STR + PACKAGE; diff --git a/src/logger.h b/src/logger.h index 2658d3cadf0522d13547021845454ee29e171df5..cacf3583739abf5a6ea16c2dee3404891901e576 100644 --- a/src/logger.h +++ b/src/logger.h @@ -98,7 +98,7 @@ void strErr(); #define LOGGER(M, LEVEL, ...) __android_log_print(LEVEL, APP_NAME, \ LOG_FORMAT(M, ##__VA_ARGS__)) -#elif _WIN32 +#elif defined(_WIN32) #include "winsyslog.h" diff --git a/src/media/audio/audio_rtp_session.cpp b/src/media/audio/audio_rtp_session.cpp index 5fe0470acda27796af059e16f08a33560d08b376..8d1a8f7af7a3c3c8b5f5f8bb45d035d2c19ba6d4 100644 --- a/src/media/audio/audio_rtp_session.cpp +++ b/src/media/audio/audio_rtp_session.cpp @@ -303,6 +303,8 @@ AudioReceiveThread::process() loop_.stop(); break; + case MediaDecoder::Status::Success: + case MediaDecoder::Status::EOFError: default: break; } diff --git a/src/media/audio/audiobuffer.h b/src/media/audio/audiobuffer.h index 34679712c46829522ad7c2029bec41ae51ff3456..fe25c969c202a1fc0e2f095c7924757440c6c049 100644 --- a/src/media/audio/audiobuffer.h +++ b/src/media/audio/audiobuffer.h @@ -31,9 +31,13 @@ #ifndef _AUDIO_BUFFER_H #define _AUDIO_BUFFER_H +#if __cplusplus >= 201103L + #undef isblank +#endif + +#include <sstream> #include <vector> #include <string> -#include <sstream> #include <cstddef> // for size_t #include "ring_types.h" diff --git a/src/media/media_codec.h b/src/media/media_codec.h index e4ff91b39c1a99aa502b453d9a32c8d6d8150bde..157640d407ba712a3c2806698cce0fc06e07caa5 100644 --- a/src/media/media_codec.h +++ b/src/media/media_codec.h @@ -38,6 +38,7 @@ #endif #include "audio/audiobuffer.h" // for AudioFormat +#include <cctype> #include "ip_utils.h" #include <string> diff --git a/src/media/media_encoder.h b/src/media/media_encoder.h index b031ff6c9916be53ff8198792940a8904fae4efd..aa4c831817935affb36bc9f586cc723e02242ef9 100644 --- a/src/media/media_encoder.h +++ b/src/media/media_encoder.h @@ -114,7 +114,7 @@ private: uint8_t *scaledFrameBuffer_ = nullptr; int scaledFrameBufferSize_ = 0; int streamIndex_ = -1; -#if (LIBAVCODEC_VERSION_MAJOR < 54) +#if defined(LIBAVCODEC_VERSION_MAJOR) && (LIBAVCODEC_VERSION_MAJOR < 54) uint8_t *encoderBuffer_ = nullptr; int encoderBufferSize_ = 0; #endif diff --git a/src/media/srtp.c b/src/media/srtp.c index 1aa965f4209094133741664c153605419b0de0af..f60d0be39fe0e66a1ece95e74d0a531e9a72d51e 100644 --- a/src/media/srtp.c +++ b/src/media/srtp.c @@ -127,6 +127,7 @@ int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr) { uint8_t iv[16] = { 0 }, hmac[20]; int len = *lenptr; +#warning seq_largest and roc may be unitialized int av_uninit(seq_largest); uint32_t ssrc, av_uninit(roc); uint64_t index; diff --git a/src/media/video/video_base.h b/src/media/video/video_base.h index e7299db06050f4526192e521fc3ed1696f6389a0..f7da34637b1c8ed3f43cc973077fc7df89577430 100644 --- a/src/media/video/video_base.h +++ b/src/media/video/video_base.h @@ -34,7 +34,11 @@ #include "noncopyable.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wshadow" #include <yaml-cpp/yaml.h> +#pragma GCC diagnostic pop #include <cstdlib> #include <cstdint> diff --git a/src/media/video/video_device_monitor.cpp b/src/media/video/video_device_monitor.cpp index 997f913455fee9d10004ca562402b64696d1b734..e704a57e8be287f6de09fc1590abe308b71ea9f2 100644 --- a/src/media/video/video_device_monitor.cpp +++ b/src/media/video/video_device_monitor.cpp @@ -33,7 +33,10 @@ #include <cassert> #include <sstream> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <yaml-cpp/yaml.h> +#pragma GCC diagnostic pop #include "manager.h" #include "client/videomanager.h" diff --git a/src/media/video/video_receive_thread.cpp b/src/media/video/video_receive_thread.cpp index 6fb0f71b2b62ea65402d71be649e7163b09b87e8..678956109564aba4bfd824ca80c42b86ccc64802 100644 --- a/src/media/video/video_receive_thread.cpp +++ b/src/media/video/video_receive_thread.cpp @@ -191,7 +191,8 @@ bool VideoReceiveThread::decodeFrame() RING_ERR("fatal error, read failed"); loop_.stop(); - default: + case MediaDecoder::Status::Success: + case MediaDecoder::Status::EOFError: break; } diff --git a/src/preferences.cpp b/src/preferences.cpp index ef1b16508b9efd36f452208e519af2a660dfa6e1..e4f9ad0794994635656d3a86e10da2a508873826 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -55,7 +55,11 @@ #endif #endif /* HAVE_OPENSL */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <yaml-cpp/yaml.h> +#pragma GCC diagnostic pop + #include "config/yamlparser.h" #include "hooks/urlhook.h" #include "sip/sip_utils.h" diff --git a/src/ringdht/sip_transport_ice.cpp b/src/ringdht/sip_transport_ice.cpp index 26acf33d64dc2b9683c6d62c22918d2597b0163a..534ca61b501109d5847755d7be00573a48646012 100644 --- a/src/ringdht/sip_transport_ice.cpp +++ b/src/ringdht/sip_transport_ice.cpp @@ -228,7 +228,7 @@ SipIceTransport::send(pjsip_tx_data *tdata, const pj_sockaddr_t *rem_addr, return PJ_SUCCESS; } -ssize_t +void SipIceTransport::onRecv() { rdata_.pkt_info.len += ice_->recv(comp_id_, diff --git a/src/ringdht/sip_transport_ice.h b/src/ringdht/sip_transport_ice.h index 26d39c75bd90537674b26a152f571ab3d701218c..f1bd4d3d5a203fe33c6c5d65c8c56406519e77be 100644 --- a/src/ringdht/sip_transport_ice.h +++ b/src/ringdht/sip_transport_ice.h @@ -92,7 +92,7 @@ struct SipIceTransport int addr_len, void *token, pjsip_transport_callback callback); - ssize_t onRecv(); + void onRecv(); }; } // namespace ring diff --git a/src/security/certstore.cpp b/src/security/certstore.cpp index 4dc03b9c8ae0a2c33eef0b0281c85e5ea55fb638..2cb4028b78c57b622d48bd0fc3b5fddb533790be 100644 --- a/src/security/certstore.cpp +++ b/src/security/certstore.cpp @@ -230,6 +230,7 @@ TrustStore::statusToStr(TrustStore::Status s) return DRing::Certificate::Status::ALLOWED; case Status::BANNED: return DRing::Certificate::Status::BANNED; + case Status::UNDEFINED: default: return DRing::Certificate::Status::UNDEFINED; } diff --git a/src/sip/sipaccount.cpp b/src/sip/sipaccount.cpp index e2a8bdd614a4dc66155991d3522e3965c4064a0a..eb0450a92fbf6a8a04acf6976c583140fa709778 100644 --- a/src/sip/sipaccount.cpp +++ b/src/sip/sipaccount.cpp @@ -49,7 +49,10 @@ #include "sippresence.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <yaml-cpp/yaml.h> +#pragma GCC diagnostic pop #include "account_schema.h" #include "config/yamlparser.h" @@ -126,7 +129,7 @@ SIPAccount::SIPAccount(const std::string& accountID, bool presenceEnabled) , ciphers_(100) , tlsMethod_("TLSv1") , tlsCiphers_() - , tlsServerName_(0, 0) + , tlsServerName_("") , tlsVerifyServer_(false) , tlsVerifyClient_(true) , tlsRequireClientCertificate_(true) @@ -1650,7 +1653,7 @@ SIPAccount::getCredentials() const } void -SIPAccount::setRegistrationState(RegistrationState state, unsigned details_code) +SIPAccount::setRegistrationState(RegistrationState state, unsigned details_code, const std::string& detail_str) { std::string details_str; const pj_str_t *description = pjsip_get_status_text(details_code); diff --git a/src/sip/sipaccount.h b/src/sip/sipaccount.h index f6d81a960c976b6a484f0be90b18f8e00518fb93..cc26564edea584e60b0b12681d31d3e12f25f573 100644 --- a/src/sip/sipaccount.h +++ b/src/sip/sipaccount.h @@ -220,7 +220,7 @@ class SIPAccount : public SIPAccountBase { std::vector<std::map<std::string, std::string>> getCredentials() const; - void setRegistrationState(RegistrationState state, unsigned code=0); + virtual void setRegistrationState(RegistrationState state, unsigned code=0, const std::string& detail_str={}) override; /** * A client sendings a REGISTER request MAY suggest an expiration diff --git a/src/sip/sipaccountbase.cpp b/src/sip/sipaccountbase.cpp index 9a182c5a119cd4fc452a5edcbfca2d5de4940002..35391ae71627937de7f7a719f8d8a3b02c615235 100644 --- a/src/sip/sipaccountbase.cpp +++ b/src/sip/sipaccountbase.cpp @@ -42,7 +42,11 @@ #include "ice_transport.h" #include "config/yamlparser.h" + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <yaml-cpp/yaml.h> +#pragma GCC diagnostic pop #include "client/ring_signal.h" #include "string_utils.h" diff --git a/src/sip/sipcall.cpp b/src/sip/sipcall.cpp index 17621f476bf8c604eb3ceeab953d2c20df7b3319..086318b466bf39862f2edefdbfbdd6886e4aae47 100644 --- a/src/sip/sipcall.cpp +++ b/src/sip/sipcall.cpp @@ -484,6 +484,10 @@ transfer_client_cb(pjsip_evsub *sub, pjsip_event *event) break; } + case PJSIP_EVSUB_STATE_NULL: + case PJSIP_EVSUB_STATE_SENT: + case PJSIP_EVSUB_STATE_PENDING: + case PJSIP_EVSUB_STATE_UNKNOWN: default: break; } diff --git a/src/utf8_utils.cpp b/src/utf8_utils.cpp index d9b8dbdaecc54c68466e9436ccaa5e77c1166996..4088fd692098c06ae013a61bae37246f637e7612 100644 --- a/src/utf8_utils.cpp +++ b/src/utf8_utils.cpp @@ -72,6 +72,9 @@ namespace ring { +bool +utf8_validate_c_str(const char *str, ssize_t max_len, const char **end); + static const char * fast_validate(const char *str) {