summaryrefslogtreecommitdiff
path: root/library/globalFunctions.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:57:03 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:57:03 +0200
commit420fb6c9b3427f65cfe24411944ee46b58cfcfb4 (patch)
tree58269ba5ee7a22d2df004f03b100cc234b8c3f14 /library/globalFunctions.h
parent1.16 (diff)
downloadFreeFileSync-420fb6c9b3427f65cfe24411944ee46b58cfcfb4.tar.gz
FreeFileSync-420fb6c9b3427f65cfe24411944ee46b58cfcfb4.tar.bz2
FreeFileSync-420fb6c9b3427f65cfe24411944ee46b58cfcfb4.zip
1.17
Diffstat (limited to 'library/globalFunctions.h')
-rw-r--r--library/globalFunctions.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/library/globalFunctions.h b/library/globalFunctions.h
index b4ccba5c..98e8cd1c 100644
--- a/library/globalFunctions.h
+++ b/library/globalFunctions.h
@@ -13,12 +13,17 @@
namespace globalFunctions
{
- int round(double d); //little rounding function
+ inline
+ int round(double d) //little rounding function
+ {
+ return static_cast<int>(d < 0 ? d - .5 : d + .5);
+ }
template <class T>
- T abs(const T& d) //absolute value
+ inline
+ T abs(const T& d) //absolute value
{
- return(d<0?-d:d);
+ return(d < 0 ? -d : d);
}
std::string numberToString(const unsigned int number); //convert number to string
@@ -35,7 +40,7 @@ namespace globalFunctions
int wxStringToInt( const wxString& number); //convert wxString to number
double wxStringToDouble(const wxString& number); //convert wxString to number
- wxString& includeNumberSeparator(wxString& number);
+ wxString includeNumberSeparator(const wxString& number);
int readInt(std::ifstream& stream); //read int from file stream
void writeInt(std::ofstream& stream, const int number); //write int to filestream
bgstack15