From 08352b072342a42b7dcf84a1d12c8b183f1cfbd4 Mon Sep 17 00:00:00 2001 From: Alexander Pletzer Date: Mon, 12 May 2025 09:12:05 +1200 Subject: [PATCH 1/2] fixed compile error for gcc 11.4 --- src/seapodym_coupled.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/seapodym_coupled.cpp b/src/seapodym_coupled.cpp index e1badcc..149fe67 100755 --- a/src/seapodym_coupled.cpp +++ b/src/seapodym_coupled.cpp @@ -618,7 +618,7 @@ void verify_identifier_string2(char* str1) //ASSUME str1 is not null long int num_bytes=strlen(str1); char* str = new char[num_bytes+1]; str[num_bytes]='\0'; - gradient_structure::get_fp()->fread(str,num_bytes); + gradient_structure().get_fp()->fread(str,num_bytes); if(strcmp(str1,str)) { cerr << "Error[" << __FILE__ << ':' << __LINE__ << "]: \"" << str << "\" != \"" << str1 << "\"\n"; @@ -643,7 +643,7 @@ string get_path(const char* parfile) int save_identifier_string2(char* str) { int length=strlen(str); - gradient_structure::get_fp()->fwrite(str,length); + gradient_structure().get_fp()->fwrite(str,length); return 0; } @@ -651,14 +651,14 @@ void save_long_int_value(unsigned long int x) { int num_bytes = sizeof(unsigned long int); void* y = (void*)&x; - gradient_structure::get_fp()->fwrite(y,num_bytes); + gradient_structure().get_fp()->fwrite(y,num_bytes); } unsigned long int restore_long_int_value(void) { void* tmpout; int num_bytes = sizeof(unsigned long int); - gradient_structure::get_fp()->fread(&tmpout,num_bytes); + gradient_structure().get_fp()->fread(&tmpout,num_bytes); return (unsigned long int)tmpout; } From 7211ec2ee4ef172bd84025177c471c7ebcb102e0 Mon Sep 17 00:00:00 2001 From: Alexander Pletzer Date: Mon, 12 May 2025 10:15:01 +1200 Subject: [PATCH 2/2] fix for gcc 11.4 --- src/seapodym_density.cpp | 8 ++++---- src/seapodym_habitat.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/seapodym_density.cpp b/src/seapodym_density.cpp index ec21c69..1332e67 100755 --- a/src/seapodym_density.cpp +++ b/src/seapodym_density.cpp @@ -196,7 +196,7 @@ void verify_identifier_string2(char* str1) //ASSUME str1 is not null long int num_bytes=strlen(str1); char* str = new char[num_bytes+1]; str[num_bytes]='\0'; - gradient_structure::get_fp()->fread(str,num_bytes); + gradient_structure().get_fp()->fread(str,num_bytes); if(strcmp(str1,str)) { cerr << "Error[" << __FILE__ << ':' << __LINE__ << "]: \"" << str << "\" != \"" << str1 << "\"\n"; @@ -221,7 +221,7 @@ string get_path(const char* parfile) int save_identifier_string2(char* str) { int length=strlen(str); - gradient_structure::get_fp()->fwrite(str,length); + gradient_structure().get_fp()->fwrite(str,length); return 0; } @@ -229,14 +229,14 @@ void save_long_int_value(unsigned long int x) { int num_bytes = sizeof(unsigned long int); void* y = (void*)&x; - gradient_structure::get_fp()->fwrite(y,num_bytes); + gradient_structure().get_fp()->fwrite(y,num_bytes); } unsigned long int restore_long_int_value(void) { void* tmpout; int num_bytes = sizeof(unsigned long int); - gradient_structure::get_fp()->fread(&tmpout,num_bytes); + gradient_structure().get_fp()->fread(&tmpout,num_bytes); return (unsigned long int)tmpout; } diff --git a/src/seapodym_habitat.cpp b/src/seapodym_habitat.cpp index c7bc597..e60a8f4 100755 --- a/src/seapodym_habitat.cpp +++ b/src/seapodym_habitat.cpp @@ -208,7 +208,7 @@ void verify_identifier_string2(char* str1) //ASSUME str1 is not null long int num_bytes=strlen(str1); char* str = new char[num_bytes+1]; str[num_bytes]='\0'; - gradient_structure::get_fp()->fread(str,num_bytes); + gradient_structure().get_fp()->fread(str,num_bytes); if(strcmp(str1,str)) { cerr << "Error[" << __FILE__ << ':' << __LINE__ << "]: \"" << str << "\" != \"" << str1 << "\"\n"; @@ -233,7 +233,7 @@ string get_path(const char* parfile) int save_identifier_string2(char* str) { int length=strlen(str); - gradient_structure::get_fp()->fwrite(str,length); + gradient_structure().get_fp()->fwrite(str,length); return 0; } @@ -241,14 +241,14 @@ void save_long_int_value(unsigned long int x) { int num_bytes = sizeof(unsigned long int); void* y = (void*)&x; - gradient_structure::get_fp()->fwrite(y,num_bytes); + gradient_structure().get_fp()->fwrite(y,num_bytes); } unsigned long int restore_long_int_value(void) { void* tmpout; int num_bytes = sizeof(unsigned long int); - gradient_structure::get_fp()->fread(&tmpout,num_bytes); + gradient_structure().get_fp()->fread(&tmpout,num_bytes); return (unsigned long int)tmpout; }