Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/Example.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ExampleClass
ExampleClass() {}
virtual ~ExampleClass() {}

void printBuffer(unsigned char* buffer, unsigned int length)
void printBuffer(char* buffer, unsigned int length)
{
for (unsigned int i = 0; i < length; ++i)
{
Expand Down
3 changes: 1 addition & 2 deletions scripts/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import example_py
import struct
import ctypes

buf = struct.pack('BBBB', 0x41, 0x42, 0x43, 0x44)

print 'python:', buf

e = example_py.ExampleClass()

print 'c++:', e.printBuffer(ctypes.cast(ctypes.c_char_p(buf), ctypes.POINTER(ctypes.c_ubyte)), ctypes.c_uint(4))
print 'c++:', e.printBuffer(buf, 4)
2 changes: 1 addition & 1 deletion src/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

int main(int argc, char** argv)
{
unsigned char buf[4];
char buf[4];
buf[0] = 0x41;
buf[1] = 0x42;
buf[2] = 0x43;
Expand Down