annotate kdiff3/src/common.h @ 57:023fbd76c1e3

Translating some strings to french
author friseb123
date Sat, 31 Jan 2004 14:25:47 +0000
parents c59d5a3a8ff3
children 8af4bb9d9a5a
rev   line source
joachim99@8 1 /***************************************************************************
joachim99@8 2 common.h - Things that are needed often
joachim99@8 3 -------------------
joachim99@8 4 begin : Mon Mar 18 2002
joachim99@8 5 copyright : (C) 2002 by Joachim Eibl
joachim99@8 6 email : joachim.eibl@gmx.de
joachim99@8 7 ***************************************************************************/
joachim99@8 8
joachim99@8 9 /***************************************************************************
joachim99@8 10 * *
joachim99@8 11 * This program is free software; you can redistribute it and/or modify *
joachim99@8 12 * it under the terms of the GNU General Public License as published by *
joachim99@8 13 * the Free Software Foundation; either version 2 of the License, or *
joachim99@8 14 * (at your option) any later version. *
joachim99@8 15 * *
joachim99@8 16 ***************************************************************************/
joachim99@8 17
joachim99@8 18 #ifndef _COMMON_H
joachim99@8 19 #define _COMMON_H
joachim99@8 20
joachim99@8 21 template< class T >
joachim99@8 22 T min2( T x, T y )
joachim99@8 23 {
joachim99@8 24 return x<y ? x : y;
joachim99@8 25 }
joachim99@8 26 template< class T >
joachim99@8 27 T max2( T x, T y )
joachim99@8 28 {
joachim99@8 29 return x>y ? x : y;
joachim99@8 30 }
joachim99@8 31
joachim99@8 32 typedef unsigned char UINT8;
joachim99@8 33 typedef unsigned short UINT16;
joachim99@8 34 typedef unsigned int UINT32;
joachim99@8 35
joachim99@8 36
joachim99@8 37 template <class T>
joachim99@8 38 T min3( T d1, T d2, T d3 )
joachim99@8 39 {
joachim99@8 40 if ( d1 < d2 && d1 < d3 ) return d1;
joachim99@8 41 if ( d2 < d3 ) return d2;
joachim99@8 42 return d3;
joachim99@8 43 }
joachim99@8 44
joachim99@8 45 template <class T>
joachim99@8 46 T max3( T d1, T d2, T d3 )
joachim99@8 47 {
joachim99@8 48
joachim99@8 49 if ( d1 > d2 && d1 > d3 ) return d1;
joachim99@8 50
joachim99@8 51
joachim99@8 52 if ( d2 > d3 ) return d2;
joachim99@8 53 return d3;
joachim99@8 54
joachim99@8 55 }
joachim99@8 56
joachim99@8 57 template <class T>
joachim99@8 58 T minMaxLimiter( T d, T minimum, T maximum )
joachim99@8 59 {
joachim99@8 60 assert(minimum<=maximum);
joachim99@8 61 if ( d < minimum ) return minimum;
joachim99@8 62 if ( d > maximum ) return maximum;
joachim99@8 63 return d;
joachim99@8 64 }
joachim99@8 65
joachim99@8 66 #endif