]> git.sur5r.net Git - cc65/commitdiff
Express assumption about struct timespec.
authorOliver Schmidt <ol.sc@web.de>
Fri, 17 Aug 2018 23:28:30 +0000 (01:28 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 17 Aug 2018 23:29:40 +0000 (01:29 +0200)
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
libsrc/c128/settime.s
libsrc/c64/settime.s
libsrc/cbm510/settime.s
libsrc/cbm610/settime.s

index a71e113c5239513ff81648eb92e849c4f951d859..2235d1a3f7bb33e5a6f634a8a0c851d0e1d470c2 100644 (file)
@@ -29,6 +29,7 @@ _clock_settime:
         tya                     ; Restore A
 
         ; Get tm
+        .assert timespec::tv_sec = 0, error
         jsr     _localtime
         sta     ptr1
         stx     ptr1+1
index afe9c06939d0633a84147580feab08c7180978e1..0d95a39584096b94871eb1cdfe3c5d6b27606883 100644 (file)
@@ -20,6 +20,7 @@
 
         jsr     pushax
 
+        .assert timespec::tv_sec = 0, error
         jsr     _localtime
         sta     ptr1
         stx     ptr1+1
index b60cb717270678d7479dba7a4729dfc7bbbb8288..c72d535bc941dfdf111ce2946c28f09ec145f51f 100644 (file)
@@ -20,6 +20,7 @@
 
         jsr     pushax
 
+        .assert timespec::tv_sec = 0, error
         jsr     _localtime
         sta     ptr1
         stx     ptr1+1
index 6e425eaffefd3a7f3d16530a2292d5cab15e142c..0c377eb63c9e6ad95d362318ad637d3a2a1c0931 100644 (file)
@@ -23,6 +23,7 @@
         jsr     sys_bank
         jsr     pushax
 
+        .assert timespec::tv_sec = 0, error
         jsr     _localtime
         sta     ptr1
         stx     ptr1+1
index e540c07d0cf110bf9aa3ec2440c877880e1425b0..a42f451cf56bfd95fdb3797e18ecfdbcfae7322d 100644 (file)
@@ -23,6 +23,7 @@
         jsr     sys_bank
         jsr     pushax
 
+        .assert timespec::tv_sec = 0, error
         jsr     _localtime
         sta     ptr1
         stx     ptr1+1