mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 23:45:14 +02:00
- some coverity based cleanups
This commit is contained in:
@@ -65,16 +65,21 @@ FILENAME=$(echo "${PROJECT}" | tr '/' '_')_${DESCRIPTION}
|
|||||||
|
|
||||||
export PATH="${PATH}:${COVERITY_ANALYSIS_ROOT}/bin"
|
export PATH="${PATH}:${COVERITY_ANALYSIS_ROOT}/bin"
|
||||||
|
|
||||||
|
sudo /sbin/sysctl vsyscall=emulate
|
||||||
|
|
||||||
# cleanup old build files
|
# cleanup old build files
|
||||||
cd $CURRENTDIR
|
cd $CURRENTDIR
|
||||||
rm -rf build
|
rm -rf build
|
||||||
./build-mg.sh -m 1
|
./build-mg.sh -m 1
|
||||||
|
|
||||||
# Build using Coverity Scan build tool
|
# Build using Coverity Scan build tool
|
||||||
|
echo "About to use cov-build to analyse code..."
|
||||||
cd build/
|
cd build/
|
||||||
|
# cov-build --dir ${BUILDTOOL} make -j ${NUMCORES}
|
||||||
cov-build --dir ${BUILDTOOL} make -j ${NUMCORES}
|
cov-build --dir ${BUILDTOOL} make -j ${NUMCORES}
|
||||||
|
|
||||||
# Create archive to upload to coverity
|
# Create archive to upload to coverity
|
||||||
|
echo "About to send analyzed code to coverity website..."
|
||||||
tar czf ${FILENAME}.tar.gz ${BUILDTOOL}/
|
tar czf ${FILENAME}.tar.gz ${BUILDTOOL}/
|
||||||
ls -la ${FILENAME}.tar.gz
|
ls -la ${FILENAME}.tar.gz
|
||||||
# exit 1
|
# exit 1
|
||||||
|
@@ -2349,6 +2349,7 @@ unsigned int NetworkMessageSynchNetworkGameData::getPackedSizeHeader() {
|
|||||||
static unsigned int result = 0;
|
static unsigned int result = 0;
|
||||||
if(result == 0) {
|
if(result == 0) {
|
||||||
Data packedData;
|
Data packedData;
|
||||||
|
packedData.messageType=0;
|
||||||
unsigned char *buf = new unsigned char[sizeof(packedData)*3];
|
unsigned char *buf = new unsigned char[sizeof(packedData)*3];
|
||||||
result = pack(buf, getPackedMessageFormatHeader(),
|
result = pack(buf, getPackedMessageFormatHeader(),
|
||||||
packedData.messageType,
|
packedData.messageType,
|
||||||
|
@@ -2188,12 +2188,15 @@ void BroadCastClientSocketThread::execute() {
|
|||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char buff[10024]=""; // Buffers the data to be broadcasted.
|
char buff[10025]=""; // Buffers the data to be broadcasted.
|
||||||
// Keep getting packets forever.
|
// Keep getting packets forever.
|
||||||
for( time_t elapsed = time(NULL); difftime((long int)time(NULL),elapsed) <= 5; ) {
|
for( time_t elapsed = time(NULL); difftime((long int)time(NULL),elapsed) <= 5; ) {
|
||||||
alen = sizeof(struct sockaddr);
|
alen = sizeof(struct sockaddr);
|
||||||
int nb=0;// The number of bytes read.
|
int nb=0;// The number of bytes read.
|
||||||
bool gotData = (nb = recvfrom(bcfd, buff, 10024, 0, (struct sockaddr *) &bcSender, &alen)) > 0;
|
bool gotData = (nb = recvfrom(bcfd, buff, 10024, 0, (struct sockaddr *) &bcSender, &alen)) > 0;
|
||||||
|
if(nb >= 0) {
|
||||||
|
buff[nb]=0;
|
||||||
|
}
|
||||||
|
|
||||||
//printf("Broadcasting client nb = %d buff [%s] gotData = %d\n",nb,buff,gotData);
|
//printf("Broadcasting client nb = %d buff [%s] gotData = %d\n",nb,buff,gotData);
|
||||||
|
|
||||||
|
@@ -103,7 +103,7 @@ public:
|
|||||||
BaseThread *base_thread = dynamic_cast<BaseThread *>(thread);
|
BaseThread *base_thread = dynamic_cast<BaseThread *>(thread);
|
||||||
if(base_thread != NULL &&
|
if(base_thread != NULL &&
|
||||||
(base_thread->getRunningStatus() == true || base_thread->getExecutingTask() == true)) {
|
(base_thread->getRunningStatus() == true || base_thread->getExecutingTask() == true)) {
|
||||||
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
|
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,base_thread->getUniqueID().c_str());
|
||||||
|
|
||||||
base_thread->signalQuit();
|
base_thread->signalQuit();
|
||||||
sleep(10);
|
sleep(10);
|
||||||
|
Reference in New Issue
Block a user