From: Oliver Schmidt
Date: Fri, 17 Aug 2018 23:28:30 +0000 (+0200)
Subject: Express assumption about struct timespec.
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fe5af26f9fc2b36dc91b646a60da0090accb98c4;p=cc65
Express assumption about struct timespec.
We basically cast a struct timespec pointer to a time_t pointer when we pass the clock_settime() paramter to localtime(). Explicitly express that in the source code.
---
diff --git a/libsrc/apple2/settime.s b/libsrc/apple2/settime.s
index a71e113c5..2235d1a3f 100644
--- a/libsrc/apple2/settime.s
+++ b/libsrc/apple2/settime.s
@@ -29,6 +29,7 @@ _clock_settime:
tya ; Restore A
; Get tm
+ .assert timespec::tv_sec = 0, error
jsr _localtime
sta ptr1
stx ptr1+1
diff --git a/libsrc/c128/settime.s b/libsrc/c128/settime.s
index afe9c0693..0d95a3958 100644
--- a/libsrc/c128/settime.s
+++ b/libsrc/c128/settime.s
@@ -20,6 +20,7 @@
jsr pushax
+ .assert timespec::tv_sec = 0, error
jsr _localtime
sta ptr1
stx ptr1+1
diff --git a/libsrc/c64/settime.s b/libsrc/c64/settime.s
index b60cb7172..c72d535bc 100644
--- a/libsrc/c64/settime.s
+++ b/libsrc/c64/settime.s
@@ -20,6 +20,7 @@
jsr pushax
+ .assert timespec::tv_sec = 0, error
jsr _localtime
sta ptr1
stx ptr1+1
diff --git a/libsrc/cbm510/settime.s b/libsrc/cbm510/settime.s
index 6e425eaff..0c377eb63 100644
--- a/libsrc/cbm510/settime.s
+++ b/libsrc/cbm510/settime.s
@@ -23,6 +23,7 @@
jsr sys_bank
jsr pushax
+ .assert timespec::tv_sec = 0, error
jsr _localtime
sta ptr1
stx ptr1+1
diff --git a/libsrc/cbm610/settime.s b/libsrc/cbm610/settime.s
index e540c07d0..a42f451cf 100644
--- a/libsrc/cbm610/settime.s
+++ b/libsrc/cbm610/settime.s
@@ -23,6 +23,7 @@
jsr sys_bank
jsr pushax
+ .assert timespec::tv_sec = 0, error
jsr _localtime
sta ptr1
stx ptr1+1