Some small changes after networking module handling rewrite.
- Make sure the 'null' module is on top of the list. - Removed no longer required method.
This commit is contained in:
parent
1fe24e32b0
commit
7ae0a21158
@ -1115,16 +1115,6 @@ bool bx_devices_c::is_harddrv_enabled(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool bx_devices_c::is_network_enabled(void)
|
||||
{
|
||||
if (PLUG_device_present("e1000") ||
|
||||
PLUG_device_present("ne2k") ||
|
||||
PLUG_device_present("pcipnic")) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool bx_devices_c::is_sound_enabled(void)
|
||||
{
|
||||
if (PLUG_device_present("es1370") ||
|
||||
|
@ -602,12 +602,10 @@ private:
|
||||
int timer_handle;
|
||||
int statusbar_id[3];
|
||||
|
||||
bool network_enabled;
|
||||
bool sound_enabled;
|
||||
bool usb_enabled;
|
||||
|
||||
bool is_harddrv_enabled();
|
||||
bool is_network_enabled();
|
||||
bool is_sound_enabled();
|
||||
bool is_usb_enabled();
|
||||
};
|
||||
|
@ -43,7 +43,7 @@ bx_netmod_ctl_c::bx_netmod_ctl_c()
|
||||
|
||||
void bx_netmod_ctl_c::init(void)
|
||||
{
|
||||
Bit8u count = 0;
|
||||
Bit8u i, count = 0;
|
||||
|
||||
#if !BX_PLUGINS
|
||||
count = eth_locator_c::get_modules_count();
|
||||
@ -51,7 +51,7 @@ void bx_netmod_ctl_c::init(void)
|
||||
count = PLUG_get_plugins_count(PLUGTYPE_NET);
|
||||
#endif
|
||||
net_module_names = (const char**) malloc((count + 1) * sizeof(char*));
|
||||
for (Bit8u i = 0; i < count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
#if !BX_PLUGINS
|
||||
net_module_names[i] = eth_locator_c::get_module_name(i);
|
||||
#else
|
||||
@ -59,6 +59,16 @@ void bx_netmod_ctl_c::init(void)
|
||||
#endif
|
||||
}
|
||||
net_module_names[count] = NULL;
|
||||
// move 'null' module to the top of the list
|
||||
if (strcmp(net_module_names[0], "null")) {
|
||||
for (i = 1; i < count; i++) {
|
||||
if (!strcmp(net_module_names[i], "null")) {
|
||||
net_module_names[i] = net_module_names[0];
|
||||
net_module_names[0] = "null";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char **bx_netmod_ctl_c::get_module_names(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user