File: Defs.h

package info (click to toggle)
7zip 24.09%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,436 kB
  • sloc: cpp: 206,595; ansic: 39,085; asm: 4,357; makefile: 2,188; sh: 162
file content (16 lines) | stat: -rwxr-xr-x 505 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Common/Defs.h

#ifndef ZIP7_INC_COMMON_DEFS_H
#define ZIP7_INC_COMMON_DEFS_H

template <class T> inline T MyMin(T a, T b) { return a < b ? a : b; }
template <class T> inline T MyMax(T a, T b) { return a > b ? a : b; }

template <class T> inline int MyCompare(T a, T b)
  { return a == b ? 0 : (a < b ? -1 : 1); }

inline int BoolToInt(bool v) { return (v ? 1 : 0); }
inline unsigned BoolToUInt(bool v) { return (v ? 1u : 0u); }
inline bool IntToBool(int v) { return (v != 0); }

#endif