mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: perform explicit conversion in _GoStringLen
_GoStringLen performs an implicit conversion from intgo to size_t.
Explicitly cast to size_t.
This change avoids warnings when using cgo with CFLAGS:
-Wconversion.
Change-Id: I58f75a35e17f669a67f9805061c041b03eddbb5c
GitHub-Last-Rev: b5df1ac0c3
GitHub-Pull-Request: golang/go#27092
Reviewed-on: https://go-review.googlesource.com/129820
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
2ce8411239
commit
d2ace0ce5f
1 changed files with 1 additions and 1 deletions
|
|
@ -1432,7 +1432,7 @@ void *CBytes(_GoBytes_);
|
|||
void *_CMalloc(size_t);
|
||||
|
||||
__attribute__ ((unused))
|
||||
static size_t _GoStringLen(_GoString_ s) { return s.n; }
|
||||
static size_t _GoStringLen(_GoString_ s) { return (size_t)s.n; }
|
||||
|
||||
__attribute__ ((unused))
|
||||
static const char *_GoStringPtr(_GoString_ s) { return s.p; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue