Skip to content

Commit 1846cc1

Browse files
authored
Merge branch 'develop' into develop
2 parents 74cf16e + 5864796 commit 1846cc1

25 files changed

+10385
-3082
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
- name: Configure (cpp)
3636
if: ${{ matrix.language == 'cpp' }}
37-
run: ./meson.py build --optimization=1
37+
run: ./meson.py setup build --optimization=1
3838

3939
- name: Initialize CodeQL
4040
uses: github/codeql-action/init@v3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Short summary of the minimal requirements:
5454
If you have these tools installed, you can create a configuration using the `meson.py` found in the root source code folder:
5555

5656
```
57-
./meson.py build
57+
./meson.py setup build
5858
```
5959

6060
Use `ninja` to compile and install the code

externals/cgns/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**********************************************************************
2-
https://github.com/CGNS/CGNS/releases,
3-
the source files for CGNS v4.2.0 are bundled and build directly into SU2
2+
https://github.com/CGNS/CGNS/releases,
3+
the source files for CGNS v4.5.0 are bundled and built directly into SU2
44

55
From the CGNS webpage:
66

externals/cgns/adf/ADF_interface.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ static char ADF_A_identification[] = "\300\250\243\251ADF Database Version A0201
9696
/***********************************************************************
9797
Includes
9898
***********************************************************************/
99+
#ifndef _WIN32
100+
#define _POSIX_C_SOURCE 200112L
101+
#endif
99102
#include <stdio.h>
100103
#include <errno.h>
101104
#include <string.h>

externals/cgns/adf/ADF_internals.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ bytes start end description range / format
166166
/***********************************************************************
167167
Includes
168168
***********************************************************************/
169+
#ifndef _WIN32
170+
#define _POSIX_C_SOURCE 200112L
171+
#endif
169172
#include <sys/types.h>
170173
#include <time.h>
171174
#include <stdio.h>

externals/cgns/adf/ADF_internals.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ extern void ADFI_increment_array(
525525
cgulong_t *element_offset,
526526
int *error_return ) ;
527527

528-
extern void ADFI_is_block_in_core() ;
528+
extern void ADFI_is_block_in_core(void) ;
529529

530530
extern void ADFI_little_endian_to_cray(
531531
const char from_format,
@@ -591,7 +591,7 @@ extern void ADFI_read_data_translated(
591591
char *data,
592592
int *error_return ) ;
593593

594-
extern void ADFI_read_disk_block() ;
594+
extern void ADFI_read_disk_block(void) ;
595595

596596
extern void ADFI_read_disk_pointer_from_disk(
597597
const unsigned int file_index,
@@ -707,7 +707,7 @@ extern void ADFI_write_data_translated(
707707
const char *data,
708708
int *error_return ) ;
709709

710-
extern void ADFI_write_disk_block() ;
710+
extern void ADFI_write_disk_block(void) ;
711711

712712
extern void ADFI_write_disk_pointer_2_disk(
713713
const unsigned int file_index,

externals/cgns/adfh/ADFH.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
2121
/*-------------------------------------------------------------------
2222
* HDF5 interface to ADF
2323
*-------------------------------------------------------------------*/
24-
24+
#ifndef _WIN32
25+
#define _POSIX_C_SOURCE 200112L
26+
#endif
2527
#include <stdio.h>
2628
#include <string.h>
2729
#include <math.h>
@@ -2180,33 +2182,13 @@ void ADFH_Database_Open(const char *name,
21802182
for (i = 0; buff[i]; i++)
21812183
buff[i] = TO_UPPER(buff[i]);
21822184

2183-
if (0 == strcmp(buff, "UNKNOWN")) {
2184-
if (ACCESS(name, 0))
2185-
mode = ADFH_MODE_NEW;
2186-
else if (ACCESS(name, 2))
2187-
mode = ADFH_MODE_RDO;
2188-
else
2189-
mode = ADFH_MODE_OLD;
2190-
}
2191-
else if (0 == strcmp(buff, "NEW")) {
2192-
if (!ACCESS(name, 0)) {
2193-
set_error(REQUESTED_NEW_FILE_EXISTS, err);
2194-
return;
2195-
}
2185+
if (0 == strcmp(buff, "NEW")) {
21962186
mode = ADFH_MODE_NEW;
21972187
}
21982188
else if (0 == strcmp(buff, "READ_ONLY")) {
2199-
if (ACCESS(name, 0)) {
2200-
set_error(REQUESTED_OLD_FILE_NOT_FOUND, err);
2201-
return;
2202-
}
22032189
mode = ADFH_MODE_RDO;
22042190
}
22052191
else if (0 == strcmp(buff, "OLD")) {
2206-
if (ACCESS(name, 0)) {
2207-
set_error(REQUESTED_OLD_FILE_NOT_FOUND, err);
2208-
return;
2209-
}
22102192
mode = ADFH_MODE_OLD;
22112193
}
22122194
else {

externals/cgns/cg_hash_types.h.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@
77

88
#define SIZEOF_LONG @SIZEOF_LONG@
99
#define SIZEOF_VOID_P @SIZEOF_VOID_P@
10+
#if @BUILD64BIT@
1011
typedef int64_t map_ssize_t;
1112
typedef uint64_t map_usize_t;
1213
#define SIZEOF_MAP_USIZE_T 8
14+
#else
15+
typedef int32_t map_ssize_t;
16+
typedef uint32_t map_usize_t;
17+
#define SIZEOF_MAP_USIZE_T 4
18+
#endif
1319
typedef char char_name[33];
1420

15-
#endif
21+
#endif

externals/cgns/cgns_error.c

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ freely, subject to the following restrictions:
1717
1818
3. This notice may not be removed or altered from any source distribution.
1919
-------------------------------------------------------------------------*/
20+
/**
21+
* \defgroup ErrorHandling Error Handling
22+
**/
2023

2124
#include <stdlib.h>
2225
#include <stdarg.h>
@@ -54,11 +57,35 @@ CGNSDLL void cgi_warning(const char *format, ...) {
5457
va_end(arg);
5558
}
5659

57-
CGNSDLL const char *cg_get_error() {
60+
/**
61+
* \ingroup ErrorHandling
62+
*
63+
* \brief If an error occurs during the execution of a CGNS library function,
64+
* signified by a non-zero value of the error status variable \p ier, an error
65+
* message may be retrieved using the function cg_get_error().
66+
*
67+
* \return The error message
68+
*/
69+
70+
const char *cg_get_error() {
5871
return cgns_error_mess;
5972
}
6073

61-
CGNSDLL void cg_error_exit() {
74+
/**
75+
* \ingroup ErrorHandling
76+
*
77+
* \brief Print the error message and stop the execution of the program
78+
*
79+
* \note In C, you may define a function to be called automatically in the case of a
80+
* warning or error using the cg_configure() routine. The function is of the form
81+
* \code void err_func(int is_error, char *errmsg) \endcode and will be called whenever an error
82+
* or warning occurs. The first argument, \p is_error, will be 0 for warning messages,
83+
* 1 for error messages, and -1 if the program is going to terminate
84+
* (i.e., a call to cg_error_exit()). The second argument is the error or warning message.
85+
*
86+
*/
87+
88+
void cg_error_exit() {
6289
if (cgns_error_handler)
6390
(*cgns_error_handler)(-1, cgns_error_mess);
6491
else
@@ -67,7 +94,21 @@ CGNSDLL void cg_error_exit() {
6794
exit(1);
6895
}
6996

70-
CGNSDLL void cg_error_print() {
97+
/**
98+
* \ingroup ErrorHandling
99+
*
100+
* \brief Print the error message and continue execution of the program
101+
*
102+
* \note In C, you may define a function to be called automatically in the case of a
103+
* warning or error using the cg_configure() routine. The function is of the form
104+
* \code void err_func(int is_error, char *errmsg) \endcode and will be called whenever an error
105+
* or warning occurs. The first argument, \p is_error, will be 0 for warning messages,
106+
* 1 for error messages, and -1 if the program is going to terminate
107+
* (i.e., a call to cg_error_exit()). The second argument is the error or warning message.
108+
*
109+
*/
110+
111+
void cg_error_print() {
71112
fprintf(stderr,"%s\n",cgns_error_mess);
72113
}
73114

0 commit comments

Comments
 (0)