From 46a59fedf65913d222e1b5da54de292b393c0d3c Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 17 Sep 2013 09:43:10 +0200 Subject: [PATCH] Fixed zodiac calculation in GsweMoment Yielded GSWE_SIGN_NONE instead of GSWE_SIGN_ARIES at position 0.0 --- configure.ac | 2 +- data/{swe-glib-1.0.1.spec => swe-glib-1.0.2.spec} | 0 src/gswe-moment.c | 6 ++++++ 3 files changed, 7 insertions(+), 1 deletion(-) rename data/{swe-glib-1.0.1.spec => swe-glib-1.0.2.spec} (100%) diff --git a/configure.ac b/configure.ac index d681bf4..e45ea6c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ m4_define([swe_glib_major_version], [1]) m4_define([swe_glib_minor_version], [0]) -m4_define([swe_glib_micro_version], [1]) +m4_define([swe_glib_micro_version], [2]) m4_define([swe_glib_version], [swe_glib_major_version.swe_glib_minor_version.swe_glib_micro_version]) m4_define([swe_glib_api_version], [swe_glib_major_version.0]) diff --git a/data/swe-glib-1.0.1.spec b/data/swe-glib-1.0.2.spec similarity index 100% rename from data/swe-glib-1.0.1.spec rename to data/swe-glib-1.0.2.spec diff --git a/src/gswe-moment.c b/src/gswe-moment.c index 1d436e6..1274d56 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -476,6 +476,12 @@ gswe_calculate_data_by_position(GsweMoment *moment, GswePlanet planet, gdouble p sign = (GsweZodiac)ceil(position / 30.0); + // If position happens to be exactly 0, this calculation yields + // GSWE_SIGN_NONE, but should be GSWE_SIGN_ARIES + if (sign == 0) { + sign = 1; + } + if ((sign_info = g_hash_table_lookup(gswe_sign_info_table, GINT_TO_POINTER(sign))) == NULL) { g_error("Calculations brought an unknown sign!"); }