minmax.h

Mon, 16 Feb 2004 18:50:28 +0100

author
tuomov
date
Mon, 16 Feb 2004 18:50:28 +0100
changeset 62
aae5facf9fc5
parent 60
a4033700e35c
permissions
-rw-r--r--

trunk: changeset 1318
Switched to using spaces only for indentation. Simple automatic "\t"
-> " " conversion; may need tuning later.

60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
1 /*
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
2 * libtu/minmax.h
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
3 *
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2004.
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
5 *
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
6 * You may distribute and modify this library under the terms of either
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
8 */
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
9
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
10 #ifndef LIBTU_MINMAX_H
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
11 #define LIBTU_MINMAX_H
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
12
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
13
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
14 static int minof(int x, int y)
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
15 {
62
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 60
diff changeset
16 return (x<y ? x : y);
60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
17 }
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
18
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
19
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
20 static int maxof(int x, int y)
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
21 {
62
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 60
diff changeset
22 return (x>y ? x : y);
60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
23 }
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
24
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
25
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
26 #endif /* LIBTU_MINMAX_H */
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
27

mercurial