From: cuz Date: Wed, 3 Dec 2003 20:23:09 +0000 (+0000) Subject: Use structs X-Git-Tag: V2.12.0~1092 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a1092ca7da2bb2faac29aeb0a4076b2b54e41c70;p=cc65 Use structs git-svn-id: svn://svn.cc65.org/cc65/trunk@2710 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/asminc/utsname.inc b/asminc/utsname.inc index 9a3fb6743..6e2289244 100644 --- a/asminc/utsname.inc +++ b/asminc/utsname.inc @@ -33,13 +33,14 @@ -; Struct utsname offsets and size -utsname_sysname = 0 -utsname_nodename = utsname_sysname + 17 -utsname_release = utsname_nodename + 9 -utsname_version = utsname_release + 9 -utsname_machine = utsname_version + 9 -utsname_size = utsname_machine + 25 -utsname_fieldcount = 5 +; Struct utsname +.struct utsname + sysname .byte 17 + nodename .byte 9 + release .byte 9 + version .byte 9 + machine .byte 25 +.endstruct + diff --git a/libsrc/common/utscopy.s b/libsrc/common/utscopy.s index adf8a006e..d89f2d518 100644 --- a/libsrc/common/utscopy.s +++ b/libsrc/common/utscopy.s @@ -26,11 +26,13 @@ ; Table with offsets into struct utsname fieldoffs: - .byte utsname_sysname - .byte utsname_nodename - .byte utsname_release - .byte utsname_version - .byte utsname_machine + .byte utsname::sysname + .byte utsname::nodename + .byte utsname::release + .byte utsname::version + .byte utsname::machine + +fieldcount = * - fieldoffs ;-------------------------------------------------------------------------- @@ -45,7 +47,7 @@ fieldoffs: stx tmp1 ; Field number next: ldy tmp1 - cpy #utsname_fieldcount + cpy #fieldcount beq done inc tmp1 ; Bump field counter lda fieldoffs,y ; Get next field offset