- removed some compiler warnings (when compiling with clang)

pull/309/head
Michael Zillgith 5 years ago
parent db1671587e
commit de2ce1d008

@ -102,13 +102,13 @@ downloadHandler(void* parameter, uint8_t* buffer, uint32_t bytesRead)
printf("received %i bytes\n", bytesRead); printf("received %i bytes\n", bytesRead);
if (bytesRead > 0) { if (bytesRead > 0) {
if (fwrite(buffer, bytesRead, 1, fp) == 1) if (fwrite(buffer, bytesRead, 1, fp) != 1) {
return true;
else {
printf("Failed to write local file!\n"); printf("Failed to write local file!\n");
return false; return false;
} }
} }
return true;
} }
static void static void

@ -535,6 +535,7 @@ mmsServer_fileUploadTask(MmsServer self, MmsObtainFileTask task)
FileSystem_closeFile(task->fileHandle); FileSystem_closeFile(task->fileHandle);
task->fileHandle = NULL; task->fileHandle = NULL;
} }
deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename); deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename);
if (DEBUG_MMS_SERVER) if (DEBUG_MMS_SERVER)
@ -563,7 +564,7 @@ mmsServer_fileUploadTask(MmsServer self, MmsObtainFileTask task)
FileSystem_closeFile(task->fileHandle); FileSystem_closeFile(task->fileHandle);
task->fileHandle = NULL; task->fileHandle = NULL;
if (task->destinationFilename) if (task->destinationFilename[0])
deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename); deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename);
} }
@ -599,10 +600,12 @@ mmsServer_fileUploadTask(MmsServer self, MmsObtainFileTask task)
{ {
if (DEBUG_MMS_SERVER) if (DEBUG_MMS_SERVER)
printf("MMS_SERVER: file service interrupted, due to client disconnection\n"); printf("MMS_SERVER: file service interrupted, due to client disconnection\n");
if (task->fileHandle){ if (task->fileHandle){
FileSystem_closeFile(task->fileHandle); FileSystem_closeFile(task->fileHandle);
task->fileHandle = NULL; task->fileHandle = NULL;
if (task->destinationFilename)
if (task->destinationFilename[0])
deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename); deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename);
} }
task->state = MMS_FILE_UPLOAD_STATE_NOT_USED; task->state = MMS_FILE_UPLOAD_STATE_NOT_USED;

@ -356,7 +356,7 @@ parseASDU(SVReceiver self, SVSubscriber subscriber, uint8_t* buffer, int length)
if (SVSubscriber_ASDU_hasDatSet(&asdu)) if (SVSubscriber_ASDU_hasDatSet(&asdu))
printf("SV_SUBSCRIBER: DatSet: %s\n", asdu.datSet); printf("SV_SUBSCRIBER: DatSet: %s\n", asdu.datSet);
if (SVSubscriber_ASDU_hasRefrTm(&asdu)) if (SVSubscriber_ASDU_hasRefrTm(&asdu))
printf("SV_SUBSCRIBER: RefrTm[ns]: %lu\n", SVSubscriber_ASDU_getRefrTmAsNs(&asdu)); printf("SV_SUBSCRIBER: RefrTm[ns]: %llu\n", SVSubscriber_ASDU_getRefrTmAsNs(&asdu));
if (SVSubscriber_ASDU_hasSmpMod(&asdu)) if (SVSubscriber_ASDU_hasSmpMod(&asdu))
printf("SV_SUBSCRIBER: SmpMod: %d\n", SVSubscriber_ASDU_getSmpMod(&asdu)); printf("SV_SUBSCRIBER: SmpMod: %d\n", SVSubscriber_ASDU_getSmpMod(&asdu));
if (SVSubscriber_ASDU_hasSmpRate(&asdu)) if (SVSubscriber_ASDU_hasSmpRate(&asdu))

Loading…
Cancel
Save