[teklib-general] teklib: Astro Date module: DST calculation was broken, corrected...

Timm S. Mueller tmueller at neoscientists.org
Sat Jan 10 01:35:25 CET 2009


details:   http://hg.teklib.org/teklib/rev/6a88b9254afe
changeset: 220:6a88b9254afe
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sat Jan 10 01:31:19 2009 +0100
description:
Astro Date module: DST calculation was broken, corrected; THALO type removed,
struct THALObject is now used throughout; Windows HAL and IO timing functions
adapted to new TDATE type

diffs (truncated from 546 to 100 lines):

diff -r b36538e3e1f7 -r 6a88b9254afe build/config/winnt_winnt.tmk
--- a/build/config/winnt_winnt.tmk	Fri Jan 09 13:01:37 2009 +0100
+++ b/build/config/winnt_winnt.tmk	Sat Jan 10 01:31:19 2009 +0100
@@ -44,7 +44,7 @@
 	CAT         = cat
 	ECHO        = echo
 
-	# CCPREFIX    = i586-mingw32-
+	CCPREFIX    = i586-mingw32-
 
 	CC			= $(CCPREFIX)gcc -mno-cygwin -DWIN32
 	AR			= $(CCPREFIX)ar rcu
diff -r b36538e3e1f7 -r 6a88b9254afe src/date/astro_mod.c
--- a/src/date/astro_mod.c	Fri Jan 09 13:01:37 2009 +0100
+++ b/src/date/astro_mod.c	Sat Jan 10 01:31:19 2009 +0100
@@ -461,7 +461,6 @@
 	if((db = (struct TDateBox *) TGetTag(events, TEVT_BeginDST, TNULL)))
 	{
 		TINT d;
-
 		if(db->tdb_Year<1996)
 		{
 			dt_makedate(astro, &tmp, 1,5,y, TNULL);
@@ -476,17 +475,14 @@
 			d = TUtilGetWeekDay(astro->util, 31,  3, y);
 			TExecSubDate(astro->exec, &tmp, d, TNULL);
 		}
-
 		TUtilUnpackDate(astro->util, &tmp, db, TDB_WDAY|TDB_DAY|TDB_MONTH|TDB_YEAR);
-
 	}
 
 	/* end DST (ende Sommerzeit) */
 	if((db = (struct TDateBox *) TGetTag(events, TEVT_EndDST, TNULL)))
 	{
 		TINT d;
-
-		if(db->tdb_Year<1996)
+		if(y < 1996)
 		{
 			dt_makedate(astro, &tmp, 30,9,y, TNULL);
 			d = TUtilGetWeekDay(astro->util, 30,  9, y);
@@ -496,12 +492,10 @@
 			dt_makedate(astro, &tmp, 31,10,y, TNULL);
 			d = TUtilGetWeekDay(astro->util, 31, 10, y);
 			TExecSubDate(astro->exec, &tmp, d, TNULL);
+
 		}
-
 		TUtilUnpackDate(astro->util, &tmp, db, TDB_WDAY|TDB_DAY|TDB_MONTH|TDB_YEAR);
-
 	}
-
 }
 
 
diff -r b36538e3e1f7 -r 6a88b9254afe src/hal/hal_mod.h
--- a/src/hal/hal_mod.h	Fri Jan 09 13:01:37 2009 +0100
+++ b/src/hal/hal_mod.h	Sat Jan 10 01:31:19 2009 +0100
@@ -1,4 +1,3 @@
-
 #ifndef _TEK_HAL_HAL_MOD_H
 #define	_TEK_HAL_HAL_MOD_H
 
@@ -71,13 +70,13 @@
 EXPORT void hal_copymem(struct THALBase *hal, TAPTR from, TAPTR to, TUINT numbytes);
 EXPORT void hal_fillmem(struct THALBase *hal, TAPTR dest, TUINT numbytes,
 	TUINT8 fillval);
-EXPORT TBOOL hal_initlock(struct THALBase *hal, THALO *lock);
-EXPORT void hal_destroylock(struct THALBase *hal, THALO *lock);
-EXPORT void hal_lock(struct THALBase *hal, THALO *lock);
-EXPORT void hal_unlock(struct THALBase *hal, THALO *lock);
-EXPORT TBOOL hal_initthread(struct THALBase *hal, THALO *thread,
+EXPORT TBOOL hal_initlock(struct THALBase *hal, struct THALObject *lock);
+EXPORT void hal_destroylock(struct THALBase *hal, struct THALObject *lock);
+EXPORT void hal_lock(struct THALBase *hal, struct THALObject *lock);
+EXPORT void hal_unlock(struct THALBase *hal, struct THALObject *lock);
+EXPORT TBOOL hal_initthread(struct THALBase *hal, struct THALObject *thread,
 	TTASKENTRY void (*function)(struct TTask *task), TAPTR data);
-EXPORT void hal_destroythread(struct THALBase *hal, THALO *thread);
+EXPORT void hal_destroythread(struct THALBase *hal, struct THALObject *thread);
 EXPORT TAPTR hal_findself(struct THALBase *hal);
 EXPORT TAPTR hal_loadmodule(struct THALBase *hal, TSTRPTR name, TUINT16 version,
 	TUINT *psize, TUINT *nsize);
@@ -88,9 +87,8 @@
 EXPORT TBOOL hal_scanmodules(struct THALBase *hal, TSTRPTR path, struct THook *hook);
 EXPORT TTAG hal_getattr(struct THALBase *hal, TUINT tag, TTAG defval);
 EXPORT TUINT hal_wait(struct THALBase *hal, TUINT signals);
-EXPORT void hal_signal(struct THALBase *hal, THALO *thread, TUINT signals);
+EXPORT void hal_signal(struct THALBase *hal, struct THALObject *thread, TUINT signals);
 EXPORT TUINT hal_setsignal(struct THALBase *hal, TUINT newsig, TUINT sigmask);
 EXPORT void hal_getsystime(struct THALBase *hal, TTIME *time);
 
-
 #endif
diff -r b36538e3e1f7 -r 6a88b9254afe src/hal/posix/hal.c
--- a/src/hal/posix/hal.c	Fri Jan 09 13:01:37 2009 +0100
+++ b/src/hal/posix/hal.c	Sat Jan 10 01:31:19 2009 +0100
@@ -214,7 +214,7 @@
 */


More information about the teklib-general mailing list