summaryrefslogtreecommitdiffstats
path: root/general
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-02-23 03:40:24 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-02-23 03:40:24 +0000
commitd7bc310363c98994457e7882e7010e276169f00a (patch)
treeb59a7e27c9c5a9fc15c959a289b9ab105127a4aa /general
parent426721374e515ed14fc3b8d2afabfbb34e223e60 (diff)
[FIX] Frac bug with type of Over1
[FIX] PokemodUI vtable errors [FIX] Manual .pro file clean up [FIX] Was attempting to emit a slot... git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@72 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'general')
-rw-r--r--general/Frac.cpp11
-rw-r--r--general/general.pro40
2 files changed, 21 insertions, 30 deletions
diff --git a/general/Frac.cpp b/general/Frac.cpp
index 9cf47aca..317fdc53 100644
--- a/general/Frac.cpp
+++ b/general/Frac.cpp
@@ -24,7 +24,7 @@
void Frac::set(const int n, const int d) throw(Exception)
{
- if (((type == Improper) || ((n <= d) && (type == Proper)) || ((d < n) && (type == Over1))) && (0 < d))
+ if (((type == Improper) || ((n <= d) && (type == Proper)) || ((d <= n) && (type == Over1))) && (0 < d))
{
num = n;
denom = d;
@@ -64,13 +64,8 @@ void Frac::reduce()
{
int i = num;
int j = denom;
- int k;
- while (j)
- {
- k = j;
- j = i % j;
- i = k;
- }
+ while (i - j)
+ (i > j) ? (i -= j) : (j -= i);
num /= i;
denom /= i;
}
diff --git a/general/general.pro b/general/general.pro
index 5f818d67..f394982d 100644
--- a/general/general.pro
+++ b/general/general.pro
@@ -44,28 +44,24 @@ win32 {
}
}
-CONFIG += qt \
-warn_on \
-dll \
-exceptions
-
-INCLUDEPATH += /usr/lib64/kde4
+CONFIG += qt warn_on dll exceptions
SOURCES += Audio.cpp \
-BugCatcher.cpp \
-Flag.cpp \
-Frac.cpp \
-ImageCache.cpp \
-Ini.cpp \
-Ref.cpp
+ BugCatcher.cpp \
+ Flag.cpp \
+ Frac.cpp \
+ ImageCache.cpp \
+ Ini.cpp \
+ Ref.cpp
+
HEADERS += Audio.h \
-BugCatcher.h \
-Exception.h \
-Flag.h \
-Frac.h \
-Hat.h \
-ImageCache.h \
-Ini.h \
-Matrix.h \
-Point.h \
-Ref.h
+ BugCatcher.h \
+ Exception.h \
+ Flag.h \
+ Frac.h \
+ Hat.h \
+ ImageCache.h \
+ Ini.h \
+ Matrix.h \
+ Point.h \
+ Ref.h