source: CIVL/examples/library/civlc/messageUnpackBad2.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 445 bytes
RevLine 
[4208097]1#include <civlc.cvh>
2#include <comm.cvh>
[1de5580]3
[d66b03b]4$scope root = $here;
[1de5580]5void main(){
6 int x[2] = {1,2}, *y, *z;
7 $message m = $message_pack(0, 1, 2, x, sizeof(int)*2);
8
[d66b03b]9 y = (int *)$malloc(root, sizeof(int)*2);
10 z = (int *)$malloc(root, sizeof(int));
[1de5580]11 $message_unpack(m, y, sizeof(int)*2);
[d980649]12 $assert(x[0] == y[0] && x[1] == y[1]);
[1de5580]13 m = $message_pack(0, 1, 2, x, sizeof(int)*2);
14 $message_unpack(m, z, sizeof(int)); //needs better error report
15}
Note: See TracBrowser for help on using the repository browser.