Changeset - r21534:f2ebd0eefb77
[Not reviewed]
master
0 3 0
rubidium - 10 years ago 2014-06-17 19:01:45
rubidium@openttd.org
(svn r26651) -Fix: make sure an abs is used that supports int64 when using abs on those variables
3 files changed with 16 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/core/math_func.hpp
Show inline comments
 
@@ -12,18 +12,6 @@
 
#ifndef MATH_FUNC_HPP
 
#define MATH_FUNC_HPP
 

	
 
#ifdef min
 
#undef min
 
#endif
 

	
 
#ifdef max
 
#undef max
 
#endif
 

	
 
#ifdef abs
 
#undef abs
 
#endif
 

	
 
/**
 
 * Returns the maximum of two values.
 
 *
src/core/overflowsafe_type.hpp
Show inline comments
 
@@ -12,6 +12,7 @@
 
#ifndef OVERFLOWSAFE_TYPE_HPP
 
#define OVERFLOWSAFE_TYPE_HPP
 

	
 
#include "math_func.hpp"
 

	
 
/**
 
 * Overflow safe template for integers, i.e. integers that will never overflow
src/safeguards.h
Show inline comments
 
@@ -56,4 +56,19 @@
 
/* No clear replacement. */
 
#define strtok    SAFEGUARD_DO_NOT_USE_THIS_METHOD
 

	
 
/* Use our own templated implementation instead of a macro or function with only one type. */
 
#ifdef min
 
#undef min
 
#endif
 

	
 
/* Use our own templated implementation instead of a macro or function with only one type. */
 
#ifdef max
 
#undef max
 
#endif
 

	
 
/* Use our own templated implementation instead of a macro or function with only one type. */
 
#ifdef abs
 
#undef abs
 
#endif
 

	
 
#endif /* SAFEGUARDS_H */
0 comments (0 inline, 0 general)