Constification
This commit is contained in:
30
src/device.c
30
src/device.c
@@ -90,8 +90,8 @@ device_init(void)
|
||||
void
|
||||
device_set_context(device_context_t *c, const device_t *dev, int inst)
|
||||
{
|
||||
void *sec;
|
||||
void *single_sec;
|
||||
const void *sec;
|
||||
void *single_sec;
|
||||
|
||||
memset(c, 0, sizeof(device_context_t));
|
||||
c->dev = dev;
|
||||
@@ -343,17 +343,17 @@ device_get_priv(const device_t *dev)
|
||||
int
|
||||
device_available(const device_t *dev)
|
||||
{
|
||||
device_config_t *config = NULL;
|
||||
device_config_bios_t *bios = NULL;
|
||||
int roms_present = 0;
|
||||
int i = 0;
|
||||
const device_config_t *config = NULL;
|
||||
const device_config_bios_t *bios = NULL;
|
||||
int roms_present = 0;
|
||||
int i = 0;
|
||||
|
||||
if (dev != NULL) {
|
||||
config = dev->config;
|
||||
if (config != NULL) {
|
||||
while (config->type != -1) {
|
||||
if (config->type == CONFIG_BIOS) {
|
||||
bios = (device_config_bios_t *) config->bios;
|
||||
bios = (const device_config_bios_t *) config->bios;
|
||||
|
||||
/* Go through the ROM's in the device configuration. */
|
||||
while (bios->files_no != 0) {
|
||||
@@ -385,8 +385,8 @@ device_available(const device_t *dev)
|
||||
const char *
|
||||
device_get_bios_file(const device_t *dev, const char *internal_name, int file_no)
|
||||
{
|
||||
device_config_t *config = NULL;
|
||||
device_config_bios_t *bios = NULL;
|
||||
const device_config_t *config = NULL;
|
||||
const device_config_bios_t *bios = NULL;
|
||||
|
||||
if (dev != NULL) {
|
||||
config = dev->config;
|
||||
@@ -418,8 +418,8 @@ device_get_bios_file(const device_t *dev, const char *internal_name, int file_no
|
||||
int
|
||||
device_has_config(const device_t *dev)
|
||||
{
|
||||
int c = 0;
|
||||
device_config_t *config;
|
||||
int c = 0;
|
||||
const device_config_t *config;
|
||||
|
||||
if (dev == NULL)
|
||||
return 0;
|
||||
@@ -472,10 +472,10 @@ device_register_pci_slot(const device_t *dev, int device, int type, int inta, in
|
||||
void
|
||||
device_get_name(const device_t *dev, int bus, char *name)
|
||||
{
|
||||
char *sbus = NULL;
|
||||
char *fbus;
|
||||
char *tname;
|
||||
char pbus[8] = { 0 };
|
||||
const char *sbus = NULL;
|
||||
const char *fbus;
|
||||
char *tname;
|
||||
char pbus[8] = { 0 };
|
||||
|
||||
if (dev == NULL)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user