Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Configure (cpp)
if: ${{ matrix.language == 'cpp' }}
run: ./meson.py build --optimization=1
run: ./meson.py setup build --optimization=1

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Short summary of the minimal requirements:
If you have these tools installed, you can create a configuration using the `meson.py` found in the root source code folder:

```
./meson.py build
./meson.py setup build
```

Use `ninja` to compile and install the code
Expand Down
4 changes: 2 additions & 2 deletions externals/cgns/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**********************************************************************
https://github.com/CGNS/CGNS/releases,
the source files for CGNS v4.2.0 are bundled and build directly into SU2
https://github.com/CGNS/CGNS/releases,
the source files for CGNS v4.5.0 are bundled and built directly into SU2

From the CGNS webpage:

Expand Down
3 changes: 3 additions & 0 deletions externals/cgns/adf/ADF_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ static char ADF_A_identification[] = "\300\250\243\251ADF Database Version A0201
/***********************************************************************
Includes
***********************************************************************/
#ifndef _WIN32
#define _POSIX_C_SOURCE 200112L
#endif
#include <stdio.h>
#include <errno.h>
#include <string.h>
Expand Down
3 changes: 3 additions & 0 deletions externals/cgns/adf/ADF_internals.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ bytes start end description range / format
/***********************************************************************
Includes
***********************************************************************/
#ifndef _WIN32
#define _POSIX_C_SOURCE 200112L
#endif
#include <sys/types.h>
#include <time.h>
#include <stdio.h>
Expand Down
6 changes: 3 additions & 3 deletions externals/cgns/adf/ADF_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ extern void ADFI_increment_array(
cgulong_t *element_offset,
int *error_return ) ;

extern void ADFI_is_block_in_core() ;
extern void ADFI_is_block_in_core(void) ;

extern void ADFI_little_endian_to_cray(
const char from_format,
Expand Down Expand Up @@ -591,7 +591,7 @@ extern void ADFI_read_data_translated(
char *data,
int *error_return ) ;

extern void ADFI_read_disk_block() ;
extern void ADFI_read_disk_block(void) ;

extern void ADFI_read_disk_pointer_from_disk(
const unsigned int file_index,
Expand Down Expand Up @@ -707,7 +707,7 @@ extern void ADFI_write_data_translated(
const char *data,
int *error_return ) ;

extern void ADFI_write_disk_block() ;
extern void ADFI_write_disk_block(void) ;

extern void ADFI_write_disk_pointer_2_disk(
const unsigned int file_index,
Expand Down
26 changes: 4 additions & 22 deletions externals/cgns/adfh/ADFH.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ freely, subject to the following restrictions:
/*-------------------------------------------------------------------
* HDF5 interface to ADF
*-------------------------------------------------------------------*/

#ifndef _WIN32
#define _POSIX_C_SOURCE 200112L
#endif
#include <stdio.h>
#include <string.h>
#include <math.h>
Expand Down Expand Up @@ -2180,33 +2182,13 @@ void ADFH_Database_Open(const char *name,
for (i = 0; buff[i]; i++)
buff[i] = TO_UPPER(buff[i]);

if (0 == strcmp(buff, "UNKNOWN")) {
if (ACCESS(name, 0))
mode = ADFH_MODE_NEW;
else if (ACCESS(name, 2))
mode = ADFH_MODE_RDO;
else
mode = ADFH_MODE_OLD;
}
else if (0 == strcmp(buff, "NEW")) {
if (!ACCESS(name, 0)) {
set_error(REQUESTED_NEW_FILE_EXISTS, err);
return;
}
if (0 == strcmp(buff, "NEW")) {
mode = ADFH_MODE_NEW;
}
else if (0 == strcmp(buff, "READ_ONLY")) {
if (ACCESS(name, 0)) {
set_error(REQUESTED_OLD_FILE_NOT_FOUND, err);
return;
}
mode = ADFH_MODE_RDO;
}
else if (0 == strcmp(buff, "OLD")) {
if (ACCESS(name, 0)) {
set_error(REQUESTED_OLD_FILE_NOT_FOUND, err);
return;
}
mode = ADFH_MODE_OLD;
}
else {
Expand Down
8 changes: 7 additions & 1 deletion externals/cgns/cg_hash_types.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@

#define SIZEOF_LONG @SIZEOF_LONG@
#define SIZEOF_VOID_P @SIZEOF_VOID_P@
#if @BUILD64BIT@
typedef int64_t map_ssize_t;
typedef uint64_t map_usize_t;
#define SIZEOF_MAP_USIZE_T 8
#else
typedef int32_t map_ssize_t;
typedef uint32_t map_usize_t;
#define SIZEOF_MAP_USIZE_T 4
#endif
typedef char char_name[33];

#endif
#endif
47 changes: 44 additions & 3 deletions externals/cgns/cgns_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ freely, subject to the following restrictions:

3. This notice may not be removed or altered from any source distribution.
-------------------------------------------------------------------------*/
/**
* \defgroup ErrorHandling Error Handling
**/

#include <stdlib.h>
#include <stdarg.h>
Expand Down Expand Up @@ -54,11 +57,35 @@ CGNSDLL void cgi_warning(const char *format, ...) {
va_end(arg);
}

CGNSDLL const char *cg_get_error() {
/**
* \ingroup ErrorHandling
*
* \brief If an error occurs during the execution of a CGNS library function,
* signified by a non-zero value of the error status variable \p ier, an error
* message may be retrieved using the function cg_get_error().
*
* \return The error message
*/

const char *cg_get_error() {
return cgns_error_mess;
}

CGNSDLL void cg_error_exit() {
/**
* \ingroup ErrorHandling
*
* \brief Print the error message and stop the execution of the program
*
* \note In C, you may define a function to be called automatically in the case of a
* warning or error using the cg_configure() routine. The function is of the form
* \code void err_func(int is_error, char *errmsg) \endcode and will be called whenever an error
* or warning occurs. The first argument, \p is_error, will be 0 for warning messages,
* 1 for error messages, and -1 if the program is going to terminate
* (i.e., a call to cg_error_exit()). The second argument is the error or warning message.
*
*/

void cg_error_exit() {
if (cgns_error_handler)
(*cgns_error_handler)(-1, cgns_error_mess);
else
Expand All @@ -67,7 +94,21 @@ CGNSDLL void cg_error_exit() {
exit(1);
}

CGNSDLL void cg_error_print() {
/**
* \ingroup ErrorHandling
*
* \brief Print the error message and continue execution of the program
*
* \note In C, you may define a function to be called automatically in the case of a
* warning or error using the cg_configure() routine. The function is of the form
* \code void err_func(int is_error, char *errmsg) \endcode and will be called whenever an error
* or warning occurs. The first argument, \p is_error, will be 0 for warning messages,
* 1 for error messages, and -1 if the program is going to terminate
* (i.e., a call to cg_error_exit()). The second argument is the error or warning message.
*
*/

void cg_error_print() {
fprintf(stderr,"%s\n",cgns_error_mess);
}

Expand Down
Loading