Skip to content

Commit 66eacb4

Browse files
fingolfinChrisJefferson
authored andcommitted
Prefer (CONST_)CSTR_STRING over CHARS_STRING
... at least where it avoids casts
1 parent 4e90833 commit 66eacb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gap_cpp_headers/gap_cpp_mapping.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct GAP_getter<char*>
4747
{
4848
if(!isa(recval))
4949
throw GAPException("Invalid attempt to read string");
50-
return (char*)CHARS_STRING(recval);
50+
return CSTR_STRING(recval);
5151
}
5252
};
5353

@@ -61,7 +61,7 @@ struct GAP_getter<std::string>
6161
{
6262
if(!isa(recval))
6363
throw GAPException("Invalid attempt to read string");
64-
return std::string((char*)CHARS_STRING(recval));
64+
return std::string(CONST_CSTR_STRING(recval));
6565
}
6666
};
6767

0 commit comments

Comments
 (0)