- removed some compiler warnings

pull/93/head
Michael Zillgith 7 years ago
parent 3b577fbf3a
commit bbb56a16a3

@ -22,14 +22,13 @@
*/ */
#include "hal_socket.h" #include "hal_socket.h"
#include <sys/socket.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/select.h> #include <sys/select.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>

@ -882,7 +882,7 @@ IedConnection_getVariableSpecificationAsync(IedConnection self, IedClientError*
if ((domainId == NULL) || (itemId == NULL)) { if ((domainId == NULL) || (itemId == NULL)) {
*error = IED_ERROR_OBJECT_REFERENCE_INVALID; *error = IED_ERROR_OBJECT_REFERENCE_INVALID;
goto cleanup_and_exit; return 0;
} }
IedConnectionOutstandingCall call = iedConnection_allocateOutstandingCall(self); IedConnectionOutstandingCall call = iedConnection_allocateOutstandingCall(self);
@ -904,8 +904,6 @@ IedConnection_getVariableSpecificationAsync(IedConnection self, IedClientError*
if (err != MMS_ERROR_NONE) if (err != MMS_ERROR_NONE)
iedConnection_releaseOutstandingCall(self, call); iedConnection_releaseOutstandingCall(self, call);
cleanup_and_exit:
return invokeId; return invokeId;
} }
@ -1419,6 +1417,8 @@ IedConnection_writeObject(IedConnection self, IedClientError* error, const char*
*brace = 0; *brace = 0;
MmsConnection_writeSingleArrayElementWithComponent(self->connection, &mmsError, domainId, itemId, index, component, value); MmsConnection_writeSingleArrayElementWithComponent(self->connection, &mmsError, domainId, itemId, index, component, value);
*error = iedConnection_mapMmsErrorToIedError(mmsError);
} }
else else
*error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT; *error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT;
@ -1426,10 +1426,11 @@ IedConnection_writeObject(IedConnection self, IedClientError* error, const char*
else else
*error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT; *error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT;
} }
else else {
MmsConnection_writeVariable(self->connection, &mmsError, domainId, itemId, value); MmsConnection_writeVariable(self->connection, &mmsError, domainId, itemId, value);
*error = iedConnection_mapMmsErrorToIedError(mmsError); *error = iedConnection_mapMmsErrorToIedError(mmsError);
}
} }
static void static void
@ -1489,7 +1490,7 @@ IedConnection_writeObjectAsync(IedConnection self, IedClientError* error, const
call->callbackParameter = parameter; call->callbackParameter = parameter;
call->invokeId = 0; call->invokeId = 0;
MmsError err = MMS_ERROR_NONE; MmsError err;
/* check if item ID contains an array "(..)" */ /* check if item ID contains an array "(..)" */
char* brace = strchr(itemId, '('); char* brace = strchr(itemId, '(');
@ -1512,6 +1513,8 @@ IedConnection_writeObjectAsync(IedConnection self, IedClientError* error, const
call->invokeId = MmsConnection_writeSingleArrayElementWithComponentAsync(self->connection, &err, domainId, itemId, index, component, value, call->invokeId = MmsConnection_writeSingleArrayElementWithComponentAsync(self->connection, &err, domainId, itemId, index, component, value,
writeVariableHandler, self); writeVariableHandler, self);
*error = iedConnection_mapMmsErrorToIedError(err);
} }
else else
*error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT; *error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT;
@ -1519,12 +1522,13 @@ IedConnection_writeObjectAsync(IedConnection self, IedClientError* error, const
else else
*error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT; *error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT;
} }
else else {
call->invokeId = MmsConnection_writeVariableAsync(self->connection, &err, domainId, itemId, value, writeVariableHandler, self); call->invokeId = MmsConnection_writeVariableAsync(self->connection, &err, domainId, itemId, value, writeVariableHandler, self);
*error = iedConnection_mapMmsErrorToIedError(err); *error = iedConnection_mapMmsErrorToIedError(err);
}
if (err != MMS_ERROR_NONE) { if (*error != IED_ERROR_OK) {
iedConnection_releaseOutstandingCall(self, call); iedConnection_releaseOutstandingCall(self, call);
return 0; return 0;
} }
@ -3282,8 +3286,6 @@ IedConnection_readDataSetValuesAsync(IedConnection self, IedClientError* error,
const char* domainId = NULL; const char* domainId = NULL;
const char* itemId = NULL; const char* itemId = NULL;
*error = IED_ERROR_OK;
bool isAssociationSpecific = false; bool isAssociationSpecific = false;
if (dataSetReference[0] != '@') { if (dataSetReference[0] != '@') {
@ -3322,7 +3324,6 @@ IedConnection_readDataSetValuesAsync(IedConnection self, IedClientError* error,
isAssociationSpecific = true; isAssociationSpecific = true;
} }
IedConnectionOutstandingCall call = iedConnection_allocateOutstandingCall(self); IedConnectionOutstandingCall call = iedConnection_allocateOutstandingCall(self);
if (call == NULL) { if (call == NULL) {
@ -3348,10 +3349,9 @@ IedConnection_readDataSetValuesAsync(IedConnection self, IedClientError* error,
call->invokeId = MmsConnection_readNamedVariableListValuesAsync(self->connection, &err, call->invokeId = MmsConnection_readNamedVariableListValuesAsync(self->connection, &err,
domainId, itemId, true, getDataSetHandlerInternal, self); domainId, itemId, true, getDataSetHandlerInternal, self);
if ((err != MMS_ERROR_NONE) || (*error != IED_ERROR_OK)) { *error = iedConnection_mapMmsErrorToIedError(err);
if (err != MMS_ERROR_NONE) if (err != MMS_ERROR_NONE) {
*error = iedConnection_mapMmsErrorToIedError(err);
GLOBAL_FREEMEM(call->specificParameter2.pointer); GLOBAL_FREEMEM(call->specificParameter2.pointer);
@ -3504,11 +3504,9 @@ IedConnection_writeDataSetValuesAsync(IedConnection self, IedClientError* error,
call->invokeId = MmsConnection_writeNamedVariableListAsync(self->connection, &err, isAssociationSpecific, domainId, itemId, values, writeDataSetHandlerInternal, self); call->invokeId = MmsConnection_writeNamedVariableListAsync(self->connection, &err, isAssociationSpecific, domainId, itemId, values, writeDataSetHandlerInternal, self);
if ((err != MMS_ERROR_NONE) || (*error != IED_ERROR_OK)) { *error = iedConnection_mapMmsErrorToIedError(err);
if (err != MMS_ERROR_NONE)
*error = iedConnection_mapMmsErrorToIedError(err);
if (err != MMS_ERROR_NONE) {
iedConnection_releaseOutstandingCall(self, call); iedConnection_releaseOutstandingCall(self, call);
return 0; return 0;

@ -1706,8 +1706,7 @@ void
MmsValue_setMmsString(MmsValue* self, const char* string) MmsValue_setMmsString(MmsValue* self, const char* string)
{ {
if (self->type == MMS_STRING) { if (self->type == MMS_STRING) {
if (self->value.visibleString.buf != NULL); setVisibleStringValue(self, string);
setVisibleStringValue(self, string);
} }
} }
@ -1750,8 +1749,7 @@ void
MmsValue_setVisibleString(MmsValue* self, const char* string) MmsValue_setVisibleString(MmsValue* self, const char* string)
{ {
if (self->type == MMS_VISIBLE_STRING) { if (self->type == MMS_VISIBLE_STRING) {
if (self->value.visibleString.buf != NULL); setVisibleStringValue(self, string);
setVisibleStringValue(self, string);
} }
} }

Loading…
Cancel
Save