1/* 2 * Copyright 2014, NICTA 3 * 4 * This software may be distributed and modified according to the terms of 5 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 6 * See "LICENSE_BSD2.txt" for details. 7 * 8 * @TAG(NICTA_BSD) 9 */ 10 11int *pdiff1 (int *ptr, int off) 12{ 13 return ptr - off; 14} 15 16int pdiff2 (int *p1, int *p2) 17{ 18 return p1 - p2; 19} 20 21struct testing_struct 22{ 23 int val1; 24 int val2; 25}; 26 27int pdiff3 (struct testing_struct *p1) 28{ 29 return ((int)(p1 + 1)) - ((int)(p1)); 30} 31