From fe5af26f9fc2b36dc91b646a60da0090accb98c4 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sat, 18 Aug 2018 01:28:30 +0200
Subject: [PATCH] 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.
---
libsrc/apple2/settime.s | 1 +
libsrc/c128/settime.s | 1 +
libsrc/c64/settime.s | 1 +
libsrc/cbm510/settime.s | 1 +
libsrc/cbm610/settime.s | 1 +
5 files changed, 5 insertions(+)
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
--
2.39.5