Mercurial > hg > CbC > old > device
annotate test/cext.c @ 935:7672a37e7545 default tip
Raspbery PI ARM support begin
author | kono |
---|---|
date | Sat, 24 Dec 2016 03:02:57 +0000 |
parents | d712ee10feb7 |
children |
rev | line source |
---|---|
467 | 1 int printf(const char *format, ...); |
353 | 2 |
3 unsigned int u; | |
831 | 4 static char current_file_dir[1024] ; |
5 | |
6 void | |
7 f(char *name) | |
8 { | |
9 char *s = name; | |
10 char *q = current_file_dir; | |
896
d712ee10feb7
local_nptr for locally defined struct
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
831
diff
changeset
|
11 printf("#0010:%s and %s\n",s,q); |
831 | 12 } |
353 | 13 |
14 main() | |
15 { | |
16 int i,k; unsigned uk; | |
17 | |
808
2a4a40168fa4
char is unsigned on Yellow dog.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
491
diff
changeset
|
18 char c = -3; |
896
d712ee10feb7
local_nptr for locally defined struct
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
831
diff
changeset
|
19 printf("#0018:char is %ssigned\n", c==256-3? "un":""); |
808
2a4a40168fa4
char is unsigned on Yellow dog.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
491
diff
changeset
|
20 |
353 | 21 for(i=-3;i<4;i++) { |
22 k = (char) i; | |
23 uk = (unsigned char) i; | |
896
d712ee10feb7
local_nptr for locally defined struct
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
831
diff
changeset
|
24 printf("#0023:%d %u\n",k,uk); |
353 | 25 k = (short) i; |
26 uk = (unsigned short) i; | |
896
d712ee10feb7
local_nptr for locally defined struct
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
831
diff
changeset
|
27 printf("#0026:%d %u\n",k,uk); |
353 | 28 } |
29 u = (unsigned) -23432; | |
30 | |
896
d712ee10feb7
local_nptr for locally defined struct
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
831
diff
changeset
|
31 printf("#0030:%d\n",u/(8048+5)); |
831 | 32 |
33 current_file_dir[0] = 'k'; | |
34 current_file_dir[1] = 'a'; | |
35 current_file_dir[2] = 't'; | |
36 current_file_dir[3] = 'e'; | |
37 current_file_dir[4] = 0; | |
38 f("john"); | |
353 | 39 return 0; |
40 } | |
41 |