Fix some errors and warnings for GCC 6

* do not use std::abs() because math.h includes one, that converts ints
      to double. Use own iabs(), which directly uses labs() instead.
    * don't use the word "gamma" as name for variables
    * don't use a homebrew round() function

It bases mainly on 98d01d1f34
This commit is contained in:
aurhat
2020-11-02 22:42:00 +01:00
parent f8d3e968ed
commit ae65a64828
14 changed files with 32 additions and 37 deletions
+1 -1
View File
@@ -763,7 +763,7 @@ bool hashstring(const char *str, char *result, int maxlen)
const char *genpwdhash(const char *name, const char *pwd, int salt)
{
static string temp;
formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, abs(PROTOCOL_VERSION));
formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, iabs(PROTOCOL_VERSION));
tiger::hashval hash;
tiger::hash((uchar *)temp, (int)strlen(temp), hash);
formatstring(temp)("%llx %llx %llx", hash.chunks[0], hash.chunks[1], hash.chunks[2]);