annotate test/multi.c @ 691:25115b50d033

*** empty log message ***
author kono
date Wed, 10 Oct 2007 17:58:15 +0900
parents e9622935a621
children c2c709727221
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
642
e9622935a621 *** empty log message ***
kono
parents: 640
diff changeset
1 #ifndef INLINE
e9622935a621 *** empty log message ***
kono
parents: 640
diff changeset
2 #define INLINE
e9622935a621 *** empty log message ***
kono
parents: 640
diff changeset
3 #endif
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
4
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
5 int printf(const char *,...);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
6
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
7 #define LEN0 10
642
e9622935a621 *** empty log message ***
kono
parents: 640
diff changeset
8 #define LEN1 9
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
9
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
10 typedef int ARRAY[LEN0][LEN1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
11
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
12 int a[LEN0][LEN1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
13
642
e9622935a621 *** empty log message ***
kono
parents: 640
diff changeset
14 INLINE int
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
15 f(ARRAY a)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
16 {
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
17 int i,j;
640
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
18 int b[LEN0][LEN1];
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
19
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
20 j = a[1][1];
640
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
21 j = b[1][1];
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
22
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
23 for(i=0;i<LEN0;i++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
24 for(j=0;j<LEN1;j++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
25 printf("f %d %d = %d\n",i,j,a[i][j]);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
26
640
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
27 for(i=0;i<LEN0;i++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
28 for(j=0;j<LEN1;j++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
29 b[i][j] = i*100 + j;
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
30
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
31 for(i=0;i<LEN0;i++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
32 for(j=0;j<LEN1;j++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
33 printf("fl %d %d = %d\n",i,j,b[i][j]);
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
34 }
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
35
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
36 int
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
37 main()
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
38 {
640
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
39 int b[LEN0][LEN1];
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
40
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
41 int i,j;
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
42 j = a[1][1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
43
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
44 for(i=0;i<LEN0;i++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
45 for(j=0;j<LEN1;j++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
46 a[i][j] = i*100 + j;
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
47
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
48 for(i=0;i<LEN0;i++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
49 for(j=0;j<LEN1;j++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
50 printf("m %d %d = %d\n",i,j,a[i][j]);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
51
640
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
52 for(i=0;i<LEN0;i++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
53 for(j=0;j<LEN1;j++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
54 b[i][j] = i*100 + j;
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
55
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
56 for(i=0;i<LEN0;i++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
57 for(j=0;j<LEN1;j++)
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
58 printf("l %d %d = %d\n",i,j,b[i][j]);
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
59
04211a2cf227 *** empty log message ***
kono
parents: 639
diff changeset
60
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
61 f(a);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
62 }
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
63