Skip to content

fixed compile error for gcc 11.4 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev-skjmodel
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/seapodym_coupled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -643,22 +643,22 @@ 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;
}

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;
}

8 changes: 4 additions & 4 deletions src/seapodym_density.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -221,22 +221,22 @@ 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;
}

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;
}

8 changes: 4 additions & 4 deletions src/seapodym_habitat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -233,22 +233,22 @@ 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;
}

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;
}

Expand Down