Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
f71da8ae
Commit
f71da8ae
authored
Oct 19, 2011
by
Tristan Matthews
Browse files
* #7242: fix warnings in daemon
Check return codes of calls to system
parent
4ef4e203
Changes
6
Hide whitespace changes
Inline
Side-by-side
daemon/configure.ac
View file @
f71da8ae
...
...
@@ -178,7 +178,7 @@ DBUS_CPP_REQUIRED_VERSION=0.6.0-pre1
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AC_MSG_ERROR([You need the DBus-c++ libraries (version $DBUS_CPP_REQUIRED_VERSION or better)]))
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor"
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor
-Werror
"
AC_CHECK_LIB([expat], XML_ParserCreate_MM,
[AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)],
...
...
daemon/src/audio/delaydetection.cpp
View file @
f71da8ae
...
...
@@ -169,8 +169,6 @@ void DelayDetection::process(SFLDataFormat *inputData, int nbSamples)
return
;
crossCorrelate
(
spkrReferenceDown_
,
captureDataDown_
,
correlationResult_
,
micDownSize_
,
spkrDownSize_
);
int
maxIndex
=
getMaxIndex
(
correlationResult_
,
spkrDownSize_
);
}
void
DelayDetection
::
crossCorrelate
(
float
*
ref
,
float
*
seg
,
float
*
res
,
int
refSize
,
int
segSize
)
...
...
daemon/src/audio/delaydetection.h
View file @
f71da8ae
...
...
@@ -113,7 +113,7 @@ class DelayDetection {
void
bandpassFilter
(
float
*
input
,
int
nbSamples
);
int
getMaxIndex
(
float
*
data
,
int
size
);
static
int
getMaxIndex
(
float
*
data
,
int
size
);
State
internalState_
;
...
...
daemon/src/managerimpl.cpp
View file @
f71da8ae
...
...
@@ -1601,7 +1601,7 @@ void ManagerImpl::peerHungupCall(const std::string& call_id)
removeStream
(
call_id
);
if
(
getCallList
().
empty
())
{
DEBUG
(
"Manager: Stop audio stream, ther
is only %d
call
(s)
remaining"
,
getCallList
().
size
()
);
DEBUG
(
"Manager: Stop audio stream, ther
e are no
call
s
remaining"
);
audioLayerMutexLock
();
audiodriver_
->
stopStream
();
...
...
@@ -2784,7 +2784,7 @@ ManagerImpl::getAccount(const std::string& accountID) const
std
::
string
ManagerImpl
::
getAccountIdFromNameAndServer
(
const
std
::
string
&
userName
,
const
std
::
string
&
server
)
const
{
INFO
(
"Manager : username = %s
, server = %s"
,
userName
.
c_str
(),
server
.
c_str
());
INFO
(
"Manager : username = %s, server = %s"
,
userName
.
c_str
(),
server
.
c_str
());
// Try to find the account id from username and server name by full match
for
(
AccountMap
::
const_iterator
iter
=
accountMap_
.
begin
();
iter
!=
accountMap_
.
end
();
++
iter
)
{
...
...
daemon/test/historytest.cpp
View file @
f71da8ae
...
...
@@ -40,10 +40,24 @@
using
std
::
cout
;
using
std
::
endl
;
namespace
{
void
restore
()
{
if
(
system
(
"mv "
HISTORY_SAMPLE
".bak "
HISTORY_SAMPLE
)
<
0
)
ERROR
(
"Restoration of %s failed"
HISTORY_SAMPLE
);
}
void
backup
()
{
if
(
system
(
"cp "
HISTORY_SAMPLE
" "
HISTORY_SAMPLE
".bak"
)
<
0
)
ERROR
(
"Backup of %s failed"
,
HISTORY_SAMPLE
);
}
}
void
HistoryTest
::
setUp
()
{
system
(
"cp "
HISTORY_SAMPLE
" "
HISTORY_SAMPLE
".bak"
);
// Instan
c
iate the cleaner singleton
backup
(
);
// Instan
t
iate the cleaner singleton
history
=
new
HistoryManager
();
}
...
...
@@ -226,5 +240,5 @@ void HistoryTest::tearDown()
// Delete the history object
delete
history
;
history
=
0
;
system
(
"mv "
HISTORY_SAMPLE
".bak "
HISTORY_SAMPLE
);
restore
(
);
}
daemon/test/main.cpp
View file @
f71da8ae
...
...
@@ -39,6 +39,19 @@
#include
<cppunit/extensions/TestFactoryRegistry.h>
#include
<cppunit/ui/text/TextTestRunner.h>
namespace
{
void
restore
()
{
if
(
system
(
"mv "
CONFIG_SAMPLE
".bak "
CONFIG_SAMPLE
)
<
0
)
ERROR
(
"Restoration of %s failed"
,
CONFIG_SAMPLE
);
}
void
backup
()
{
if
(
system
(
"cp "
CONFIG_SAMPLE
" "
CONFIG_SAMPLE
".bak"
)
<
0
)
ERROR
(
"Backup of %s failed"
,
CONFIG_SAMPLE
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"
\n
SFLphone Daemon Test Suite, by Savoir-Faire Linux 2004-2010
\n\n
"
);
...
...
@@ -90,7 +103,7 @@ int main(int argc, char* argv[])
}
printf
(
"
\n\n
=== SFLphone initialization ===
\n\n
"
);
system
(
"cp "
CONFIG_SAMPLE
" "
CONFIG_SAMPLE
".bak"
);
backup
(
);
Manager
::
instance
().
init
(
CONFIG_SAMPLE
);
// Get the top level suite from the registry
...
...
@@ -99,7 +112,7 @@ int main(int argc, char* argv[])
if
(
suite
->
getChildTestCount
()
==
0
)
{
ERROR
(
"Invalid test suite name: %s"
,
testSuiteName
.
c_str
());
system
(
"mv "
CONFIG_SAMPLE
".bak "
CONFIG_SAMPLE
);
restore
(
);
return
1
;
}
...
...
@@ -122,7 +135,7 @@ int main(int argc, char* argv[])
Manager
::
instance
().
terminate
();
system
(
"mv "
CONFIG_SAMPLE
".bak "
CONFIG_SAMPLE
);
restore
(
);
return
wasSuccessful
?
0
:
1
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment