PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/gc/glu_external_native_array01.c

http://github.com/tybor/Liberty
C | 21 lines | 14 code | 5 blank | 2 comment | 3 complexity | 5f359848d6c4257e59cd1f45d0a4dc52 MD5 | raw file
 1
 2#include <stdlib.h>
 3
 4#define C_ARRAY_OFFSET 100
 5#define C_ARRAY_SIZE  1000
 6
 7
 8char* get_c_array(void){
 9  char* tmp = calloc(C_ARRAY_SIZE, 1);
10  tmp += C_ARRAY_OFFSET;
11  /*printf(" TMP1 %p \n", tmp);*/
12  return tmp;
13}
14
15int untouched_c_array(char* ca){
16  char* tmp = (ca - C_ARRAY_OFFSET);
17  /*printf(" ca %p \n", ca);*/
18  for (; ca >= tmp; ca--)
19    if (*ca != '\0') return 0;
20  return 1;
21}