Skip to content
Snippets Groups Projects
Commit 6e2fc70e authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #21625: daemon: fix various warnings

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