Skip to content

Commit

Permalink
Replace C_NEW_STRING with MakeStringWithLen, as the former is mentioned
Browse files Browse the repository at this point in the history
in the GAP headers as being deprecated.

The latter is aliased to GAP_MakeStringWithLen in anticipation that this
will hopefully be added to the libgap API; see
gap-system/gap#4211

Refs #2
  • Loading branch information
embray committed Jan 12, 2021
1 parent f284a12 commit 3fc9bd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions gappy/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,10 @@ cdef Obj make_gap_string(s) except NULL:
>>> gap('string') # indirect doctest
"string"
"""
cdef Obj result
try:
GAP_Enter()
b = str_to_bytes(s)
C_NEW_STRING(result, len(b), b)
return result
return GAP_MakeStringWithLen(b, len(b))
finally:
GAP_Leave()

Expand Down
2 changes: 1 addition & 1 deletion gappy/gap_includes.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ cdef extern from "gap/records.h" nogil:


cdef extern from "gap/stringobj.h" nogil:
void C_NEW_STRING(Obj new_gap_string, int length, char* c_string)
Obj GAP_MakeStringWithLen "MakeStringWithLen" (char *, size_t)

0 comments on commit 3fc9bd3

Please sign in to comment.