From 3a0ddc208737e9e97bbe40d674e2dc8dd71f3aef Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 21 Aug 2023 20:26:11 -0400 Subject: [PATCH] More linting in src/include/86box --- src/include/86box/86box.h | 88 ++++++++++----------- src/include/86box/bswap.h | 22 +++--- src/include/86box/cdrom.h | 8 +- src/include/86box/cdrom_image_backend.h | 20 ++--- src/include/86box/cdrom_interface.h | 2 +- src/include/86box/config.h | 18 ++--- src/include/86box/device.h | 50 ++++++------ src/include/86box/fdc_ext.h | 2 +- src/include/86box/fdd.h | 8 +- src/include/86box/fifo.h | 43 +++++----- src/include/86box/hdc.h | 2 +- src/include/86box/hdc_ide.h | 20 ++--- src/include/86box/i8080.h | 10 +-- src/include/86box/isartc.h | 2 +- src/include/86box/keyboard.h | 2 +- src/include/86box/lpt.h | 16 ++-- src/include/86box/machine.h | 57 ++++++------- src/include/86box/midi.h | 22 +++--- src/include/86box/mo.h | 4 +- src/include/86box/mouse.h | 4 +- src/include/86box/network.h | 2 +- src/include/86box/nmi.h | 2 +- src/include/86box/plat_serial_passthrough.h | 10 +-- src/include/86box/rom.h | 6 +- src/include/86box/row.h | 6 +- src/include/86box/scsi.h | 8 +- src/include/86box/scsi_aha154x.h | 2 +- src/include/86box/scsi_buslogic.h | 2 +- src/include/86box/scsi_cdrom.h | 2 +- src/include/86box/scsi_device.h | 10 +-- src/include/86box/scsi_disk.h | 6 +- src/include/86box/scsi_x54x.h | 62 +++++++-------- src/include/86box/serial.h | 16 ++-- src/include/86box/snd_ad1848.h | 4 +- src/include/86box/snd_azt2316a.h | 2 +- src/include/86box/snd_cms.h | 4 +- src/include/86box/snd_mpu401.h | 10 +-- src/include/86box/snd_opl.h | 10 +-- src/include/86box/snd_resid.h | 10 +-- src/include/86box/snd_sb.h | 18 ++--- src/include/86box/snd_sb_dsp.h | 4 +- src/include/86box/sound.h | 18 ++--- src/include/86box/timer.h | 3 +- src/include/86box/usb.h | 9 ++- src/include/86box/vid_colorplus.h | 10 +-- src/include/86box/vid_hercules.h | 22 +++--- src/include/86box/vid_pgc.h | 14 ++-- src/include/86box/vid_voodoo_common.h | 14 ++-- src/include/86box/vid_voodoo_display.h | 2 +- src/include/86box/vid_voodoo_fb.h | 8 +- src/include/86box/vid_voodoo_fifo.h | 2 +- src/include/86box/vid_voodoo_reg.h | 2 +- src/include/86box/vid_voodoo_texture.h | 2 +- src/include/86box/video.h | 22 +++--- src/include/86box/zip.h | 4 +- 55 files changed, 364 insertions(+), 364 deletions(-) diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 6ba6847b0..471c0616d 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -105,55 +105,55 @@ extern uint64_t instru_run_ms; #define window_w monitor_settings[0].mon_window_w #define window_h monitor_settings[0].mon_window_h extern int window_remember; -extern int vid_resize; /* (C) allow resizing */ -extern int invert_display; /* (C) invert the display */ -extern int suppress_overscan; /* (C) suppress overscans */ -extern uint32_t lang_id; /* (C) language code identifier */ -extern char icon_set[256]; /* (C) iconset identifier */ -extern int scale; /* (C) screen scale factor */ -extern int dpi_scale; /* (C) DPI scaling of the emulated screen */ -extern int vid_api; /* (C) video renderer */ -extern int vid_cga_contrast; /* (C) video */ -extern int video_fullscreen; /* (C) video */ -extern int video_fullscreen_first; /* (C) video */ -extern int video_fullscreen_scale; /* (C) video */ -extern int enable_overscan; /* (C) video */ -extern int force_43; /* (C) video */ -extern int video_filter_method; /* (C) video */ -extern int video_vsync; /* (C) video */ -extern int video_framerate; /* (C) video */ -extern int gfxcard[2]; /* (C) graphics/video card */ -extern char video_shader[512]; /* (C) video */ -extern int bugger_enabled; /* (C) enable ISAbugger */ -extern int postcard_enabled; /* (C) enable POST card */ -extern int isamem_type[]; /* (C) enable ISA mem cards */ -extern int isartc_type; /* (C) enable ISA RTC card */ -extern int sound_is_float; /* (C) sound uses FP values */ -extern int voodoo_enabled; /* (C) video option */ -extern int ibm8514_standalone_enabled; /* (C) video option */ -extern int xga_standalone_enabled; /* (C) video option */ -extern uint32_t mem_size; /* (C) memory size (Installed on system board) */ -extern uint32_t isa_mem_size; /* (C) memory size (ISA Memory Cards) */ -extern int cpu; /* (C) cpu type */ -extern int cpu_use_dynarec; /* (C) cpu uses/needs Dyna */ -extern int fpu_type; /* (C) fpu type */ -extern int fpu_softfloat; /* (C) fpu uses softfloat */ -extern int time_sync; /* (C) enable time sync */ -extern int hdd_format_type; /* (C) hard disk file format */ -extern int confirm_reset; /* (C) enable reset confirmation */ -extern int confirm_exit; /* (C) enable exit confirmation */ -extern int confirm_save; /* (C) enable save confirmation */ -extern int enable_discord; /* (C) enable Discord integration */ +extern int vid_resize; /* (C) allow resizing */ +extern int invert_display; /* (C) invert the display */ +extern int suppress_overscan; /* (C) suppress overscans */ +extern uint32_t lang_id; /* (C) language code identifier */ +extern char icon_set[256]; /* (C) iconset identifier */ +extern int scale; /* (C) screen scale factor */ +extern int dpi_scale; /* (C) DPI scaling of the emulated screen */ +extern int vid_api; /* (C) video renderer */ +extern int vid_cga_contrast; /* (C) video */ +extern int video_fullscreen; /* (C) video */ +extern int video_fullscreen_first; /* (C) video */ +extern int video_fullscreen_scale; /* (C) video */ +extern int enable_overscan; /* (C) video */ +extern int force_43; /* (C) video */ +extern int video_filter_method; /* (C) video */ +extern int video_vsync; /* (C) video */ +extern int video_framerate; /* (C) video */ +extern int gfxcard[2]; /* (C) graphics/video card */ +extern char video_shader[512]; /* (C) video */ +extern int bugger_enabled; /* (C) enable ISAbugger */ +extern int postcard_enabled; /* (C) enable POST card */ +extern int isamem_type[]; /* (C) enable ISA mem cards */ +extern int isartc_type; /* (C) enable ISA RTC card */ +extern int sound_is_float; /* (C) sound uses FP values */ +extern int voodoo_enabled; /* (C) video option */ +extern int ibm8514_standalone_enabled; /* (C) video option */ +extern int xga_standalone_enabled; /* (C) video option */ +extern uint32_t mem_size; /* (C) memory size (Installed on system board) */ +extern uint32_t isa_mem_size; /* (C) memory size (ISA Memory Cards) */ +extern int cpu; /* (C) cpu type */ +extern int cpu_use_dynarec; /* (C) cpu uses/needs Dyna */ +extern int fpu_type; /* (C) fpu type */ +extern int fpu_softfloat; /* (C) fpu uses softfloat */ +extern int time_sync; /* (C) enable time sync */ +extern int hdd_format_type; /* (C) hard disk file format */ +extern int confirm_reset; /* (C) enable reset confirmation */ +extern int confirm_exit; /* (C) enable exit confirmation */ +extern int confirm_save; /* (C) enable save confirmation */ +extern int enable_discord; /* (C) enable Discord integration */ extern int fixed_size_x; extern int fixed_size_y; -extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */ +extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */ #ifdef _Atomic -extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */ -extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */ +extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */ +extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */ #endif -extern int pit_mode; /* (C) force setting PIT mode */ -extern int fm_driver; /* (C) select FM sound driver */ +extern int pit_mode; /* (C) force setting PIT mode */ +extern int fm_driver; /* (C) select FM sound driver */ extern char exe_path[2048]; /* path (dir) of executable */ extern char usr_path[1024]; /* path (dir) of user data */ diff --git a/src/include/86box/bswap.h b/src/include/86box/bswap.h index 9f3c51917..ac758b20a 100644 --- a/src/include/86box/bswap.h +++ b/src/include/86box/bswap.h @@ -46,29 +46,29 @@ # define bswap_16(x) \ ( \ ((uint16_t)( \ - (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \ + (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \ (((uint16_t)(x) & (uint16_t)0xff00U) >> 8) )) \ ) # define bswap_32(x) \ ( \ ((uint32_t)( \ - (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ - (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ - (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ + (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ + (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ + (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) )) \ ) # define bswap_64(x) \ ( \ ((uint64_t)( \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \ - (uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \ + (uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \ (uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) \ ) #endif /*HAVE_BYTESWAP_H*/ diff --git a/src/include/86box/cdrom.h b/src/include/86box/cdrom.h index 25c8dd528..48f0017d4 100644 --- a/src/include/86box/cdrom.h +++ b/src/include/86box/cdrom.h @@ -191,10 +191,10 @@ typedef struct cdrom { void *image; - void (*insert)(void *p); - void (*close)(void *p); - uint32_t (*get_volume)(void *p, int channel); - uint32_t (*get_channel)(void *p, int channel); + void (*insert)(void *priv); + void (*close)(void *priv); + uint32_t (*get_volume)(void *priv, int channel); + uint32_t (*get_channel)(void *priv, int channel); int16_t cd_buffer[BUF_SIZE]; } cdrom_t; diff --git a/src/include/86box/cdrom_image_backend.h b/src/include/86box/cdrom_image_backend.h index 67129dc7c..39faf9f33 100644 --- a/src/include/86box/cdrom_image_backend.h +++ b/src/include/86box/cdrom_image_backend.h @@ -45,17 +45,17 @@ typedef struct SMSF { } TMSF; /* Track file struct. */ -typedef struct { - int (*read)(void *p, uint8_t *buffer, uint64_t seek, size_t count); - uint64_t (*get_length)(void *p); - void (*close)(void *p); +typedef struct track_file_t { + int (*read)(void *priv, uint8_t *buffer, uint64_t seek, size_t count); + uint64_t (*get_length)(void *priv); + void (*close)(void *priv); char fn[260]; - FILE *file; + FILE *fp; void *priv; } track_file_t; -typedef struct { +typedef struct track_t { int number; int track_number; int attr; @@ -70,7 +70,7 @@ typedef struct { track_file_t *file; } track_t; -typedef struct { +typedef struct cd_img_t { int tracks_num; track_t *tracks; } cd_img_t; @@ -97,9 +97,9 @@ extern int cdi_has_data_track(cd_img_t *cdi); extern int cdi_has_audio_track(cd_img_t *cdi); /* Virtual ISO functions. */ -extern int viso_read(void *p, uint8_t *buffer, uint64_t seek, size_t count); -extern uint64_t viso_get_length(void *p); -extern void viso_close(void *p); +extern int viso_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count); +extern uint64_t viso_get_length(void *priv); +extern void viso_close(void *priv); extern track_file_t *viso_init(const char *dirname, int *error); #endif /*CDROM_IMAGE_BACKEND_H*/ diff --git a/src/include/86box/cdrom_interface.h b/src/include/86box/cdrom_interface.h index 323ba9681..081f758f6 100644 --- a/src/include/86box/cdrom_interface.h +++ b/src/include/86box/cdrom_interface.h @@ -21,7 +21,7 @@ extern int cdrom_interface_current; extern void cdrom_interface_reset(void); -extern char *cdrom_interface_get_internal_name(int cdinterface); +extern const char *cdrom_interface_get_internal_name(int cdinterface); extern int cdrom_interface_get_from_internal_name(char *s); extern int cdrom_interface_has_config(int cdinterface); extern const device_t *cdrom_interface_get_device(int cdinterface); diff --git a/src/include/86box/config.h b/src/include/86box/config.h index 72b0a709f..80c987162 100644 --- a/src/include/86box/config.h +++ b/src/include/86box/config.h @@ -28,21 +28,21 @@ extern "C" { #if 0 typedef struct storage_cfg_t { - uint8_t id; - uint8_t bus_type; /* Bus type: IDE, SCSI, etc. */ - uint8_t bus, : 4; /* ID of the bus (for example, for IDE, + uint8_t id; + uint8_t bus_type; /* Bus type: IDE, SCSI, etc. */ + uint8_t bus : 4; /* ID of the bus (for example, for IDE, 0 = primary, 1 = secondary, etc. */ - uint8_t bus_id, : 4; /* ID of the device on the bus */ - uint8_t type; /* Type flags, interpretation depends - on the device */ - uint8_t is_image; /* This is only used for CD-ROM: + uint8_t bus_id : 4; /* ID of the device on the bus */ + uint8_t type; /* Type flags, interpretation depends + on the device */ + uint8_t is_image; /* This is only used for CD-ROM: 0 = Image; 1 = Host drive */ - wchar_t path[1024]; /* Name of current image file or + wchar_t path[1024]; /* Name of current image file or host drive */ - uint32_t spt; /* Physical geometry parameters */ + uint32_t spt; /* Physical geometry parameters */ uint32_t hpc; uint32_t tracks; } storage_cfg_t; diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 3019bbba8..57cf7c849 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -161,36 +161,36 @@ extern "C" { #endif extern void device_init(void); -extern void device_set_context(device_context_t *c, const device_t *d, int inst); -extern void device_context(const device_t *d); -extern void device_context_inst(const device_t *d, int inst); +extern void device_set_context(device_context_t *c, const device_t *dev, int inst); +extern void device_context(const device_t *dev); +extern void device_context_inst(const device_t *dev, int inst); extern void device_context_restore(void); extern void *device_add(const device_t *d); -extern void *device_add_parameters(const device_t *d, void *params); -extern void device_add_ex(const device_t *d, void *priv); -extern void device_add_ex_parameters(const device_t *d, void *priv, void *params); -extern void *device_add_inst(const device_t *d, int inst); -extern void *device_add_inst_parameters(const device_t *d, int inst, void *params); -extern void device_add_inst_ex(const device_t *d, void *priv, int inst); -extern void device_add_inst_ex_parameters(const device_t *d, void *priv, int inst, void *params); -extern void *device_cadd(const device_t *d, const device_t *cd); -extern void *device_cadd_parameters(const device_t *d, const device_t *cd, void *params); -extern void device_cadd_ex(const device_t *d, const device_t *cd, void *priv); -extern void device_cadd_ex_parameters(const device_t *d, const device_t *cd, void *priv, void *params); -extern void *device_cadd_inst(const device_t *d, const device_t *cd, int inst); -extern void *device_cadd_inst_parameters(const device_t *d, const device_t *cd, int inst, void *params); -extern void device_cadd_inst_ex(const device_t *d, const device_t *cd, void *priv, int inst); -extern void device_cadd_inst_ex_parameters(const device_t *d, const device_t *cd, void *priv, int inst, void *params); +extern void *device_add_parameters(const device_t *dev, void *params); +extern void device_add_ex(const device_t *dev, void *priv); +extern void device_add_ex_parameters(const device_t *dev, void *priv, void *params); +extern void *device_add_inst(const device_t *dev, int inst); +extern void *device_add_inst_parameters(const device_t *dev, int inst, void *params); +extern void device_add_inst_ex(const device_t *dev, void *priv, int inst); +extern void device_add_inst_ex_parameters(const device_t *dev, void *priv, int inst, void *params); +extern void *device_cadd(const device_t *dev, const device_t *cd); +extern void *device_cadd_parameters(const device_t *dev, const device_t *cd, void *params); +extern void device_cadd_ex(const device_t *dev, const device_t *cd, void *priv); +extern void device_cadd_ex_parameters(const device_t *dev, const device_t *cd, void *priv, void *params); +extern void *device_cadd_inst(const device_t *dev, const device_t *cd, int inst); +extern void *device_cadd_inst_parameters(const device_t *dev, const device_t *cd, int inst, void *params); +extern void device_cadd_inst_ex(const device_t *dev, const device_t *cd, void *priv, int inst); +extern void device_cadd_inst_ex_parameters(const device_t *dev, const device_t *cd, void *priv, int inst, void *params); extern void device_close_all(void); extern void device_reset_all(uint32_t match_flags); -extern void *device_get_priv(const device_t *d); -extern int device_available(const device_t *d); -extern int device_poll(const device_t *d); +extern void *device_get_priv(const device_t *dev); +extern int device_available(const device_t *dev); +extern int device_poll(const device_t *dev); extern void device_speed_changed(void); extern void device_force_redraw(void); -extern void device_get_name(const device_t *d, int bus, char *name); -extern int device_has_config(const device_t *d); -extern const char *device_get_bios_file(const device_t *d, const char *internal_name, int file_no); +extern void device_get_name(const device_t *dev, int bus, char *name); +extern int device_has_config(const device_t *dev); +extern const char *device_get_bios_file(const device_t *dev, const char *internal_name, int file_no); extern int device_is_valid(const device_t *, int m); @@ -207,7 +207,7 @@ extern const char *device_get_config_string(const char *name); extern const int device_get_instance(void); #define device_get_config_bios device_get_config_string -extern char *device_get_internal_name(const device_t *d); +extern const char *device_get_internal_name(const device_t *dev); extern int machine_get_config_int(char *s); extern char *machine_get_config_string(char *s); diff --git a/src/include/86box/fdc_ext.h b/src/include/86box/fdc_ext.h index 106235658..0d821ac11 100644 --- a/src/include/86box/fdc_ext.h +++ b/src/include/86box/fdc_ext.h @@ -35,7 +35,7 @@ extern const device_t fdc_monster_device; extern void fdc_card_init(void); -extern char *fdc_card_get_internal_name(int card); +extern const char *fdc_card_get_internal_name(int card); extern int fdc_card_get_from_internal_name(char *s); extern const device_t *fdc_card_getdevice(int card); extern int fdc_card_has_config(int card); diff --git a/src/include/86box/fdd.h b/src/include/86box/fdd.h index e21cbb73e..0331f4fcc 100644 --- a/src/include/86box/fdd.h +++ b/src/include/86box/fdd.h @@ -136,7 +136,7 @@ typedef union { void fdd_calccrc(uint8_t byte, crc_t *crc_var); -typedef struct { +typedef struct d86f_handler_t { uint16_t (*disk_flags)(int drive); uint16_t (*side_flags)(int drive); void (*writeback)(int drive); @@ -162,7 +162,7 @@ extern const uint8_t xdf_physical_sectors[2][2]; extern const uint8_t xdf_gap3_sizes[2][2]; extern const uint16_t xdf_trackx_spos[2][8]; -typedef struct { +typedef struct xdf_id_t { uint8_t h; uint8_t r; } xdf_id_t; @@ -175,14 +175,14 @@ typedef union { extern const xdf_sector_t xdf_img_layout[2][2][46]; extern const xdf_sector_t xdf_disk_layout[2][2][38]; -typedef struct { +typedef struct sector_id_fields_t { uint8_t c; uint8_t h; uint8_t r; uint8_t n; } sector_id_fields_t; -typedef union { +typedef union sector_id_t { uint32_t dword; uint8_t byte_array[4]; sector_id_fields_t id; diff --git a/src/include/86box/fifo.h b/src/include/86box/fifo.h index 71a40b0ce..e76189d8a 100644 --- a/src/include/86box/fifo.h +++ b/src/include/86box/fifo.h @@ -12,24 +12,29 @@ * * Copyright 2023 Miran Grca. */ -#define FIFO(size) \ - typedef struct \ - { \ - int start, end, \ - trigger_len, len, \ - empty, overrun, \ - full, ready, \ - d_empty, d_overrun, \ - d_full, d_ready; \ - \ - void *priv; \ - \ - void (*d_empty_evt)(void *); \ - void (*d_overrun_evt)(void *); \ - void (*d_full_evt)(void *); \ - void (*d_ready_evt)(void *); \ - \ - uint8_t buf[size]; \ +#define FIFO(size) \ + typedef struct { \ + int start; \ + int end; \ + int trigger_len; \ + int len; \ + int empty; \ + int overrun; \ + int full; \ + int ready; \ + int d_empty; \ + int d_overrun; \ + int d_full; \ + int d_ready; \ + \ + void *priv; \ + \ + void (*d_empty_evt)(void *); \ + void (*d_overrun_evt)(void *); \ + void (*d_full_evt)(void *); \ + void (*d_ready_evt)(void *); \ + \ + uint8_t buf[size]; \ } fifo## size ##_t; FIFO() @@ -65,4 +70,4 @@ extern void fifo_set_priv(void *priv, void *sub_priv); extern void fifo_reset(void *priv); extern void fifo_reset_evt(void *priv); extern void fifo_close(void *priv); -extern void * fifo_init(int len); +extern void *fifo_init(int len); diff --git a/src/include/86box/hdc.h b/src/include/86box/hdc.h index 64fd88659..8ede3e786 100644 --- a/src/include/86box/hdc.h +++ b/src/include/86box/hdc.h @@ -95,7 +95,7 @@ extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */ extern void hdc_init(void); extern void hdc_reset(void); -extern char *hdc_get_internal_name(int hdc); +extern const char *hdc_get_internal_name(int hdc); extern int hdc_get_from_internal_name(char *s); extern int hdc_has_config(int hdc); extern const device_t *hdc_get_device(int hdc); diff --git a/src/include/86box/hdc_ide.h b/src/include/86box/hdc_ide.h index 8a4c66da3..8bac5cf8b 100644 --- a/src/include/86box/hdc_ide.h +++ b/src/include/86box/hdc_ide.h @@ -85,15 +85,15 @@ typedef struct ide_s { int interrupt_drq; double pending_delay; - int (*get_max)(int ide_has_dma, int type); - int (*get_timings)(int ide_has_dma, int type); - void (*identify)(struct ide_s *ide, int ide_has_dma); - void (*stop)(scsi_common_t *sc); - void (*packet_command)(scsi_common_t *sc, uint8_t *cdb); - void (*device_reset)(scsi_common_t *sc); + int (*get_max)(int ide_has_dma, int type); + int (*get_timings)(int ide_has_dma, int type); + void (*identify)(struct ide_s *ide, int ide_has_dma); + void (*stop)(scsi_common_t *sc); + void (*packet_command)(scsi_common_t *sc, uint8_t *cdb); + void (*device_reset)(scsi_common_t *sc); uint8_t (*phase_data_out)(scsi_common_t *sc); - void (*command_stop)(scsi_common_t *sc); - void (*bus_master_error)(scsi_common_t *sc); + void (*command_stop)(scsi_common_t *sc); + void (*bus_master_error)(scsi_common_t *sc); } ide_t; extern ide_t *ide_drives[IDE_NUM]; @@ -180,9 +180,9 @@ extern void ide_set_board_callback(uint8_t board, double callback); extern void ide_padstr(char *str, const char *src, int len); extern void ide_padstr8(uint8_t *buf, int buf_size, const char *src); -extern int (*ide_bus_master_dma)(int channel, uint8_t *data, int transfer_length, int out, void *priv); +extern int (*ide_bus_master_dma)(int channel, uint8_t *data, int transfer_length, int out, void *priv); extern void (*ide_bus_master_set_irq)(int channel, void *priv); -extern void *ide_bus_master_priv[2]; +extern void *ide_bus_master_priv[2]; extern uint8_t ide_read_ali_75(void); extern uint8_t ide_read_ali_76(void); diff --git a/src/include/86box/i8080.h b/src/include/86box/i8080.h index b5ba3c7a4..9a25b5d1b 100644 --- a/src/include/86box/i8080.h +++ b/src/include/86box/i8080.h @@ -51,14 +51,14 @@ typedef struct i8080 { uint16_t oldpc; uint16_t ei; uint32_t pmembase; - uint32_t dmembase; /* Base from where i8080 starts. */ + uint32_t dmembase; /* Base from where i8080 starts. */ uint8_t emulated; /* 0 = not emulated, use separate registers, 1 = emulated, use x86 registers. */ uint16_t *cpu_flags; - void (*writemembyte)(uint32_t, uint8_t); + void (*writemembyte)(uint32_t, uint8_t); uint8_t (*readmembyte)(uint32_t); - void (*startclock)(void); - void (*endclock)(void); - void (*checkinterrupts)(void); + void (*startclock)(void); + void (*endclock)(void); + void (*checkinterrupts)(void); uint8_t (*fetchinstruction)(void *); } i8080; diff --git a/src/include/86box/isartc.h b/src/include/86box/isartc.h index d619d3052..92c58e350 100644 --- a/src/include/86box/isartc.h +++ b/src/include/86box/isartc.h @@ -55,7 +55,7 @@ extern "C" { /* Functions. */ extern void isartc_reset(void); -extern char *isartc_get_internal_name(int t); +extern const char *isartc_get_internal_name(int t); extern int isartc_get_from_internal_name(char *s); extern const device_t *isartc_get_device(int t); diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index b84733d9c..0a2a038ec 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -47,7 +47,7 @@ typedef struct kbc_at_port_t { void *priv; - void (*poll)(void *priv); + void (*poll)(void *priv); } kbc_at_port_t; /* Used by the AT / PS/2 common device, keyboard, and mouse. */ diff --git a/src/include/86box/lpt.h b/src/include/86box/lpt.h index 51def0536..a9a9eac65 100644 --- a/src/include/86box/lpt.h +++ b/src/include/86box/lpt.h @@ -21,13 +21,13 @@ typedef struct lpt_device_t { const char *name; const char *internal_name; - void *(*init)(void *lpt); - void (*close)(void *p); - void (*write_data)(uint8_t val, void *p); - void (*write_ctrl)(uint8_t val, void *p); - uint8_t (*read_data)(void *p); - uint8_t (*read_status)(void *p); - uint8_t (*read_ctrl)(void *p); + void *(*init)(void *lpt); + void (*close)(void *priv); + void (*write_data)(uint8_t val, void *priv); + void (*write_ctrl)(uint8_t val, void *priv); + uint8_t (*read_data)(void *priv); + uint8_t (*read_status)(void *priv); + uint8_t (*read_ctrl)(void *priv); } lpt_device_t; extern void lpt_init(void); @@ -65,7 +65,7 @@ extern void lpt1_remove_ams(void); void lpt_devices_init(void); void lpt_devices_close(void); -typedef struct { +typedef struct lpt_port_t { uint8_t enabled; uint8_t irq; uint8_t dat; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 1a9b424dc..5cc83ef1c 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -288,16 +288,17 @@ typedef struct _machine_cpu_ { } machine_cpu_t; typedef struct _machine_memory_ { - uint32_t min, max; + uint32_t min; + uint32_t max; int step; } machine_memory_t; typedef struct _machine_ { - const char *name; - const char *internal_name; - uint32_t type; - uintptr_t chipset; - int (*init)(const struct _machine_ *); + const char *name; + const char *internal_name; + uint32_t type; + uintptr_t chipset; + int (*init)(const struct _machine_ *); uintptr_t pad; uintptr_t pad0; uintptr_t pad1; @@ -339,18 +340,18 @@ typedef struct _machine_ { /* Global variables. */ extern const machine_filter_t machine_types[]; extern const machine_filter_t machine_chipsets[]; -extern const machine_t machines[]; -extern int bios_only; -extern int machine; +extern const machine_t machines[]; +extern int bios_only; +extern int machine; /* Core functions. */ -extern int machine_count(void); -extern int machine_available(int m); -extern char *machine_getname(void); -extern char *machine_getname_ex(int m); -extern char *machine_get_internal_name(void); -extern int machine_get_machine_from_internal_name(char *s); -extern void machine_init(void); +extern int machine_count(void); +extern int machine_available(int m); +extern const char *machine_getname(void); +extern const char *machine_getname_ex(int m); +extern const char *machine_get_internal_name(void); +extern int machine_get_machine_from_internal_name(const char *s); +extern void machine_init(void); #ifdef EMU_DEVICE_H extern const device_t *machine_get_kbc_device(int m); extern const device_t *machine_get_device(int m); @@ -360,18 +361,18 @@ extern const device_t *machine_get_vid_device(int m); extern const device_t *machine_get_snd_device(int m); extern const device_t *machine_get_net_device(int m); #endif -extern char *machine_get_internal_name_ex(int m); -extern int machine_get_nvrmask(int m); -extern int machine_has_flags(int m, int flags); -extern int machine_has_bus(int m, int bus_flags); -extern int machine_has_cartridge(int m); -extern int machine_get_min_ram(int m); -extern int machine_get_max_ram(int m); -extern int machine_get_ram_granularity(int m); -extern int machine_get_type(int m); -extern void machine_close(void); -extern int machine_has_mouse(void); -extern int machine_is_sony(void); +extern const char *machine_get_internal_name_ex(int m); +extern int machine_get_nvrmask(int m); +extern int machine_has_flags(int m, int flags); +extern int machine_has_bus(int m, int bus_flags); +extern int machine_has_cartridge(int m); +extern int machine_get_min_ram(int m); +extern int machine_get_max_ram(int m); +extern int machine_get_ram_granularity(int m); +extern int machine_get_type(int m); +extern void machine_close(void); +extern int machine_has_mouse(void); +extern int machine_is_sony(void); extern uint8_t machine_get_p1(void); extern void machine_load_p1(int m); diff --git a/src/include/86box/midi.h b/src/include/86box/midi.h index af7fd217d..97ed1f6ca 100644 --- a/src/include/86box/midi.h +++ b/src/include/86box/midi.h @@ -9,8 +9,8 @@ extern uint8_t MIDI_evt_len[256]; extern int midi_output_device_current; extern int midi_input_device_current; -extern void (*input_msg)(void *p, uint8_t *msg, uint32_t len); -extern int (*input_sysex)(void *p, uint8_t *buf, uint32_t len, int abort); +extern void (*input_msg)(void *priv, uint8_t *msg, uint32_t len); +extern int (*input_sysex)(void *priv, uint8_t *buf, uint32_t len, int abort); extern void *midi_in_p; extern int midi_out_device_available(int card); @@ -19,14 +19,14 @@ extern int midi_in_device_available(int card); const device_t *midi_out_device_getdevice(int card); const device_t *midi_in_device_getdevice(int card); #endif -extern int midi_out_device_has_config(int card); -extern int midi_in_device_has_config(int card); -extern char *midi_out_device_get_internal_name(int card); -extern char *midi_in_device_get_internal_name(int card); -extern int midi_out_device_get_from_internal_name(char *s); -extern int midi_in_device_get_from_internal_name(char *s); -extern void midi_out_device_init(void); -extern void midi_in_device_init(void); +extern int midi_out_device_has_config(int card); +extern int midi_in_device_has_config(int card); +extern const char *midi_out_device_get_internal_name(int card); +extern const char *midi_in_device_get_internal_name(int card); +extern int midi_out_device_get_from_internal_name(char *s); +extern int midi_in_device_get_from_internal_name(char *s); +extern void midi_out_device_init(void); +extern void midi_in_device_init(void); typedef struct midi_device_t { void (*play_sysex)(uint8_t *sysex, unsigned int len); @@ -78,7 +78,7 @@ extern void midi_raw_out_byte(uint8_t val); extern void midi_clear_buffer(void); extern void midi_poll(void); -extern void midi_in_handler(int set, void (*msg)(void *p, uint8_t *msg, uint32_t len), int (*sysex)(void *p, uint8_t *buffer, uint32_t len, int abort), void *priv); +extern void midi_in_handler(int set, void (*msg)(void *priv, uint8_t *msg, uint32_t len), int (*sysex)(void *priv, uint8_t *buffer, uint32_t len, int abort), void *priv); extern void midi_in_handlers_clear(void); extern void midi_in_msg(uint8_t *msg, uint32_t len); extern void midi_in_sysex(uint8_t *buffer, uint32_t len); diff --git a/src/include/86box/mo.h b/src/include/86box/mo.h index 99b985635..910c7eaed 100644 --- a/src/include/86box/mo.h +++ b/src/include/86box/mo.h @@ -27,7 +27,7 @@ #define MO_TIME 10.0 -#define MO_IMAGE_HISTORY 4 +#define MO_IMAGE_HISTORY 4 typedef struct mo_type_t { uint32_t sectors; @@ -109,7 +109,7 @@ typedef struct mo_drive_t { uint8_t pad; uint8_t pad0; - FILE *f; + FILE *fp; void *priv; char image_path[1024]; diff --git a/src/include/86box/mouse.h b/src/include/86box/mouse.h index 5fa29b1a7..b762810e0 100644 --- a/src/include/86box/mouse.h +++ b/src/include/86box/mouse.h @@ -103,8 +103,8 @@ extern void mouse_get_abs_coords(double *x_abs, double *y_abs); extern void mouse_process(void); extern void mouse_set_poll_ex(void (*poll_ex)(void)); extern void mouse_set_poll(int (*f)(void *), void *); -extern char * mouse_get_name(int mouse); -extern char * mouse_get_internal_name(int mouse); +extern const char * mouse_get_name(int mouse); +extern const char * mouse_get_internal_name(int mouse); extern int mouse_get_from_internal_name(char *s); extern int mouse_has_config(int mouse); #ifdef EMU_DEVICE_H diff --git a/src/include/86box/network.h b/src/include/86box/network.h index d7958ee9a..5899e80c3 100644 --- a/src/include/86box/network.h +++ b/src/include/86box/network.h @@ -194,7 +194,7 @@ extern int network_dev_available(int); extern int network_dev_to_id(char *); extern int network_card_available(int); extern int network_card_has_config(int); -extern char *network_card_get_internal_name(int); +extern const char *network_card_get_internal_name(int); extern int network_card_get_from_internal_name(char *); extern const device_t *network_card_getdevice(int); diff --git a/src/include/86box/nmi.h b/src/include/86box/nmi.h index 319d63b6b..79aa68346 100644 --- a/src/include/86box/nmi.h +++ b/src/include/86box/nmi.h @@ -11,6 +11,6 @@ extern int nmi_auto_clear; extern void nmi_init(void); -extern void nmi_write(uint16_t port, uint8_t val, void *p); +extern void nmi_write(uint16_t port, uint8_t val, void *priv); #endif /*EMU_NMI_H*/ diff --git a/src/include/86box/plat_serial_passthrough.h b/src/include/86box/plat_serial_passthrough.h index e9df0584e..60674ea58 100644 --- a/src/include/86box/plat_serial_passthrough.h +++ b/src/include/86box/plat_serial_passthrough.h @@ -25,11 +25,11 @@ extern "C" { #endif -extern void plat_serpt_write(void *p, uint8_t data); -extern int plat_serpt_read(void *p, uint8_t *data); -extern int plat_serpt_open_device(void *p); -extern void plat_serpt_close(void *p); -extern void plat_serpt_set_params(void *p); +extern void plat_serpt_write(void *priv, uint8_t data); +extern int plat_serpt_read(void *priv, uint8_t *data); +extern int plat_serpt_open_device(void *priv); +extern void plat_serpt_close(void *priv); +extern void plat_serpt_set_params(void *priv); #ifdef __cplusplus } diff --git a/src/include/86box/rom.h b/src/include/86box/rom.h index e4c50ac01..1f6e611b1 100644 --- a/src/include/86box/rom.h +++ b/src/include/86box/rom.h @@ -48,9 +48,9 @@ extern rom_path_t rom_paths; extern void rom_add_path(const char *path); -extern uint8_t rom_read(uint32_t addr, void *p); -extern uint16_t rom_readw(uint32_t addr, void *p); -extern uint32_t rom_readl(uint32_t addr, void *p); +extern uint8_t rom_read(uint32_t addr, void *priv); +extern uint16_t rom_readw(uint32_t addr, void *priv); +extern uint32_t rom_readl(uint32_t addr, void *priv); extern FILE *rom_fopen(const char *fn, char *mode); extern int rom_getfile(char *fn, char *s, int size); diff --git a/src/include/86box/row.h b/src/include/86box/row.h index d873e6fba..a70c94274 100644 --- a/src/include/86box/row.h +++ b/src/include/86box/row.h @@ -18,8 +18,7 @@ #ifndef EMU_ROW_H # define EMU_ROW_H -typedef struct _row_ -{ +typedef struct _row_ { struct _smram_ *prev; struct _smram_ *next; @@ -35,12 +34,9 @@ typedef struct _row_ uint32_t boundary; } row_t; - extern void row_disable(uint8_t row_id); extern void row_set_boundary(uint8_t row_id, uint32_t boundary); - extern device_t row_device; - #endif /*EMU_ROW_H*/ diff --git a/src/include/86box/scsi.h b/src/include/86box/scsi.h index d19497101..376ac79b9 100644 --- a/src/include/86box/scsi.h +++ b/src/include/86box/scsi.h @@ -33,9 +33,9 @@ extern int scsi_card_available(int card); #ifdef EMU_DEVICE_H extern const device_t *scsi_card_getdevice(int card); #endif -extern int scsi_card_has_config(int card); -extern char *scsi_card_get_internal_name(int card); -extern int scsi_card_get_from_internal_name(char *s); -extern void scsi_card_init(void); +extern int scsi_card_has_config(int card); +extern const char *scsi_card_get_internal_name(int card); +extern int scsi_card_get_from_internal_name(char *s); +extern void scsi_card_init(void); #endif /*EMU_SCSI_H*/ diff --git a/src/include/86box/scsi_aha154x.h b/src/include/86box/scsi_aha154x.h index 3c8265391..800d2d72b 100644 --- a/src/include/86box/scsi_aha154x.h +++ b/src/include/86box/scsi_aha154x.h @@ -8,6 +8,6 @@ extern const device_t aha154xcf_device; extern const device_t aha154xcp_device; extern const device_t aha1640_device; -extern void aha_device_reset(void *p); +extern void aha_device_reset(void *priv); #endif /*SCSI_AHA154X_H*/ diff --git a/src/include/86box/scsi_buslogic.h b/src/include/86box/scsi_buslogic.h index 12bff6fdf..6de69e700 100644 --- a/src/include/86box/scsi_buslogic.h +++ b/src/include/86box/scsi_buslogic.h @@ -29,6 +29,6 @@ extern const device_t buslogic_445s_device; extern const device_t buslogic_445c_device; extern const device_t buslogic_958d_pci_device; -extern void BuslogicDeviceReset(void *p); +extern void BuslogicDeviceReset(void *priv); #endif /*SCSI_BUSLOGIC_H*/ diff --git a/src/include/86box/scsi_cdrom.h b/src/include/86box/scsi_cdrom.h index 64c24c10e..35a4676e7 100644 --- a/src/include/86box/scsi_cdrom.h +++ b/src/include/86box/scsi_cdrom.h @@ -63,7 +63,7 @@ typedef struct scsi_cdrom_t { mode_sense_pages_t ms_pages_saved_sony; mode_sense_pages_t ms_drive_status_pages_saved; - int sony_vendor; + int sony_vendor; } scsi_cdrom_t; #endif diff --git a/src/include/86box/scsi_device.h b/src/include/86box/scsi_device.h index 7256970cd..2b07e6354 100644 --- a/src/include/86box/scsi_device.h +++ b/src/include/86box/scsi_device.h @@ -347,7 +347,7 @@ typedef struct mode_sense_pages_t { typedef struct scsi_common_s { mode_sense_pages_t ms_pages_saved; - void *p; + void *priv; uint8_t *temp_buffer; uint8_t atapi_cdb[16]; /* This is atapi_cdb in ATAPI-supporting devices, @@ -393,11 +393,11 @@ typedef struct scsi_device_t { scsi_common_t *sc; - void (*command)(scsi_common_t *sc, uint8_t *cdb); - void (*request_sense)(scsi_common_t *sc, uint8_t *buffer, uint8_t alloc_length); - void (*reset)(scsi_common_t *sc); + void (*command)(scsi_common_t *sc, uint8_t *cdb); + void (*request_sense)(scsi_common_t *sc, uint8_t *buffer, uint8_t alloc_length); + void (*reset)(scsi_common_t *sc); uint8_t (*phase_data_out)(scsi_common_t *sc); - void (*command_stop)(scsi_common_t *sc); + void (*command_stop)(scsi_common_t *sc); } scsi_device_t; /* These are based on the INQUIRY values. */ diff --git a/src/include/86box/scsi_disk.h b/src/include/86box/scsi_disk.h index ebf21c073..280899ade 100644 --- a/src/include/86box/scsi_disk.h +++ b/src/include/86box/scsi_disk.h @@ -22,10 +22,10 @@ typedef struct scsi_disk_t { hard_disk_t *drv; uint8_t *temp_buffer; - uint8_t pad[16]; /* This is atapi_cdb in ATAPI-supporting devices, + uint8_t pad[16]; /* This is atapi_cdb in ATAPI-supporting devices, and pad in SCSI-only devices. */ - uint8_t current_cdb[16]; - uint8_t sense[256]; + uint8_t current_cdb[16]; + uint8_t sense[256]; uint8_t status; uint8_t phase; diff --git a/src/include/86box/scsi_x54x.h b/src/include/86box/scsi_x54x.h index a7065b163..22d4b35e4 100644 --- a/src/include/86box/scsi_x54x.h +++ b/src/include/86box/scsi_x54x.h @@ -256,11 +256,11 @@ typedef struct Mailbox32_t { Bytes 18 through 18+n-1, where n=size of CDB Command Descriptor Block */ typedef struct CCB32_t { - uint8_t Opcode; - uint8_t Reserved1 : 3, - ControlByte : 2, - TagQueued : 1, - QueueTag : 2; + uint8_t Opcode; + uint8_t Reserved1 : 3; + uint8_t ControlByte : 2; + uint8_t TagQueued : 1; + uint8_t QueueTag : 2; uint8_t CdbLength; uint8_t RequestSenseLength; uint32_t DataLength; @@ -269,9 +269,9 @@ typedef struct CCB32_t { uint8_t HostStatus; uint8_t TargetStatus; uint8_t Id; - uint8_t Lun : 5, - LegacyTagEnable : 1, - LegacyQueueTag : 2; + uint8_t Lun : 5; + uint8_t LegacyTagEnable : 1; + uint8_t LegacyQueueTag : 2; uint8_t Cdb[12]; uint8_t Reserved3[6]; uint32_t SensePointer; @@ -296,9 +296,9 @@ typedef struct CCB_t { typedef struct CCBC_t { uint8_t Opcode; - uint8_t Pad1 : 3, - ControlByte : 2, - Pad2 : 3; + uint8_t Pad1 : 3; + uint8_t ControlByte : 2; + uint8_t Pad2 : 3; uint8_t CdbLength; uint8_t RequestSenseLength; uint8_t Pad3[9]; @@ -311,8 +311,8 @@ typedef struct CCBC_t { typedef union CCBU_t { CCB32 new; - CCB old; - CCBC common; + CCB old; + CCBC common; } CCBU; typedef struct { @@ -329,9 +329,9 @@ typedef struct { typedef struct BIOSCMD_t { uint8_t command; - uint8_t lun : 3, - reserved : 2, - id : 3; + uint8_t lun : 3; + uint8_t reserved : 2; + uint8_t id : 3; union { struct chs_t { uint16_t cyl; @@ -345,7 +345,7 @@ typedef struct BIOSCMD_t { uint8_t lba3; /* LSB */ } lba; } u; - uint8_t secount; + uint8_t secount; addr24_t dma_address; } BIOSCMD; @@ -379,7 +379,7 @@ typedef struct x54x_t { int8_t DmaChannel; int8_t HostID; - uint8_t callback_phase : 4; + uint8_t callback_phase : 4; uint8_t callback_sub_phase : 4; uint8_t scsi_cmd_phase; uint8_t bus; @@ -482,31 +482,31 @@ typedef struct x54x_t { void *ven_data; /* Pointer to a function that performs vendor-specific operation during the timer callback */ - void (*ven_callback)(void *p); + void (*ven_callback)(void *priv); /* Pointer to a function that executes the second parameter phase of the vendor-specific command */ - void (*ven_cmd_phase1)(void *p); + void (*ven_cmd_phase1)(void *priv); /* Pointer to a function that gets the host adapter ID in case it has to be read from a non-standard location */ - uint8_t (*ven_get_host_id)(void *p); + uint8_t (*ven_get_host_id)(void *priv); /* Pointer to a function that updates the IRQ in the vendor-specific space */ - uint8_t (*ven_get_irq)(void *p); + uint8_t (*ven_get_irq)(void *priv); /* Pointer to a function that updates the DMA channel in the vendor-specific space */ - uint8_t (*ven_get_dma)(void *p); + uint8_t (*ven_get_dma)(void *priv); /* Pointer to a function that returns whether command is fast */ - uint8_t (*ven_cmd_is_fast)(void *p); + uint8_t (*ven_cmd_is_fast)(void *priv); /* Pointer to a function that executes vendor-specific fast path commands */ - uint8_t (*ven_fast_cmds)(void *p, uint8_t cmd); + uint8_t (*ven_fast_cmds)(void *priv, uint8_t cmd); /* Pointer to a function that gets the parameter length for vendor-specific commands */ - uint8_t (*get_ven_param_len)(void *p); + uint8_t (*get_ven_param_len)(void *priv); /* Pointer to a function that executes vendor-specific commands and returns whether or not to suppress the IRQ */ - uint8_t (*ven_cmds)(void *p); + uint8_t (*ven_cmds)(void *priv); /* Pointer to a function that fills in the vendor-specific setup data */ - void (*get_ven_data)(void *p); + void (*get_ven_data)(void *priv); /* Pointer to a function that determines if the mode is aggressive */ - uint8_t (*is_aggressive_mode)(void *p); + uint8_t (*is_aggressive_mode)(void *priv); /* Pointer to a function that returns interrupt type (0 = edge, 1 = level) */ - uint8_t (*interrupt_type)(void *p); + uint8_t (*interrupt_type)(void *priv); /* Pointer to a function that resets vendor-specific data */ - void (*ven_reset)(void *p); + void (*ven_reset)(void *priv); rom_t bios; /* BIOS memory descriptor */ rom_t uppersck; /* BIOS memory descriptor */ diff --git a/src/include/86box/serial.h b/src/include/86box/serial.h index 724f2f90f..bd7e85a91 100644 --- a/src/include/86box/serial.h +++ b/src/include/86box/serial.h @@ -91,10 +91,10 @@ typedef struct serial_s { } serial_t; typedef struct serial_device_s { - void (*rcr_callback)(struct serial_s *serial, void *p); - void (*dev_write)(struct serial_s *serial, void *p, uint8_t data); - void (*lcr_callback)(struct serial_s *serial, void *p, uint8_t lcr); - void (*transmit_period_callback)(struct serial_s *serial, void *p, double transmit_period); + void (*rcr_callback)(struct serial_s *serial, void *priv); + void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data); + void (*lcr_callback)(struct serial_s *serial, void *priv, uint8_t lcr); + void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period); void *priv; serial_t *serial; } serial_device_t; @@ -106,10 +106,10 @@ typedef struct serial_port_s { extern serial_port_t com_ports[SERIAL_MAX]; extern serial_t *serial_attach_ex(int port, - void (*rcr_callback)(struct serial_s *serial, void *p), - void (*dev_write)(struct serial_s *serial, void *p, uint8_t data), - void (*transmit_period_callback)(struct serial_s *serial, void *p, double transmit_period), - void (*lcr_callback)(struct serial_s *serial, void *p, uint8_t data_bits), + void (*rcr_callback)(struct serial_s *serial, void *priv), + void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data), + void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period), + void (*lcr_callback)(struct serial_s *serial, void *priv, uint8_t data_bits), void *priv); #define serial_attach(port, rcr_callback, dev_write, priv) \ diff --git a/src/include/86box/snd_ad1848.h b/src/include/86box/snd_ad1848.h index be7831fb4..6bdd2bf40 100644 --- a/src/include/86box/snd_ad1848.h +++ b/src/include/86box/snd_ad1848.h @@ -67,8 +67,8 @@ typedef struct ad1848_t { int16_t buffer[SOUNDBUFLEN * 2]; int pos; - void *cram_priv, - (*cram_write)(uint16_t addr, uint8_t val, void *priv); + void *cram_priv; + void (*cram_write)(uint16_t addr, uint8_t val, void *priv); uint8_t (*cram_read)(uint16_t addr, void *priv); } ad1848_t; diff --git a/src/include/86box/snd_azt2316a.h b/src/include/86box/snd_azt2316a.h index 63a0ff243..8aae3f1ff 100644 --- a/src/include/86box/snd_azt2316a.h +++ b/src/include/86box/snd_azt2316a.h @@ -1,6 +1,6 @@ #ifndef SOUND_AZT2316A_H #define SOUND_AZT2316A_H -extern void azt2316a_enable_wss(uint8_t enable, void *p); +extern void azt2316a_enable_wss(uint8_t enable, void *priv); #endif /*SOUND_AZT2316A*/ diff --git a/src/include/86box/snd_cms.h b/src/include/86box/snd_cms.h index 0da6fcdab..8eec22935 100644 --- a/src/include/86box/snd_cms.h +++ b/src/include/86box/snd_cms.h @@ -27,7 +27,7 @@ typedef struct cms_t { } cms_t; extern void cms_update(cms_t *cms); -extern void cms_write(uint16_t addr, uint8_t val, void *p); -extern uint8_t cms_read(uint16_t addr, void *p); +extern void cms_write(uint16_t addr, uint8_t val, void *priv); +extern uint8_t cms_read(uint16_t addr, void *priv); #endif /*SOUND_CMS_H*/ diff --git a/src/include/86box/snd_mpu401.h b/src/include/86box/snd_mpu401.h index ed8b89de7..8cd275af8 100644 --- a/src/include/86box/snd_mpu401.h +++ b/src/include/86box/snd_mpu401.h @@ -177,9 +177,9 @@ typedef struct mpu_t { pc_timer_t mpu401_event_callback; pc_timer_t mpu401_eoi_callback; pc_timer_t mpu401_reset_callback; - void (*ext_irq_update)(void *priv, int set); - int (*ext_irq_pending)(void *priv); - void *priv; + void (*ext_irq_update)(void *priv, int set); + int (*ext_irq_pending)(void *priv); + void *priv; } mpu_t; extern int mpu401_standalone_enable; @@ -197,7 +197,7 @@ extern void mpu401_init(mpu_t *mpu, uint16_t addr, int irq, int mode, int rec extern void mpu401_device_add(void); extern void mpu401_irq_attach(mpu_t *mpu, void (*ext_irq_update)(void *priv, int set), int (*ext_irq_pending)(void *priv), void *priv); -extern int MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort); -extern void MPU401_InputMsg(void *p, uint8_t *msg, uint32_t len); +extern int MPU401_InputSysex(void *priv, uint8_t *buffer, uint32_t len, int abort); +extern void MPU401_InputMsg(void *priv, uint8_t *msg, uint32_t len); #endif /*SOUND_MPU401_H*/ diff --git a/src/include/86box/snd_opl.h b/src/include/86box/snd_opl.h index 3a3f93ad5..e516b95f9 100644 --- a/src/include/86box/snd_opl.h +++ b/src/include/86box/snd_opl.h @@ -32,12 +32,12 @@ enum fm_driver { }; typedef struct fm_drv_t { - uint8_t (*read)(uint16_t port, void *priv); - void (*write)(uint16_t port, uint8_t val, void *priv); + uint8_t (*read)(uint16_t port, void *priv); + void (*write)(uint16_t port, uint8_t val, void *priv); int32_t *(*update)(void *priv); - void (*reset_buffer)(void *priv); - void (*set_do_cycles)(void *priv, int8_t do_cycles); - void *priv; + void (*reset_buffer)(void *priv); + void (*set_do_cycles)(void *priv, int8_t do_cycles); + void *priv; } fm_drv_t; extern uint8_t fm_driver_get(int chip_id, fm_drv_t *drv); diff --git a/src/include/86box/snd_resid.h b/src/include/86box/snd_resid.h index 710ff4a61..4ddaf9b91 100644 --- a/src/include/86box/snd_resid.h +++ b/src/include/86box/snd_resid.h @@ -5,11 +5,11 @@ extern "C" { #endif void *sid_init(void); -void sid_close(void *p); -void sid_reset(void *p); -uint8_t sid_read(uint16_t addr, void *p); -void sid_write(uint16_t addr, uint8_t val, void *p); -void sid_fillbuf(int16_t *buf, int len, void *p); +void sid_close(void *priv); +void sid_reset(void *priv); +uint8_t sid_read(uint16_t addr, void *priv); +void sid_write(uint16_t addr, uint8_t val, void *priv); +void sid_fillbuf(int16_t *buf, int len, void *priv); #ifdef __cplusplus } #endif diff --git a/src/include/86box/snd_sb.h b/src/include/86box/snd_sb.h index 4c6b2bba7..bc8b09b15 100644 --- a/src/include/86box/snd_sb.h +++ b/src/include/86box/snd_sb.h @@ -152,18 +152,18 @@ typedef struct sb_t { void (*opl_mix)(void*, double*, double*); } sb_t; -extern void sb_ct1345_mixer_write(uint16_t addr, uint8_t val, void *p); -extern uint8_t sb_ct1345_mixer_read(uint16_t addr, void *p); +extern void sb_ct1345_mixer_write(uint16_t addr, uint8_t val, void *priv); +extern uint8_t sb_ct1345_mixer_read(uint16_t addr, void *priv); extern void sb_ct1345_mixer_reset(sb_t *sb); -extern void sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *p); -extern uint8_t sb_ct1745_mixer_read(uint16_t addr, void *p); +extern void sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv); +extern uint8_t sb_ct1745_mixer_read(uint16_t addr, void *priv); extern void sb_ct1745_mixer_reset(sb_t *sb); -extern void sb_get_buffer_sbpro(int32_t *buffer, int len, void *p); -extern void sbpro_filter_cd_audio(int channel, double *buffer, void *p); -extern void sb16_awe32_filter_cd_audio(int channel, double *buffer, void *p); -extern void sb_close(void *p); -extern void sb_speed_changed(void *p); +extern void sb_get_buffer_sbpro(int32_t *buffer, int len, void *priv); +extern void sbpro_filter_cd_audio(int channel, double *buffer, void *priv); +extern void sb16_awe32_filter_cd_audio(int channel, double *buffer, void *priv); +extern void sb_close(void *priv); +extern void sb_speed_changed(void *priv); #endif /*SOUND_SND_SB_H*/ diff --git a/src/include/86box/snd_sb_dsp.h b/src/include/86box/snd_sb_dsp.h index 86f1ee529..f106942ff 100644 --- a/src/include/86box/snd_sb_dsp.h +++ b/src/include/86box/snd_sb_dsp.h @@ -132,9 +132,9 @@ typedef struct sb_dsp_t { mpu_t *mpu; } sb_dsp_t; -void sb_dsp_input_msg(void *p, uint8_t *msg, uint32_t len); +void sb_dsp_input_msg(void *priv, uint8_t *msg, uint32_t len); -int sb_dsp_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort); +int sb_dsp_input_sysex(void *priv, uint8_t *buffer, uint32_t len, int abort); void sb_dsp_set_mpu(sb_dsp_t *dsp, mpu_t *src_mpu); diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 4c01f289c..6a7143120 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -50,21 +50,21 @@ extern int sound_pos_global; extern int sound_card_current[SOUND_CARD_MAX]; extern void sound_add_handler(void (*get_buffer)(int32_t *buffer, - int len, void *p), - void *p); + int len, void *priv), + void *priv); extern void sound_set_cd_audio_filter(void (*filter)(int channel, - double *buffer, void *p), - void *p); + double *buffer, void *priv), + void *priv); extern int sound_card_available(int card); #ifdef EMU_DEVICE_H extern const device_t *sound_card_getdevice(int card); #endif -extern int sound_card_has_config(int card); -extern char *sound_card_get_internal_name(int card); -extern int sound_card_get_from_internal_name(const char *s); -extern void sound_card_init(void); -extern void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r); +extern int sound_card_has_config(int card); +extern const char *sound_card_get_internal_name(int card); +extern int sound_card_get_from_internal_name(const char *s); +extern void sound_card_init(void); +extern void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r); extern void sound_speed_changed(void); diff --git a/src/include/86box/timer.h b/src/include/86box/timer.h index 45b648151..4ade8aab0 100644 --- a/src/include/86box/timer.h +++ b/src/include/86box/timer.h @@ -12,8 +12,7 @@ #define TIMER_ENABLED 1 #pragma pack(push, 1) -typedef struct ts_struct_t -{ +typedef struct ts_struct_t { uint32_t frac; uint32_t integer; } ts_struct_t; diff --git a/src/include/86box/usb.h b/src/include/86box/usb.h index 893a9f501..623746829 100644 --- a/src/include/86box/usb.h +++ b/src/include/86box/usb.h @@ -22,11 +22,12 @@ extern "C" { #endif -typedef struct -{ - uint8_t uhci_io[32], ohci_mmio[4096]; +typedef struct usb_t { + uint8_t uhci_io[32]; + uint8_t ohci_mmio[4096]; uint16_t uhci_io_base; - int uhci_enable, ohci_enable; + int uhci_enable; + int ohci_enable; uint32_t ohci_mem_base; mem_mapping_t ohci_mmio_mapping; } usb_t; diff --git a/src/include/86box/vid_colorplus.h b/src/include/86box/vid_colorplus.h index 51b735ec7..5acd4c8a2 100644 --- a/src/include/86box/vid_colorplus.h +++ b/src/include/86box/vid_colorplus.h @@ -7,12 +7,12 @@ typedef struct colorplus_t { } colorplus_t; void colorplus_init(colorplus_t *colorplus); -void colorplus_out(uint16_t addr, uint8_t val, void *p); -uint8_t colorplus_in(uint16_t addr, void *p); -void colorplus_write(uint32_t addr, uint8_t val, void *p); -uint8_t colorplus_read(uint32_t addr, void *p); +void colorplus_out(uint16_t addr, uint8_t val, void *priv); +uint8_t colorplus_in(uint16_t addr, void *priv); +void colorplus_write(uint32_t addr, uint8_t val, void *priv); +uint8_t colorplus_read(uint32_t addr, void *priv); void colorplus_recalctimings(colorplus_t *colorplus); -void colorplus_poll(void *p); +void colorplus_poll(void *priv); extern const device_t colorplus_device; diff --git a/src/include/86box/vid_hercules.h b/src/include/86box/vid_hercules.h index b5ba6af9f..c58a50aa3 100644 --- a/src/include/86box/vid_hercules.h +++ b/src/include/86box/vid_hercules.h @@ -40,19 +40,19 @@ typedef struct { int firstline; int lastline; - int linepos; - int displine; - int vc; - int sc; + int linepos; + int displine; + int vc; + int sc; uint16_t ma; uint16_t maback; - int con; - int coff; - int cursoron; - int dispon; - int blink; - int vsynctime; - int vadj; + int con; + int coff; + int cursoron; + int dispon; + int blink; + int vsynctime; + int vadj; int lp_ff; int fullchange; diff --git a/src/include/86box/vid_pgc.h b/src/include/86box/vid_pgc.h index a203c11cf..35e2d9e42 100644 --- a/src/include/86box/vid_pgc.h +++ b/src/include/86box/vid_pgc.h @@ -45,9 +45,9 @@ typedef struct pgc_cl { typedef struct pgc_cmd { char ascii[6]; uint8_t hex; - void (*handler)(struct pgc *); - int (*parser)(struct pgc *, pgc_cl_t *, int); - int p; + void (*handler)(struct pgc *); + int (*parser)(struct pgc *, pgc_cl_t *, int); + int p; } pgc_cmd_t; typedef struct pgc { @@ -71,10 +71,12 @@ typedef struct pgc { uint8_t hex_command; uint32_t palette[256]; uint32_t userpal[256]; - uint32_t maxw, maxh; /* maximum framebuffer size */ - uint32_t visw, vish; /* maximum screen size */ + uint32_t maxw; /* maximum framebuffer size - Width */ + uint32_t maxh; /* maximum framebuffer size - Height */ + uint32_t visw; /* maximum screen size - Width */ + uint32_t vish; /* maximum screen size - Height */ uint32_t screenw; - uint32_t screenh; + uint32_t screenh; int16_t pan_x; int16_t pan_y; uint16_t win_x1; diff --git a/src/include/86box/vid_voodoo_common.h b/src/include/86box/vid_voodoo_common.h index 64a96fe53..96865ac6d 100644 --- a/src/include/86box/vid_voodoo_common.h +++ b/src/include/86box/vid_voodoo_common.h @@ -350,8 +350,7 @@ typedef struct voodoo_t { int h_disp; int v_retrace; - struct - { + struct { uint32_t y[4]; uint32_t i[4]; uint32_t q[4]; @@ -489,8 +488,7 @@ typedef struct voodoo_t { uint32_t leftOverlayBuf; - struct - { + struct { int dst_x; int dst_y; int cur_x; @@ -501,8 +499,7 @@ typedef struct voodoo_t { int dst_stride; } blt; - struct - { + struct { uint32_t bresError0; uint32_t bresError1; uint32_t clip0Min; @@ -590,8 +587,7 @@ typedef struct voodoo_t { int line_bit_mask_size; } banshee_blt; - struct - { + struct { uint32_t vidOverlayStartCoords; uint32_t vidOverlayEndScreenCoords; uint32_t vidOverlayDudx; @@ -671,7 +667,7 @@ typedef struct voodoo_t { uint8_t *vram; uint8_t *changedvram; - void *p; + void *priv; uint8_t monitor_index; } voodoo_t; diff --git a/src/include/86box/vid_voodoo_display.h b/src/include/86box/vid_voodoo_display.h index 25b3e9b1a..f046263bf 100644 --- a/src/include/86box/vid_voodoo_display.h +++ b/src/include/86box/vid_voodoo_display.h @@ -24,6 +24,6 @@ void voodoo_pixelclock_update(voodoo_t *voodoo); void voodoo_generate_filter_v1(voodoo_t *voodoo); void voodoo_generate_filter_v2(voodoo_t *voodoo); void voodoo_threshold_check(voodoo_t *voodoo); -void voodoo_callback(void *p); +void voodoo_callback(void *priv); #endif /*VIDEO_VOODOO_DISPLAY_H*/ diff --git a/src/include/86box/vid_voodoo_fb.h b/src/include/86box/vid_voodoo_fb.h index 2138e83da..8a59b30ef 100644 --- a/src/include/86box/vid_voodoo_fb.h +++ b/src/include/86box/vid_voodoo_fb.h @@ -19,9 +19,9 @@ #ifndef VIDEO_VOODOO_FB_H #define VIDEO_VOODOO_FB_H -uint16_t voodoo_fb_readw(uint32_t addr, void *p); -uint32_t voodoo_fb_readl(uint32_t addr, void *p); -void voodoo_fb_writew(uint32_t addr, uint16_t val, void *p); -void voodoo_fb_writel(uint32_t addr, uint32_t val, void *p); +uint16_t voodoo_fb_readw(uint32_t addr, void *priv); +uint32_t voodoo_fb_readl(uint32_t addr, void *priv); +void voodoo_fb_writew(uint32_t addr, uint16_t val, void *priv); +void voodoo_fb_writel(uint32_t addr, uint32_t val, void *priv); #endif /*VIDEO_VOODOO_FB_H*/ diff --git a/src/include/86box/vid_voodoo_fifo.h b/src/include/86box/vid_voodoo_fifo.h index 0073a295c..e78d0dd6b 100644 --- a/src/include/86box/vid_voodoo_fifo.h +++ b/src/include/86box/vid_voodoo_fifo.h @@ -21,7 +21,7 @@ void voodoo_wake_fifo_thread(voodoo_t *voodoo); void voodoo_wake_fifo_thread_now(voodoo_t *voodoo); -void voodoo_wake_timer(void *p); +void voodoo_wake_timer(void *priv); void voodoo_queue_command(voodoo_t *voodoo, uint32_t addr_type, uint32_t val); void voodoo_flush(voodoo_t *voodoo); void voodoo_wake_fifo_threads(voodoo_set_t *set, voodoo_t *voodoo); diff --git a/src/include/86box/vid_voodoo_reg.h b/src/include/86box/vid_voodoo_reg.h index 62738a8c5..3dff4498c 100644 --- a/src/include/86box/vid_voodoo_reg.h +++ b/src/include/86box/vid_voodoo_reg.h @@ -19,6 +19,6 @@ #ifndef VIDEO_VOODOO_REG_H #define VIDEO_VOODOO_REG_H -void voodoo_reg_writel(uint32_t addr, uint32_t val, void *p); +void voodoo_reg_writel(uint32_t addr, uint32_t val, void *priv); #endif /*VIDEO_VOODOO_REG_H*/ diff --git a/src/include/86box/vid_voodoo_texture.h b/src/include/86box/vid_voodoo_texture.h index 65eec54e4..6f325426a 100644 --- a/src/include/86box/vid_voodoo_texture.h +++ b/src/include/86box/vid_voodoo_texture.h @@ -36,7 +36,7 @@ static const uint32_t texture_offset[LOD_MAX + 3] = { void voodoo_recalc_tex12(voodoo_t *voodoo, int tmu); void voodoo_recalc_tex3(voodoo_t *voodoo, int tmu); void voodoo_use_texture(voodoo_t *voodoo, voodoo_params_t *params, int tmu); -void voodoo_tex_writel(uint32_t addr, uint32_t val, void *p); +void voodoo_tex_writel(uint32_t addr, uint32_t val, void *priv); void flush_texture_cache(voodoo_t *voodoo, uint32_t dirty_addr, int tmu); #endif /* VIDEO_VOODOO_TEXTURE_H*/ diff --git a/src/include/86box/video.h b/src/include/86box/video.h index bccc1139b..dbc2ec109 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -229,17 +229,17 @@ extern int video_card_available(int card); #ifdef EMU_DEVICE_H extern const device_t *video_card_getdevice(int card); #endif -extern int video_card_has_config(int card); -extern char *video_get_internal_name(int card); -extern int video_get_video_from_internal_name(char *s); -extern int video_card_get_flags(int card); -extern int video_is_mda(void); -extern int video_is_cga(void); -extern int video_is_ega_vga(void); -extern int video_is_8514(void); -extern int video_is_xga(void); -extern void video_inform_monitor(int type, const video_timings_t *ptr, int monitor_index); -extern int video_get_type_monitor(int monitor_index); +extern int video_card_has_config(int card); +extern const char *video_get_internal_name(int card); +extern int video_get_video_from_internal_name(char *s); +extern int video_card_get_flags(int card); +extern int video_is_mda(void); +extern int video_is_cga(void); +extern int video_is_ega_vga(void); +extern int video_is_8514(void); +extern int video_is_xga(void); +extern void video_inform_monitor(int type, const video_timings_t *ptr, int monitor_index); +extern int video_get_type_monitor(int monitor_index); extern void video_setblit(void (*blit)(int, int, int, int, int)); extern void video_blend(int x, int y); diff --git a/src/include/86box/zip.h b/src/include/86box/zip.h index 6e53fbf36..2cadb2ff2 100644 --- a/src/include/86box/zip.h +++ b/src/include/86box/zip.h @@ -29,7 +29,7 @@ #define ZIP_250_SECTORS (489532) -#define ZIP_IMAGE_HISTORY 4 +#define ZIP_IMAGE_HISTORY 4 enum { ZIP_BUS_DISABLED = 0, @@ -57,7 +57,7 @@ typedef struct zip_drive_t { uint8_t pad; uint8_t pad0; - FILE *f; + FILE *fp; void *priv; char image_path[1024];