summaryrefslogtreecommitdiffstats
path: root/private/crt32/string/mips/wcscmpt.c
blob: 629f61ca5c64260c5fdc5697c7374a1f906a1e0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
char buffer[100];
#include <stdio.h>
#include <memory.h>

#define NTUL 7

void main()
{
	int i, k;
	int rc;

        unsigned long source1[4] = {
		0x30003000,
		0x30003000,
		0x30003000,
		0x36003000
		};

        unsigned long source2[4] = {
		0x30003000,
		0x30003000,
		0x30003000,
		0x00000000
		};

	unsigned long tul[NTUL] = {
		0x35004600,
		0x37004600,
		0x36002f00,
		0x37002f00,
		0x30004600,
		0x30003000,
		0x36003000
		};


	for (k = 0; k < NTUL; k++) {
		unsigned short *s1 = (unsigned short *)source1;
		unsigned short *s2 = (unsigned short *)source2;

		source2[3] = tul[k];

		printf("source1 = ");
		for (i = 0; i < 4*sizeof(unsigned long); i++)
		        printf("%2.2x ", ((char *)source1)[i]);
		printf("\n");

		printf("source2 = ");
		for (i = 0; i < 4*sizeof(unsigned long); i++)
		        printf("%2.2x ", ((char *)source2)[i]);

		rc = wcscmp(source1,source2);
		if (rc < 0) {
			printf("   source1 < source2\n");
		} else if (rc > 0) {
			printf("   source1 > source2\n");
		} else {
			printf("   source1 == source2\n");
		}
		printf("Return Code = %d\n",rc);
	}
}