From a918338bdf1a631b79e87e75b213c1cf543a4542 Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Sun, 22 Sep 2013 18:59:19 +0200 Subject: [PATCH] Added some comments, mostly TODO items --- src/gswe-moment.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index d4fb29f..203ddcb 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -520,6 +520,8 @@ gswe_moment_calculate_house_positions(GsweMoment *moment, GError **err) jd = gswe_timestamp_get_julian_day(moment->priv->timestamp, err); + // If Julian Day calculation yields error, we don't do anything. err is + // already filled with the error message, so let's just return if ((err) && (*err)) { return; } @@ -550,6 +552,8 @@ gswe_moment_calculate_house_positions(GsweMoment *moment, GError **err) moment->priv->house_revision = moment->priv->revision; + // The Ascendent, MC and Vertex points are also calculated by swe_houses(), + // so let's update them. if (gswe_moment_has_planet(moment, GSWE_PLANET_ASCENDENT)) { gswe_calculate_data_by_position(moment, GSWE_PLANET_ASCENDENT, ascmc[0], err); } @@ -615,6 +619,10 @@ gswe_moment_add_planet(GsweMoment *moment, GswePlanet planet) } if ((planet_info = g_hash_table_lookup(gswe_planet_info_table, GINT_TO_POINTER(planet))) == NULL) { + // TODO: Some real error checking should be done here, like checking if + // @planet is really from GswePlanet. If so, that is a fatal error. + // Otherwise, the developer erred, and a warning may be still issued. + // Also, a GError ** should be added to the parameters. g_warning("Unknown planet ID: %d", planet); return; @@ -669,6 +677,7 @@ gswe_moment_calculate_planet(GsweMoment *moment, GswePlanet planet, GError **err return; } + // TODO: This function should know about Ascendant, MC and Vertex, so it could calculate their positions, too if (planet_data->planet_info->real_body == FALSE) { g_warning("The position data of planet %d can not be calculated by this function", planet);