Commit f31d9133 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2

build: fix some warnings

fix warnings generated by our files.
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Change-Id: I8b5b4d4c74ddfac6b3e40ae79f7382133632f9f2
parent 508afb6f
......@@ -33,7 +33,7 @@ static const char encoding_table[] = {
'3', '4', '5', '6', '7', '8', '9', '+', '/'
};
static const int mod_table[] = { 0, 2, 1 };
static const size_t mod_table[] = { 0, 2, 1 };
char *ring_base64_encode(const uint8_t *input, size_t input_length,
char *output, size_t *output_length)
......@@ -71,7 +71,7 @@ uint8_t *ring_base64_decode(const char *input, size_t input_length,
uint8_t c;
for (c = 0; c < 64; c++)
decoding_table[encoding_table[c]] = c;
decoding_table[static_cast<int>(encoding_table[c])] = c;
if (input_length % 4 != 0)
return NULL;
......@@ -88,13 +88,13 @@ uint8_t *ring_base64_decode(const char *input, size_t input_length,
for (i = 0, j = 0; i < input_length;) {
uint8_t sextet_a = input[i] == '=' ? 0 & i++
: decoding_table[input[i++]];
: decoding_table[static_cast<int>(input[i++])];
uint8_t sextet_b = input[i] == '=' ? 0 & i++
: decoding_table[input[i++]];
: decoding_table[static_cast<int>(input[i++])];
uint8_t sextet_c = input[i] == '=' ? 0 & i++
: decoding_table[input[i++]];
: decoding_table[static_cast<int>(input[i++])];
uint8_t sextet_d = input[i] == '=' ? 0 & i++
: decoding_table[input[i++]];
: decoding_table[static_cast<int>(input[i++])];
uint32_t triple = (sextet_a << 3 * 6) +
(sextet_b << 2 * 6) +
......
......@@ -402,15 +402,18 @@ Call::addSubCall(const std::shared_ptr<Call>& call)
std::weak_ptr<Call> wthis = shared_from_this();
std::weak_ptr<Call> wcall = call;
call->addStateListener([wcall,wthis](Call::CallState new_state, Call::ConnectionState new_cstate, int code) {
call->addStateListener([wcall, wthis](Call::CallState new_state,
Call::ConnectionState new_cstate,
UNUSED int code) {
if (auto call = wcall.lock()) {
if (auto sthis = wthis.lock()) {
auto& this_ = *sthis;
auto sit = this_.subcalls.find(call);
if (sit == this_.subcalls.end())
return;
RING_WARN("[call %s] DeviceCall call %s state changed %d %d", this_.getCallId().c_str(), call->getCallId().c_str(),
static_cast<int>(new_state), static_cast<int>(new_cstate));
RING_WARN("[call:%s] DeviceCall call %s state changed %d %d",
this_.getCallId().c_str(), call->getCallId().c_str(),
static_cast<int>(new_state), static_cast<int>(new_cstate));
if (new_state == CallState::OVER) {
std::lock_guard<std::recursive_mutex> lk (this_.callMutex_);
this_.subcalls.erase(call);
......@@ -421,21 +424,22 @@ Call::addSubCall(const std::shared_ptr<Call>& call)
this_.setState(new_cstate);
} else if (new_cstate == ConnectionState::DISCONNECTED && new_state == CallState::ACTIVE) {
std::lock_guard<std::recursive_mutex> lk (this_.callMutex_);
RING_WARN("[call %s] peer hangup", this_.getCallId().c_str());
RING_WARN("[call:%s] peer hangup", this_.getCallId().c_str());
auto subcalls = std::move(this_.subcalls);
for (auto& sub : subcalls) {
if (sub != call)
try {
sub->hangup(0);
} catch(const std::exception& e) {
RING_WARN("[call %s] error hanging up: %s", this_.getCallId().c_str(), e.what());
RING_WARN("[call:%s] error hanging up: %s",
this_.getCallId().c_str(), e.what());
}
}
this_.peerHungup();
}
if (new_state == CallState::ACTIVE && new_cstate == ConnectionState::CONNECTED) {
std::lock_guard<std::recursive_mutex> lk (this_.callMutex_);
RING_WARN("[call %s] peer answer", this_.getCallId().c_str());
RING_WARN("[call:%s] peer answer", this_.getCallId().c_str());
auto subcalls = std::move(this_.subcalls);
for (auto& sub : subcalls) {
if (sub != call)
......@@ -444,12 +448,14 @@ Call::addSubCall(const std::shared_ptr<Call>& call)
this_.merge(call);
Manager::instance().peerAnsweredCall(this_);
}
RING_WARN("[call %s] Remaining %d subcalls", this_.getCallId().c_str(), static_cast<int>(this_.subcalls.size()));
RING_WARN("[call:%s] Remaining %zu subcalls", this_.getCallId().c_str(),
this_.subcalls.size());
if (this_.subcalls.empty())
this_.pendingOutMessages_.clear();
} else {
RING_WARN("DeviceCall IGNORED call %s state changed %d %d", call->getCallId().c_str(),
static_cast<int>(new_state), static_cast<int>(new_cstate));
RING_WARN("DeviceCall IGNORED call %s state changed %d %d",
call->getCallId().c_str(), static_cast<int>(new_state),
static_cast<int>(new_cstate));
}
}
});
......@@ -460,7 +466,7 @@ Call::addSubCall(const std::shared_ptr<Call>& call)
void
Call::merge(std::shared_ptr<Call> scall)
{
RING_WARN("[call %s] merge to -> [call %s]", scall->getCallId().c_str(), getCallId().c_str());
RING_WARN("[call:%s] merge to -> [call:%s]", scall->getCallId().c_str(), getCallId().c_str());
auto& call = *scall;
std::lock(callMutex_, call.callMutex_);
std::lock_guard<std::recursive_mutex> lk1 (callMutex_, std::adopt_lock);
......
......@@ -743,7 +743,7 @@ void AlsaLayer::playback()
auto& playBuff = getToPlay(audioFormat_, maxFrames);
auto& toPlay = ringBuff.frames() > 0 ? ringBuff : playBuff;
if (!toPlay.frames() > 0)
if (!(toPlay.frames() > 0))
return;
toPlay.interleave(playbackIBuff_);
......
......@@ -55,6 +55,7 @@ VaapiAccel::~VaapiAccel()
int
VaapiAccel::allocateBuffer(AVFrame* frame, int flags)
{
(void) flags; // unused
return av_hwframe_get_buffer(framesBufferRef_.get(), frame, 0);
}
......
......@@ -45,10 +45,10 @@ VideoReceiveThread::VideoReceiveThread(const std::string& id,
, dstHeight_(0)
, id_(id)
, stream_(sdp)
, restartDecoder_(false)
, isReset_(isReset)
, sdpContext_(stream_.str().size(), false, &readFunction, 0, 0, this)
, sink_ {Manager::instance().createSinkClient(id)}
, restartDecoder_(false)
, isReset_(isReset)
, requestKeyFrameCallback_(0)
, loop_(std::bind(&VideoReceiveThread::setup, this),
std::bind(&VideoReceiveThread::process, this),
......
......@@ -437,7 +437,8 @@ RingAccount::startOutgoingCall(const std::shared_ptr<SIPCall>& call, const std::
std::chrono::steady_clock::now(),
ice, weak_dev_call,
std::move(listenKey),
callkey, dev
callkey, dev,
nullptr
});
return false;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment