mirror of https://gitlab.com/rnger/amath
Code cleanup
modified: app/lib/ntext.cpp modified: app/main/lexer.cpp modified: app/system/language.cpp modified: app/system/language_posix.cpp modified: app/system/preferences_stdc.cpp modified: lib/real/pow.c modified: lib/platform.h
This commit is contained in:
parent
340a99d861
commit
4ea2b3af84
|
@ -236,7 +236,7 @@ const char* PositionalNumeralSystem::GetText(double number)
|
|||
if (exponent != 0) {
|
||||
buf->Append('e');
|
||||
buf->Append(exponent > 0 ? '+' : '-');
|
||||
IntegerToBuffer(fabs(exponent), 3, &digitout);
|
||||
IntegerToBuffer(abs(exponent), 3, &digitout);
|
||||
}
|
||||
|
||||
// Make sure no rounding error is returned
|
||||
|
@ -447,7 +447,7 @@ const char* DecimalSystem::GetRealText(double value)
|
|||
while (buf->RemoveTrailing('0'))
|
||||
;
|
||||
buf->RemoveTrailing(fractionpoint);
|
||||
delete out;
|
||||
delete[] out;
|
||||
|
||||
return buf->GetString();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ Lexer::~Lexer()
|
|||
delete [] input;
|
||||
|
||||
if (first != NOMEM) {
|
||||
delete first;
|
||||
delete [] first;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ bool Lexer::GetDigitValue()
|
|||
*(text + len) = '\0';
|
||||
|
||||
current = new Token(current, symnumber, text, pos);
|
||||
delete text;
|
||||
delete [] text;
|
||||
delete number;
|
||||
|
||||
pos += len;
|
||||
|
|
|
@ -156,7 +156,7 @@ char* Language::UntagText(const char* text)
|
|||
unsigned int len = StrLen(untagged) + 1;
|
||||
lastText = new char[len];
|
||||
MemCopy(lastText, untagged, len);
|
||||
delete untagged;
|
||||
delete [] untagged;
|
||||
|
||||
return lastText;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ bool PosixLanguage::StrIsEqualLoc(const char* s1, const char* s2)
|
|||
char *tmp = new char[len];
|
||||
strxfrm(tmp, s2, len);
|
||||
bool res = StrIsEqual(s1, tmp);
|
||||
delete tmp;
|
||||
delete [] tmp;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ bool StandardPreferences::Load()
|
|||
}
|
||||
} while (c != NULL);
|
||||
|
||||
delete buf;
|
||||
delete [] buf;
|
||||
fclose(file);
|
||||
SetPrefs(text->GetString());
|
||||
delete text;
|
||||
|
|
|
@ -42,9 +42,12 @@
|
|||
#include "prim.h"
|
||||
#include "math.h"
|
||||
|
||||
#if __GNUC__ > 2
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#ifdef __clang__
|
||||
# pragma clang diagnostic ignored "-Wunused-variable"
|
||||
# pragma clang diagnostic ignored "-Wstrict-aliasing"
|
||||
#elif defined(__GNUC__) || defined(__GNUG__) && __GNUC__ > 2
|
||||
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif
|
||||
|
||||
static const double
|
||||
|
|
Loading…
Reference in New Issue