annotate test/simp.c @ 541:4d853ee76ad6

minor fixes for s-dandy
author kono
date Sun, 01 Jan 2006 12:25:08 +0900 (2006-01-01)
parents 5640fb7a270d
children 492f06738550
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
541
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
3
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
4 float f = 3;
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
5 float g = 4096.0f;
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
6
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
7 int
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
8 main2(int i)
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
9 {
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
10 i+=f;
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
11 return +i;
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
12 }
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
13
492
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
14 int
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
15 alpha(c)
d35df41eac69 Initial revision
kono
parents:
diff changeset
16 char c;
d35df41eac69 Initial revision
kono
parents:
diff changeset
17 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
18 return(('a'<=c&&c<='z')||('A'<=c&&c<='Z')||c=='_');
d35df41eac69 Initial revision
kono
parents:
diff changeset
19 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
20 char ch;
d35df41eac69 Initial revision
kono
parents:
diff changeset
21
492
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
22 void main1();
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
23 int main0() ;
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
24
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
25 int
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
26 main(int ac,char *av[])
d35df41eac69 Initial revision
kono
parents:
diff changeset
27 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
28 int i;
172
096559f07a70 some check
kono
parents: 0
diff changeset
29
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
30 printf("#0018:%d\n",ac);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
31 for(i=0;i<ac;i++) {
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
32 printf("#0020:%s\n",&av[i][3]);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
33 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
34 ch = 'E';
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
35 main1(-8);
541
4d853ee76ad6 minor fixes for s-dandy
kono
parents: 496
diff changeset
36 printf("%d\n",main2(3));
172
096559f07a70 some check
kono
parents: 0
diff changeset
37 return main0(ac,ch,av);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
38 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
39
492
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
40 int
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
41 main0(ac,ch,av)
d35df41eac69 Initial revision
kono
parents:
diff changeset
42 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
43 char ch;
d35df41eac69 Initial revision
kono
parents:
diff changeset
44 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
45 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
46 int i;
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
47 printf("#0034:%d %c\n",ac,ch);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
48 for(i=0;i<ac;i++) {
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
49 printf("#0036:%s\n",&av[i][3]);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
50 }
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
51 printf("#0038:%d==1\n",alpha(ch));
172
096559f07a70 some check
kono
parents: 0
diff changeset
52 return 0;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
53 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
54
492
cc1a5f764782 *** empty log message ***
kono
parents: 444
diff changeset
55 void
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
56 main1(int l)
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
57 {
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
58 printf("#0045:%d\n", ((l+0)<-511||(l+0)>511));
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
59 if ((l+0)<-511||(l+0)>511) printf("#0046:yes\n");
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
60 l = -1;
496
5640fb7a270d more bugs...
kono
parents: 492
diff changeset
61 printf("#0048:%d\n", l==-1? 555:333);
442
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
62 }
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
63
86b04fb4562e minor fix...
kono
parents: 427
diff changeset
64