aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/UnitTests/2002-05-02-CastTest2.c
blob: 7439662969c677a6a180f885d163b8d0c9545c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>

int
main(int argc, char** argv) {
  short s1 = (argc > 120) ? atoi(argv[1]) : -769; /* 0xf7ff = -769 */

  unsigned short us2 = (unsigned short) s1;     /* 0xf7ff = 64767 */
  printf("us2  = %u\n",   us2);
  return 0;
}