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:
430 bytes
|
| Rev | Line | |
|---|
| [36b5ada] | 1 | /* Commandline execution:
|
|---|
| 2 | * civl verify bundleStructComponent.cvl
|
|---|
| 3 | * */
|
|---|
| [e6b02c8] | 4 | #include <civlc.cvh>
|
|---|
| 5 | #include<bundle.cvh>
|
|---|
| [b95df30] | 6 |
|
|---|
| 7 | typedef struct foo {
|
|---|
| 8 | int a[5];
|
|---|
| 9 | int b;
|
|---|
| 10 | } foo;
|
|---|
| 11 |
|
|---|
| 12 | void main() {
|
|---|
| 13 | int c[6];
|
|---|
| 14 | foo s;
|
|---|
| 15 | $bundle bun;
|
|---|
| 16 |
|
|---|
| 17 | for (int i = 0; i < 5; i++) {
|
|---|
| 18 | s.a[i] = i*i;
|
|---|
| 19 | }
|
|---|
| 20 | s.b = 25;
|
|---|
| 21 | bun = $bundle_pack(&(s.a), 6*sizeof(int)); // There may be padding, so this should fail.
|
|---|
| 22 | $bundle_unpack(bun, &c);
|
|---|
| [d980649] | 23 | $assert(c[5] == 25);
|
|---|
| [b95df30] | 24 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.