net: get rid of MAX_NET_DRIVERS

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2012-12-03 13:57:42 +10:30
parent c952c109b7
commit 5863bcf793
4 changed files with 24 additions and 27 deletions

View File

@ -183,9 +183,8 @@ typedef struct net_landriver_s {
int (*SetSocketPort)(netadr_t *addr, int port);
} net_landriver_t;
#define MAX_NET_DRIVERS 8
extern int net_numlandrivers;
extern net_landriver_t net_landrivers[MAX_NET_DRIVERS];
extern net_landriver_t net_landrivers[];
typedef struct net_driver_s {
char *name;
@ -206,7 +205,7 @@ typedef struct net_driver_s {
} net_driver_t;
extern int net_numdrivers;
extern net_driver_t net_drivers[MAX_NET_DRIVERS];
extern net_driver_t net_drivers[];
extern int DEFAULTnet_hostport;
extern int net_hostport;

View File

@ -23,9 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "net_loop.h"
#include "net_udp.h"
#include "quakedef.h"
net_driver_t net_drivers[MAX_NET_DRIVERS] = {
net_driver_t net_drivers[] = {
{
.name = "Loopback",
.initialized = false,
@ -61,7 +59,7 @@ net_driver_t net_drivers[MAX_NET_DRIVERS] = {
int net_numdrivers = 2;
net_landriver_t net_landrivers[MAX_NET_DRIVERS] = {
net_landriver_t net_landrivers[] = {
{
.name = "UDP",
.initialized = false,

View File

@ -17,28 +17,29 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include "net.h"
#include "net_loop.h"
net_driver_t net_drivers[MAX_NET_DRIVERS] = {
net_driver_t net_drivers[] = {
{
"Loopback",
false,
Loop_Init,
Loop_Listen,
Loop_SearchForHosts,
Loop_Connect,
Loop_CheckNewConnections,
Loop_GetMessage,
Loop_SendMessage,
Loop_SendUnreliableMessage,
Loop_CanSendMessage,
Loop_CanSendUnreliableMessage,
Loop_Close,
Loop_Shutdown}
.name = "Loopback",
.initialized = false,
.Init = Loop_Init,
.Listen = Loop_Listen,
.SearchForHosts = Loop_SearchForHosts,
.Connect = Loop_Connect,
.CheckNewConnections = Loop_CheckNewConnections,
.QGetMessage = Loop_GetMessage,
.QSendMessage = Loop_SendMessage,
.SendUnreliableMessage = Loop_SendUnreliableMessage,
.CanSendMessage = Loop_CanSendMessage,
.CanSendUnreliableMessage = Loop_CanSendUnreliableMessage,
.Close = Loop_Close,
.Shutdown = Loop_Shutdown
}
};
int net_numdrivers = 1;
net_landriver_t net_landrivers[MAX_NET_DRIVERS];
net_landriver_t net_landrivers[0];
int net_numlandrivers = 0;

View File

@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
net_driver_t net_drivers[MAX_NET_DRIVERS] = {
net_driver_t net_drivers[] = {
{
.name = "Loopback",
.initialized = false,
@ -61,8 +61,7 @@ net_driver_t net_drivers[MAX_NET_DRIVERS] = {
int net_numdrivers = 2;
net_landriver_t net_landrivers[MAX_NET_DRIVERS] = {
net_landriver_t net_landrivers[] = {
{
.name = "Winsock TCPIP",
.initialized = false,