Mercurial > hg > CbC > old > device
view test/short.c @ 482:8370ba6e8557
*** empty log message ***
author | kono |
---|---|
date | Sun, 11 Dec 2005 23:23:18 +0900 |
parents | 32737bad7489 |
children | a379da780856 |
line wrap: on
line source
int printf(const char *format, ...); short gj; short gi; short a[100]; unsigned short b[100]; unsigned char c[100]; short data[] = {10,20,-40,-50}; unsigned short udata[] = {10,20,-40,-50}; short f(short i,unsigned short j,unsigned short k,short m,short a); unsigned short g(short i,unsigned short j,unsigned short k,short m,short a); main() { int ii; short i,k,*p; unsigned short j,m,*up; unsigned char g0,h0; char g1,h1; unsigned short sg0,sh0; short sg1,sh1; unsigned char *pg0,*ph0; char *pg1,*ph1; unsigned short *psg0,*psh0; short *psg1,*psh1; i = -3; j = 3; k = 44; k = i*j+3+k; m = i*j-7+k; printf("#0035:%d %d %d\n",i,k,m); g0 = 123; g0++; --g0; ++g0; g0--; printf("#0040:g0=%d\n",g0); g1 = -123; g1++; --g1; ++g1; g1--; printf("#0044:g1=%d\n",g1); sg0 = 123; sg0++; --sg0; ++sg0; sg0--; printf("#0049:sg0=%d\n",sg0); sg1 = -123; sg1++; --sg1; ++sg1; sg1--; printf("#0053:sg1=%d\n",sg1); pg0 = &g0; ph0 = &h0; *pg0 = 123; //*pg0++; *--pg0; //*++pg0; *g0--; printf("#0060:g0=%d\n",*pg0); pg1 = &g1; ph1 = &h1; *pg1 = -123; //*pg1++; --*pg1; //++*pg1; *pg1--; printf("#0066:g1=%d\n",*pg1); psg0 = &sg0; psh0 = &sh0; *psg0 = 123; //*sg0++; *--sg0; //*++sg0; *sg0--; printf("#0073:sg0=%d\n",*psg0); psg1 = &sg1; psh1 = &sh1; *psg1 = -123; //*sg1++; *--sg1; //*++sg1; *sg1--; printf("#0079:sg1=%d\n",*psg1); h0 = g0 - 20; c[33] = g0; if (i==j) { printf("#0085:i==j\n"); } else { printf("i!=j\n"); } a[33] = i; b[33] = 105; printf("#0089:i=%d\n",i); printf("#0090:j=%d\n",j); i++; --i; j++; --j; printf("#0093:i=%d\n",i); printf("#0094:j=%d\n",j); gi = 3333; gj = 6666; gi++; --gi; gj++; --gj; printf("#0099:gi=%d\n",gi); printf("#0100:gj=%d\n",gj); printf("#0102:k=%d\n",k); printf("#0103:m=%d\n",m); printf("#0104:a[33]=%d\n",a[33]); printf("#0105:b[33]=%d\n",b[33]); printf("#0106:a[33]=%d\n",++a[33]); printf("#0107:b[33]=%d\n",b[33]--); printf("#0109:g0=%d\n",g0); printf("#0110:h0=%d\n",h0); printf("#0111:c[33]=%d\n",c[33]); p = data; printf("#0114:*p++ = %d\n",*p++); printf("#0115:*++p = %d\n",*++p); *p++ = -343; printf("#0117:*p-- = %d\n",*p--); printf("#0118:*--p = %d\n",*--p); up = udata; printf("#0120:*up-- = %d\n",*up--); printf("#0121:*--up = %d\n",*--up); *up++ = 65530; printf("#0123:*up-- = %d\n",*up--); printf("#0124:*--up = %d\n",*--up); ii = f(i,j,k,m,a[33]); printf("#0128:f()=%d\n",ii); ii = g(i,j,k,m,a[33]); printf("#0130:f()=%d\n",ii); return 0; } short f(short i,unsigned short j,unsigned short k,short m,short a) { return i+j*k-m/a; } unsigned short g(short i,unsigned short j,unsigned short k,short m,short a) { return i+j*k-m/a; }