Skip to content

Commit

Permalink
Make array inputs of external C functions const
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Jan 17, 2024
1 parent b738c6d commit 6e54d1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions Modelica/Resources/C-Sources/ModelicaStandardTables.c
@@ -1,6 +1,6 @@
/* ModelicaStandardTables.c - External table functions
Copyright (C) 2013-2022, Modelica Association and contributors
Copyright (C) 2013-2024, Modelica Association and contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -653,10 +653,10 @@ void* ModelicaStandardTables_CombiTimeTable_init2(_In_z_ const char* fileName,

void* ModelicaStandardTables_CombiTimeTable_init3(_In_z_ const char* fileName,
_In_z_ const char* tableName,
_In_ double* table, size_t nRow,
_In_ const double* table, size_t nRow,
size_t nColumn,
double startTime,
_In_ int* columns,
_In_ const int* columns,
size_t nCols, int smoothness,
int extrapolation,
double shiftTime,
Expand Down Expand Up @@ -2114,9 +2114,9 @@ void* ModelicaStandardTables_CombiTable1D_init2(_In_z_ const char* fileName,

void* ModelicaStandardTables_CombiTable1D_init3(_In_z_ const char* fileName,
_In_z_ const char* tableName,
_In_ double* table, size_t nRow,
_In_ const double* table, size_t nRow,
size_t nColumn,
_In_ int* columns,
_In_ const int* columns,
size_t nCols, int smoothness,
int extrapolation,
int verbose,
Expand Down Expand Up @@ -2920,7 +2920,7 @@ void* ModelicaStandardTables_CombiTable2D_init2(_In_z_ const char* fileName,

void* ModelicaStandardTables_CombiTable2D_init3(_In_z_ const char* fileName,
_In_z_ const char* tableName,
_In_ double* table, size_t nRow,
_In_ const double* table, size_t nRow,
size_t nColumn, int smoothness,
int extrapolation,
int verbose,
Expand Down
12 changes: 6 additions & 6 deletions Modelica/Resources/C-Sources/ModelicaStandardTables.h
@@ -1,6 +1,6 @@
/* ModelicaStandardTables.h - External table functions header
Copyright (C) 2008-2020, Modelica Association and contributors
Copyright (C) 2008-2024, Modelica Association and contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -159,10 +159,10 @@ MODELICA_EXPORT void* ModelicaStandardTables_CombiTimeTable_init2(_In_z_ const c

MODELICA_EXPORT void* ModelicaStandardTables_CombiTimeTable_init3(_In_z_ const char* fileName,
_In_z_ const char* tableName,
_In_ double* table, size_t nRow,
_In_ const double* table, size_t nRow,
size_t nColumn,
double startTime,
_In_ int* columns,
_In_ const int* columns,
size_t nCols, int smoothness,
int extrapolation,
double shiftTime,
Expand Down Expand Up @@ -302,9 +302,9 @@ MODELICA_EXPORT void* ModelicaStandardTables_CombiTable1D_init2(_In_z_ const cha

MODELICA_EXPORT void* ModelicaStandardTables_CombiTable1D_init3(_In_z_ const char* fileName,
_In_z_ const char* tableName,
_In_ double* table, size_t nRow,
_In_ const double* table, size_t nRow,
size_t nColumn,
_In_ int* columns,
_In_ const int* columns,
size_t nCols, int smoothness,
int extrapolation,
int verbose,
Expand Down Expand Up @@ -406,7 +406,7 @@ MODELICA_EXPORT void* ModelicaStandardTables_CombiTable2D_init2(_In_z_ const cha

MODELICA_EXPORT void* ModelicaStandardTables_CombiTable2D_init3(_In_z_ const char* fileName,
_In_z_ const char* tableName,
_In_ double* table, size_t nRow,
_In_ const double* table, size_t nRow,
size_t nColumn, int smoothness,
int extrapolation,
int verbose,
Expand Down
2 changes: 1 addition & 1 deletion ModelicaTest/Tables/CombiTable1Ds.mo
Expand Up @@ -235,7 +235,7 @@ package CombiTable1Ds "Test models for Modelica.Blocks.Tables.CombiTable1Ds"
external "C" dummy_y = mydummyfunc(dummy_u)
annotation(IncludeDirectory="modelica://Modelica/Resources/Data/Tables",
Include = "#include \"usertab.c\"
double mydummyfunc(double* dummy_in) {
double mydummyfunc(const double* dummy_in) {
return 0.;
}
");
Expand Down

0 comments on commit 6e54d1a

Please sign in to comment.