Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d88471f

Browse files
committed
Change signatures for arguments to "s" and friends to be the proper ``const
char *`` instead of just ``char *``. Also added the mentioning of "const" in some places where it was left out even when the signature already stated the fact. Closes bug #980925.
1 parent 83a6430 commit d88471f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Doc/api/utilities.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ \section{Parsing arguments and building values
384384
whose address should be passed.
385385

386386
\begin{description}
387-
\item[\samp{s} (string or Unicode object) {[char *]}]
387+
\item[\samp{s} (string or Unicode object) {[const char *]}]
388388
Convert a Python string or Unicode object to a C pointer to a
389389
character string. You must not provide storage for the string
390390
itself; a pointer to an existing string is stored into the character
@@ -396,7 +396,7 @@ \section{Parsing arguments and building values
396396
raised.
397397

398398
\item[\samp{s\#} (string, Unicode or any read buffer compatible object)
399-
{[char *, int]}]
399+
{[const char *, int]}]
400400
This variant on \samp{s} stores into two C variables, the first one
401401
a pointer to a character string, the second one its length. In this
402402
case the Python string may contain embedded null bytes. Unicode
@@ -405,12 +405,12 @@ \section{Parsing arguments and building values
405405
compatible objects pass back a reference to the raw internal data
406406
representation.
407407

408-
\item[\samp{z} (string or \code{None}) {[char *]}]
408+
\item[\samp{z} (string or \code{None}) {[const char *]}]
409409
Like \samp{s}, but the Python object may also be \code{None}, in
410410
which case the C pointer is set to \NULL.
411411

412412
\item[\samp{z\#} (string or \code{None} or any read buffer
413-
compatible object) {[char *, int]}]
413+
compatible object) {[const char *, int]}]
414414
This is to \samp{s\#} as \samp{z} is to \samp{s}.
415415

416416
\item[\samp{u} (Unicode object) {[Py_UNICODE *]}]
@@ -433,7 +433,7 @@ \section{Parsing arguments and building values
433433
encoded data without embedded NUL bytes.
434434

435435
This format requires two arguments. The first is only used as
436-
input, and must be a \ctype{char*} which points to the name of an
436+
input, and must be a \ctype{const char*} which points to the name of an
437437
encoding as a NUL-terminated string, or \NULL, in which case the
438438
default encoding is used. An exception is raised if the named
439439
encoding is not known to Python. The second argument must be a
@@ -461,7 +461,7 @@ \section{Parsing arguments and building values
461461
characters.
462462

463463
It requires three arguments. The first is only used as input, and
464-
must be a \ctype{char*} which points to the name of an encoding as a
464+
must be a \ctype{const char*} which points to the name of an encoding as a
465465
NUL-terminated string, or \NULL, in which case the default encoding
466466
is used. An exception is raised if the named encoding is not known
467467
to Python. The second argument must be a \ctype{char**}; the value

0 commit comments

Comments
 (0)