diff options
Diffstat (limited to 'swig')
| -rw-r--r-- | swig/plist.i | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/swig/plist.i b/swig/plist.i index 172a330..7755cc5 100644 --- a/swig/plist.i +++ b/swig/plist.i | |||
| @@ -11,15 +11,15 @@ | |||
| 11 | %include "stdint.i" | 11 | %include "stdint.i" |
| 12 | 12 | ||
| 13 | %typemap(out) std::vector<char> { | 13 | %typemap(out) std::vector<char> { |
| 14 | $result = SWIG_FromCharPtrAndSize((const char*)&($1[0]),(int)($1.size())); | 14 | $result = SWIG_FromCharPtrAndSize((const char*)&($1[0]),(size_t)($1.size())); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | %typemap(in) (const std::vector<char>& v) | 17 | %typemap(in) (const std::vector<char>&) |
| 18 | { | 18 | { |
| 19 | char* buffer = NULL; | 19 | char* buffer = NULL; |
| 20 | int length = 0; | 20 | size_t length = 0; |
| 21 | SWIG_AsCharPtrAndSize($input, &buffer, &length, NULL); | 21 | SWIG_AsCharPtrAndSize($input, &buffer, &length, NULL); |
| 22 | $1 = std::vector<char>(buffer, buffer + length); | 22 | $1 = new std::vector<char>(buffer, buffer + length - 1); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | #if SWIGPYTHON | 25 | #if SWIGPYTHON |
