Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17997 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 4, 2013
1 parent e6a5bf6 commit d89d4f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions Compiler/runtime/FMIImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ static void importlogger(jm_callbacks* c, jm_string module, jm_log_level_enu_t l
switch (log_level) {
case jm_log_level_fatal:
case jm_log_level_error:
c_add_message(-1, ErrorType_scripting, ErrorLevel_error, gettext("module = %s, log level = %s: %s"), tokens, 3);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_error, gettext("module = %s, log level = %s: %s"), tokens, 3);
break;
case jm_log_level_warning:
c_add_message(-1, ErrorType_scripting, ErrorLevel_warning, gettext("module = %s, log level = %s: %s"), tokens, 3);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_warning, gettext("module = %s, log level = %s: %s"), tokens, 3);
break;
case jm_log_level_info:
case jm_log_level_verbose:
case jm_log_level_debug:
c_add_message(-1, ErrorType_scripting, ErrorLevel_notification, gettext("module = %s, log level = %s: %s"), tokens, 3);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_notification, gettext("module = %s, log level = %s: %s"), tokens, 3);
break;
default:
printf("module = %s, log level = %d: %s\n", module, log_level, message);fflush(NULL);
Expand Down Expand Up @@ -635,7 +635,7 @@ int FMIImpl__initializeFMIImport(const char* file_name, const char* working_dire
if ((version <= fmi_version_unknown_enu) || (version >= fmi_version_unsupported_enu)) {
fmi_import_free_context(context);
const char* tokens[1] = {fmi_version_to_string(version)};
c_add_message(-1, ErrorType_scripting, ErrorLevel_error, gettext("The FMU version is %s. Unknown/Unsupported FMU version."), tokens, 1);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_error, gettext("The FMU version is %s. Unknown/Unsupported FMU version."), tokens, 1);
return 0;
}
if (version == 1) {
Expand All @@ -653,7 +653,7 @@ int FMIImpl__initializeFMIImport(const char* file_name, const char* working_dire
fmi = fmi1_import_parse_xml(context, working_directory);
if(!fmi) {
fmi_import_free_context(context);
c_add_message(-1, ErrorType_scripting, ErrorLevel_error, gettext("Error parsing the modelDescription.xml file."), NULL, 0);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_error, gettext("Error parsing the modelDescription.xml file."), NULL, 0);
return 0;
}
*fmiInstance = mk_some(fmi);
Expand All @@ -663,7 +663,7 @@ int FMIImpl__initializeFMIImport(const char* file_name, const char* working_dire
if (status == jm_status_error) {
fmi1_import_free(fmi);
fmi_import_free_context(context);
c_add_message(-1, ErrorType_scripting, ErrorLevel_error, gettext("Could not create the DLL loading mechanism(C-API)."), NULL, 0);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_error, gettext("Could not create the DLL loading mechanism(C-API)."), NULL, 0);
return 0;
}
FMIImpl__initializeFMI1Import(fmi, fmiInfo, version, experimentAnnotation, modelVariablesInstance, modelVariablesList, input_connectors, output_connectors);
Expand All @@ -682,7 +682,7 @@ int FMIImpl__initializeFMIImport(const char* file_name, const char* working_dire
fmi = fmi2_import_parse_xml(context, working_directory, NULL);
if(!fmi) {
fmi_import_free_context(context);
c_add_message(-1, ErrorType_scripting, ErrorLevel_error, gettext("Error parsing the modelDescription.xml file."), NULL, 0);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_error, gettext("Error parsing the modelDescription.xml file."), NULL, 0);
return 0;
}
*fmiInstance = mk_some(fmi);
Expand All @@ -692,7 +692,7 @@ int FMIImpl__initializeFMIImport(const char* file_name, const char* working_dire
if (status == jm_status_error) {
fmi2_import_free(fmi);
fmi_import_free_context(context);
c_add_message(-1, ErrorType_scripting, ErrorLevel_error, gettext("Could not create the DLL loading mechanism(C-API)."), NULL, 0);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_error, gettext("Could not create the DLL loading mechanism(C-API)."), NULL, 0);
return 0;
}
FMIImpl__initializeFMI2Import(fmi, fmiInfo, version, experimentAnnotation, modelVariablesInstance, modelVariablesList, input_connectors, output_connectors);
Expand Down
6 changes: 3 additions & 3 deletions Compiler/runtime/socketimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ extern int Socket_waitforconnect(int port)
serversocket = make_socket(port);
if (serversocket==0) {
const char *tokens[1] = {strerror(errno)};
c_add_message(-1,ErrorType_scripting,ErrorLevel_error,"make_socket failed: %s",tokens,1);
c_add_message(NULL,-1,ErrorType_scripting,ErrorLevel_error,"make_socket failed: %s",tokens,1);
return -1;
}

if (listen(serversocket,5)==-1) { /* Listen, pending client list length = 1 */
const char *tokens[1] = {strerror(errno)};
c_add_message(-1,ErrorType_scripting,ErrorLevel_error,"listen failed: %s",tokens,1);
c_add_message(NULL,-1,ErrorType_scripting,ErrorLevel_error,"listen failed: %s",tokens,1);
return -1;
}

ns = accept(serversocket,(struct sockaddr *)&clientAddr,&fromlen);

if (ns < 0) {
const char *tokens[1] = {strerror(errno)};
c_add_message(-1,ErrorType_scripting,ErrorLevel_error,"accept failed: %s",tokens,1);
c_add_message(NULL,-1,ErrorType_scripting,ErrorLevel_error,"accept failed: %s",tokens,1);
return -1;
}
return ns;
Expand Down

0 comments on commit d89d4f9

Please sign in to comment.