Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/tests/cdt/dttest.h
1810 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1999-2011 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#include "cdt.h"
21
#include "terror.h"
22
23
#if __STD_C
24
static int compare(Dt_t* dt, Void_t* o1, Void_t* o2, Dtdisc_t* disc)
25
#else
26
static int compare(dt,o1,o2,disc)
27
Dt_t* dt;
28
Void_t* o1;
29
Void_t* o2;
30
Dtdisc_t* disc;
31
#endif
32
{
33
return (int)((char*)o1 - (char*)o2);
34
}
35
36
#if __STD_C
37
static int rcompare(Dt_t* dt, Void_t* o1, Void_t* o2, Dtdisc_t* disc)
38
#else
39
static int rcompare(dt,o1,o2,disc)
40
Dt_t* dt;
41
Void_t* o1;
42
Void_t* o2;
43
Dtdisc_t* disc;
44
#endif
45
{
46
return (int)((char*)o2 - (char*)o1);
47
}
48
49
#if __STD_C
50
static Void_t* newint(Dt_t* dt, Void_t* o, Dtdisc_t* disc)
51
#else
52
static Void_t* newint(dt,o,disc)
53
Dt_t* dt;
54
Void_t* o;
55
Dtdisc_t* disc;
56
#endif
57
{
58
return o;
59
}
60
61
#if __STD_C
62
static unsigned int hashint(Dt_t* dt, Void_t* o, Dtdisc_t* disc)
63
#else
64
static unsigned int hashint(dt,o,disc)
65
Dt_t* dt;
66
Void_t* o;
67
Dtdisc_t* disc;
68
#endif
69
{
70
return (unsigned int)((char*)o - (char*)0);
71
}
72
73