1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-10-28 09:23:54 +00:00

Use int return for error code

This commit is contained in:
Peter Evans 2018-02-04 00:06:22 -06:00
parent dd2b956b49
commit 8009a33bd4
2 changed files with 11 additions and 7 deletions

View File

@ -185,15 +185,16 @@ struct apple2dd {
extern SEGMENT_READER(apple2_dd_switch_read);
extern SEGMENT_WRITER(apple2_dd_switch_write);
extern apple2dd *apple2_dd_create();
extern int apple2_dd_decode(apple2dd *);
extern int apple2_dd_encode(apple2dd *);
extern int apple2_dd_insert(apple2dd *, FILE *, int);
extern int apple2_dd_position(apple2dd *);
extern vm_8bit apple2_dd_read(apple2dd *);
extern vm_8bit apple2_dd_switch_rw(apple2dd *);
extern void apple2_dd_eject(apple2dd *);
extern void apple2_dd_encode(apple2dd *);
extern void apple2_dd_decode(apple2dd *);
extern void apple2_dd_free(apple2dd *);
extern void apple2_dd_map(vm_segment *);
extern void apple2_dd_save(apple2dd *);
extern void apple2_dd_set_mode(apple2dd *, int);
extern void apple2_dd_shift(apple2dd *, int);
extern void apple2_dd_step(apple2dd *, int);
@ -203,6 +204,5 @@ extern void apple2_dd_switch_phase(apple2dd *, size_t);
extern void apple2_dd_turn_on(apple2dd *, bool);
extern void apple2_dd_write(apple2dd *);
extern void apple2_dd_write_protect(apple2dd *, bool);
extern void apple2_dd_save(apple2dd *);
#endif

View File

@ -97,7 +97,7 @@ apple2_dd_insert(apple2dd *drive, FILE *stream, int type)
* 6-and-2 encoding, if necessary. (It is not necessary if the
* image_type is DD_NIBBLE.)
*/
void
int
apple2_dd_encode(apple2dd *drive)
{
switch (drive->image_type) {
@ -112,8 +112,10 @@ apple2_dd_encode(apple2dd *drive)
default:
log_critical("Unknown image type");
exit(1);
return ERR_INVALID;
}
return OK;
}
/*
@ -138,7 +140,7 @@ apple2_dd_save(apple2dd *drive)
* the 6-and-2 encoding (if need be -- see note on DD_NIBBLE for the
* encode function).
*/
void
int
apple2_dd_decode(apple2dd *drive)
{
switch (drive->image_type) {
@ -153,8 +155,10 @@ apple2_dd_decode(apple2dd *drive)
default:
log_critical("Unknown image type");
exit(1);
return ERR_INVALID;
}
return OK;
}
/*