~ubuntu-branches/debian/sid/frama-c/sid

« back to all changes in this revision

Viewing changes to tests/jessie/reverse_endian.c

  • Committer: Bazaar Package Importer
  • Author(s): Mehdi Dogguy
  • Date: 2009-06-03 08:19:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090603081925-kihvxvt0wy3zc4ar
Tags: upstream-20081201.dfsg
ImportĀ upstreamĀ versionĀ 20081201.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* run.config
 
2
   DONTRUN: cast not supported yet
 
3
*/
 
4
 
 
5
#pragma SeparationPolicy(Regions)
 
6
 
 
7
/*@ requires \valid(s);
 
8
  @ ensures *s == 256 * (\old(*s) % 256) + (\old(*s) / 256);
 
9
  @*/
 
10
void reverse_endian(short *s) {
 
11
  char *c = (char*)s;
 
12
  char tmp = *c;
 
13
  *c = *(c+1);
 
14
  *(c+1) = tmp;
 
15
}
 
16
 
 
17
/*
 
18
Local Variables:
 
19
compile-command: "LC_ALL=C make -j reverse_endian"
 
20
End:
 
21
*/