From 7dcf4417bcaebe09d868a7ef08a69914846898a0 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 15 Apr 2024 19:32:19 +0300 Subject: [PATCH] Resolved linter warnings --- cpm/cpm.go | 2 +- cpm/cpm_syscalls.go | 14 +++----------- fcb/fcb.go | 2 +- memory/memory.go | 2 +- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/cpm/cpm.go b/cpm/cpm.go index 7a3e985..c949729 100644 --- a/cpm/cpm.go +++ b/cpm/cpm.go @@ -1,4 +1,4 @@ -// Package CPM is the main package for our emulator, it uses memory to +// Package cpm is the main package for our emulator, it uses memory to // emulate execution of things at the bios level package cpm diff --git a/cpm/cpm_syscalls.go b/cpm/cpm_syscalls.go index 881fcef..445242e 100644 --- a/cpm/cpm_syscalls.go +++ b/cpm/cpm_syscalls.go @@ -167,7 +167,7 @@ func SysCallFileOpen(cpm *CPM) error { // Get file size, in bytes fi, err := cpm.file.Stat() if err != nil { - return fmt.Errorf("Failed to get file size of %s: %s", fileName, err) + return fmt.Errorf("failed to get file size of %s: %s", fileName, err) } // Get file size, in bytes @@ -311,7 +311,7 @@ func SysCallFindNext(cpm *CPM) error { return nil } -// SyscallDeleteFile deletes the filename specified by the FCB in DE. +// SysCallDeleteFile deletes the filename specified by the FCB in DE. func SysCallDeleteFile(cpm *CPM) error { // The pointer to the FCB @@ -449,10 +449,7 @@ func SysCallReadRand(cpm *CPM) error { } // Get the record to read - var record int - - // Damn - record = int(int(fcbPtr.R2)<<16) | int(int(fcbPtr.R1)<<8) | int(fcbPtr.R0) + record := int(int(fcbPtr.R2)<<16) | int(int(fcbPtr.R1)<<8) | int(fcbPtr.R0) if record > 65535 { cpm.CPU.States.AF.Hi = 0x06 @@ -480,8 +477,3 @@ func SysCallReadRand(cpm *CPM) error { cpm.CPU.States.AF.Hi = uint8(res) return nil } - -// SysCallUnimplemented is a placeholder for functions we don't implement -func SysCallUnimplemented(cpm *CPM) error { - return nil -} diff --git a/fcb/fcb.go b/fcb/fcb.go index 2041549..26c614f 100644 --- a/fcb/fcb.go +++ b/fcb/fcb.go @@ -1,4 +1,4 @@ -// Package FCB contains helpers for reading, writing, and working with the CP/M FCB structure. +// Package fcb contains helpers for reading, writing, and working with the CP/M FCB structure. package fcb import ( diff --git a/memory/memory.go b/memory/memory.go index 63fa7ec..3381c14 100644 --- a/memory/memory.go +++ b/memory/memory.go @@ -1,4 +1,4 @@ -// Memory is a package that provides the 64k of RAM +// Package memory is a package that provides the 64k of RAM // within which the emulator executes its programs. package memory