Commit 6e2fc70e authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #21625: daemon: fix various warnings

parent 429d1f36
......@@ -57,8 +57,8 @@ class AlsaThread {
static void *runCallback(void *context);
NON_COPYABLE(AlsaThread);
AlsaLayer* alsa_;
pthread_t thread_;
AlsaLayer* alsa_;
bool running_;
};
......
......@@ -42,12 +42,12 @@
namespace sfl {
AudioRtpSession::AudioRtpSession(SIPCall &call, ost::RTPDataQueue &queue) :
AudioRtpRecordHandler(call)
, isStarted_(false)
, queue_(queue)
, call_(call)
, timestamp_(0)
, timestampIncrement_(0)
, transportRate_(20)
, queue_(queue)
, isStarted_(false)
, remote_ip_()
, remote_port_(0)
, timestampCount_(0)
......
......@@ -232,13 +232,13 @@ std::string PulseLayer::getAudioDeviceName(int index, PCMType type) const
switch (type) {
case SFL_PCM_PLAYBACK:
case SFL_PCM_RINGTONE:
if (index < 0 or index >= sinkList_.size()) {
if (index < 0 or static_cast<size_t>(index) >= sinkList_.size()) {
ERROR("Index %d out of range", index);
return "";
}
return sinkList_[index];
case SFL_PCM_CAPTURE:
if (index < 0 or index >= sourceList_.size()) {
if (index < 0 or static_cast<size_t>(index) >= sourceList_.size()) {
ERROR("Index %d out of range", index);
return "";
}
......
......@@ -144,7 +144,9 @@ create_pidfile()
}
snprintf(buf, sizeof(buf), "%ld\n", (long) getpid());
if (write(f.fd, buf, strlen(buf)) != strlen(buf)) {
const int buf_strlen = strlen(buf);
if (write(f.fd, buf, buf_strlen) != buf_strlen) {
ERROR("Problem writing to PID file '%s'", f.name.c_str());
close(f.fd);
f.fd = -1;
......@@ -187,8 +189,8 @@ get_home_dir()
struct passwd pwbuf, *pw;
if (getpwuid_r(getuid(), &pwbuf, buf, sizeof(buf), &pw) == 0 and pw != NULL)
return pw->pw_dir;
} else {
return "";
}
return "";
}
}
Supports Markdown
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