Skip to content

Commit

Permalink
Reformat with clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Sep 25, 2023
1 parent 657f3b1 commit 21c8d0b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions src/lsdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,19 @@ int dos_read(struct atr_image *atr, const char *atr_name, int atari_list, int lo
return 1;
if( bitmap_0 & 0x80 )
return 1;
ldos_csize = 2 + 2 * (signature & 0x3F);
ldos_csize = 2 + 2 * (signature & 0x3F);
dir_size = 8 * ldos_csize - 8;
}
else if( signature < 1 )
return 1; // Invalid DOS
return 1; // Invalid DOS
else
{
if( (signature == 1 && atr->sec_size != 128) || // DOS 1 only supports SD,
(signature == 1 && atr->sec_count > 720) || // 720 sectors of 128 bytes.
(signature > 2 && signature != mydos_sig) || // MyDOS signature for >944 sectors
(signature == 2 && atr->sec_count > 1120) || // DOS 2.x only up to 1040 sectors,
// but there are images with 1120
// sectors.
(signature > 2 && signature != mydos_sig) || // MyDOS signature for >944 secs
(signature == 2 && atr->sec_count > 1120) || // DOS 2.x only up to 1040
// sectors, but there are images
// with 1120 sectors.
0 != (bitmap_0 & 0x80) ) // Sector 0 allocated
{
return 1;
Expand Down
15 changes: 8 additions & 7 deletions src/mkatr.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ int main(int argc, char **argv)
{
char *out = 0;
int i;
unsigned boot_addr = 0x07; // Standard boot address: $800
int boot_file = 0; // Next file is boot file
enum fattr attribs = 0; // Next file attributes
int exact_size = 0; // Use image of exact size
int min_size = 0; // Minimum image size
const int max_size = image_size(65535, 256); // Maximum image size
unsigned boot_addr = 0x07; // Standard boot address: $800
int boot_file = 0; // Next file is boot file
enum fattr attribs = 0; // Next file attributes
int exact_size = 0; // Use image of exact size
int min_size = 0; // Minimum image size
const int max_size = image_size(65535, 256); // Maximum image size

prog_name = argv[0];

Expand Down Expand Up @@ -228,7 +228,8 @@ int main(int argc, char **argv)
break;
sfs_free(sfs);
sfs = n;
if( sfs_get_free_sectors(sfs) > 0 && image_size(nsec - 1, ssec) > min_size )
if( sfs_get_free_sectors(sfs) > 0 &&
image_size(nsec - 1, ssec) > min_size )
{
nsec = nsec - sfs_get_free_sectors(sfs) + 1;
if( image_size(nsec, ssec) < min_size )
Expand Down
7 changes: 3 additions & 4 deletions src/spartafs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
/*
* Sparta FS
*/

#include "spartafs.h"
#include "asm/boot128.h"
#include "asm/boot256.h"
#include "crc32.h"
#include "msg.h"
#include "spartafs.h"
#include <string.h>
#include <stdint.h>
#include <string.h>

static char hex(int x)
{
Expand Down Expand Up @@ -96,7 +95,7 @@ static int sfs_patch_byte(struct sfs *sfs, int smap, int pos, int byte)
if( sect < 1 || sect > sfs->nsec )
return -1;
uint8_t *data = sfs_ptr(sfs, sect);
data[pos] = byte;
data[pos] = byte;
return 0;
}

Expand Down

0 comments on commit 21c8d0b

Please sign in to comment.