Commit Graph

15 Commits

Author SHA1 Message Date
Andy McFadden b42cc8efe9 Fix Linux build
gcc is justifiably annoyed by variable initialization crossed by
a goto.

(issue #51)
2021-09-07 13:36:28 -07:00
Andy McFadden d39c61255c Work around ProDOS sparse block issue
It appears that some programs, notably Copy ][+ and the GS/OS FST,
expect that the first block of a sparse file will always be
allocated, even if it's just 512 zeroes.  I've only seen this fail
in cases where the first entry in the master index block of a "tree"
file is zero, because the first 128KB are sparse, but rumor has it
that the issue can affect "sapling" files as well.

This changes CiderPress to work the way ProDOS does: always allocate
a block to hold the first 512 bytes of the file.  The only exception
to this is a file that is nothing but zeroes (perhaps populated by
creating a file and setting its EOF to something large), which can
be stored as a seedling.

(for issues #15 and #49)
2021-07-23 18:52:23 -07:00
Andy McFadden adaeb2c6eb Fix warnings
Added explicit casts and class initializers.  The problems were
identified by the VS2019 compiler.
2021-04-24 13:43:04 -07:00
Andy McFadden fb25998be5 Fix handling of ProDOS disks with short volume directories
The ProDOS code was assuming that the volume directory was 4 blocks
long.  Some disks, such as the ProDOS 2.4.2 distribution disk, only
use the first two blocks.  CiderPress now scans the volume directory
to determine the actual length.

Fixes issue #32.
2020-07-23 14:12:16 -07:00
Andy McFadden b97584eeb6 Update Linux build
Fix some %ld message in log messages, and update the Linux sample
code to match recent changes in NufxLib and DiskImgLib.

Also, bump MDC version to 3.0.0 to match Windows version.
2015-01-08 18:27:09 -08:00
Andy McFadden d94b707489 Use more integers with explicit widths
Updated some structs and a few DiskImg APIs, primarily file type,
aux type, and access flags.
2015-01-04 18:20:59 -08:00
Andy McFadden 29e64011e1 Don't use %zd format
Visual Studio still doesn't support it.
2014-12-11 17:34:25 -08:00
Andy McFadden 8e910b23ca gcc/linux updates
Many updates to format strings, largely as a result of changing
various "long" variables to uint32_t.

Fixed the diskimg debug macros for gcc, which requires an extra
"##" to remove the "," when there are no arguments.  (Apparently
Visual Studio just strips this away for you.)

Stripped out a couple of dead variables spotted by gcc.  Return
the actual error in a couple of HFS file functions.
2014-12-11 16:36:40 -08:00
Andy McFadden aa3145856c Use types with explicit sizes
Focusing on the diskimg library this time, which deals with a lot of
filesystem structures that have specific widths.

This is still a bit lax in places, e.g. using "long" for lengths.
Should either specify a bit width or use di_off_t.

Also, added "override" keyword where appropriate.

Also, bumped library version to 5.0.0.
2014-11-24 15:57:25 -08:00
Andy McFadden d8223dbcfd Relocate method comments
This moves method comments from the .cpp file to the .h file,
where users of the methods can find them.  This also makes it
possible for the IDE to show the comments when you mouse-hover over
the method name, though Visual Studio is a bit weak in this regard.

Also, added "override" keywords on overridden methods.  Reasonably
current versions of popular compilers seem to support this.

Also, don't have the return type on a separate line in the .cpp file.
The motivation for the practice -- quickly finding a method definition
with "^name" -- is less useful in C++ than C, and modern IDEs provide
more convenient ways to do the same thing.

Also, do some more conversion from unsigned types to uintXX_t.

This commit is primarily for the "app" directory.
2014-11-21 22:33:39 -08:00
Andy McFadden d60a6dbcfa Fix some issues identified by static analyzer
Includes "printf format" annotation on debug log function.
2014-11-19 14:54:24 -08:00
Andy McFadden f6647b9978 Convert WSMG to LOG
Mostly a bulk conversion of debug messages, primarily with sed:

 sed -e 's/\(WMSG[0-9]\)\(.*\)\(\\n"\)/LOGI\2"/'

This removes the '\n' from the end of the log messages, and sets
them all to "info" severity.

We want to prefix each line with file/line and/or a timestamp,
so it doesn't make sense to have a partial line, and there's no
value in embedding the '\n' in every string.
2014-11-18 14:16:35 -08:00
Andy McFadden bf5e2bce50 Change "nil" to "NULL" 2014-11-17 21:37:36 -08:00
Andy McFadden 63b9996009 Normalize indentation and EOL
This updates all source files to use spaces instead of tabs for
indentation.  It also normalizes the end-of-line markers to be
Windows-style CRLF, and ensures that all files end with EOL.

No substantive changes were made; "diff -w" is empty.
2014-11-03 16:26:53 -08:00
Andy McFadden 0d7d1b67e0 initial import 2007-03-27 17:47:10 +00:00