Last active
September 17, 2015 13:57
-
-
Save zzeroo/8ff864cbeb45912e6854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CDPATH="${ZSH_VERSION+.}:" && cd . && /usr/bin/valac --vapidir ../ --pkg libmodbus --pkg posix -g -C unit-test-server.vala | |
unit-test-server.vala:224.37-224.41: error: Incompatible operand | |
Posix.send(w_s, (void*)(req+i), 1, MSG_NOSIGNAL); | |
^^^^^ | |
CDPATH="${ZSH_VERSION+.}:" && cd . && /usr/bin/valac --vapidir ../ --pkg libmodbus --pkg posix -g -C unit-test-server.vala | |
unit-test-server.vala:224.29-224.42: error: Pointer arithmetic not supported for `void*' | |
Posix.send(w_s, (void*)(req)+i, 1, MSG_NOSIGNAL); | |
^^^^^^^^^^^^^^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The correct cast looks like
We have to cast req first since Posix.send () want's a (void*) Pointer and then we have to increment the casted Pointer by one (one Byte in this case) to get the next Byte.
This was the file I want to port to vala:
https://github.com/stephane/libmodbus/blob/v3.1.2/tests/unit-test-server.c#L190
And this is the working vala file:
https://github.com/zzeroo/modbus-vapi/blob/388c6de/tests/unit-test-server.vala#L212