annotate test/simp.c @ 444:8bec605d1701

small sized struct
author kono
date Sun, 21 Nov 2004 11:20:56 +0900
parents 86b04fb4562e
children cc1a5f764782
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
1 #include "stdio.h"
d35df41eac69 Initial revision
kono
parents:
diff changeset
2
d35df41eac69 Initial revision
kono
parents:
diff changeset
3 alpha(c)
d35df41eac69 Initial revision
kono
parents:
diff changeset
4 char c;
d35df41eac69 Initial revision
kono
parents:
diff changeset
5 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
6 return(('a'<=c&&c<='z')||('A'<=c&&c<='Z')||c=='_');
d35df41eac69 Initial revision
kono
parents:
diff changeset
7 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
8 char ch;
d35df41eac69 Initial revision
kono
parents:
diff changeset
9
d35df41eac69 Initial revision
kono
parents:
diff changeset
10 main(int ac,char *av[])
d35df41eac69 Initial revision
kono
parents:
diff changeset
11 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
12 int i;
172
096559f07a70 some check
kono
parents: 0
diff changeset
13
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 172
diff changeset
14 printf("#0013:%d\n",ac);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
15 for(i=0;i<ac;i++) {
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 172
diff changeset
16 printf("#0015:%s\n",&av[i][3]);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
17 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
18 ch = 'E';
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
19 main1(-8);
172
096559f07a70 some check
kono
parents: 0
diff changeset
20 return main0(ac,ch,av);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
21 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
22
d35df41eac69 Initial revision
kono
parents:
diff changeset
23 main0(ac,ch,av)
d35df41eac69 Initial revision
kono
parents:
diff changeset
24 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
25 char ch;
d35df41eac69 Initial revision
kono
parents:
diff changeset
26 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
27 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
28 int i;
444
8bec605d1701 small sized struct
kono
parents: 442
diff changeset
29 printf("#0028:%d %c\n",ac,ch);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
30 for(i=0;i<ac;i++) {
444
8bec605d1701 small sized struct
kono
parents: 442
diff changeset
31 printf("#0030:%s\n",&av[i][3]);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
32 }
444
8bec605d1701 small sized struct
kono
parents: 442
diff changeset
33 printf("#0032:%d==1\n",alpha(ch));
172
096559f07a70 some check
kono
parents: 0
diff changeset
34 return 0;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
35 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
36
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
37 main1(int l)
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
38 {
444
8bec605d1701 small sized struct
kono
parents: 442
diff changeset
39 printf("#0038:%d\n", ((l+0)<-511||(l+0)>511));
8bec605d1701 small sized struct
kono
parents: 442
diff changeset
40 if ((l+0)<-511||(l+0)>511) printf("#0039:yes\n");
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
41 l = -1;
444
8bec605d1701 small sized struct
kono
parents: 442
diff changeset
42 printf("#0041:%d\n", l==-1? 555:333);
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
43 }
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
44
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
45