/*
- * Copyright (C) 2002 Erik Fears
+ * Copyright (C) 2002-2003 Erik Fears
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
int i;
OPM_T *ret;
- ret = MyMalloc(sizeof(OPM_T));
+ ret = MyMalloc(sizeof *ret);
ret->config = libopm_config_create();
ret->scans = libopm_list_create();
OPM_REMOTE_T *ret;
- ret = MyMalloc(sizeof(OPM_REMOTE_T));
+ ret = MyMalloc(sizeof *ret);
/* Do initializations */
if(ip == NULL)
static OPM_PROTOCOL_CONFIG_T *libopm_protocol_config_create(void)
{
OPM_PROTOCOL_CONFIG_T *ret;
- ret = MyMalloc(sizeof(OPM_PROTOCOL_CONFIG_T));
+ ret = MyMalloc(sizeof *ret);
return ret;
}
OPM_CONNECTION_T *conn;
OPM_NODE_T *node, *p;
- ret = MyMalloc(sizeof(OPM_SCAN_T));
+ ret = MyMalloc(sizeof *ret);
ret->remote = remote;
ret->connections = libopm_list_create();
static OPM_CONNECTION_T *libopm_connection_create(void)
{
OPM_CONNECTION_T *ret;
- ret = MyMalloc(sizeof(OPM_CONNECTION_T));
+ ret = MyMalloc(sizeof *ret);
ret->fd = 0;
ret->bytes_read = 0;
if(ufds_size < (*(unsigned int *) libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)))
{
MyFree(ufds);
- ufds = MyMalloc(sizeof(struct pollfd) * (*(int *) libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)));
- ufds_size = (*(int *) libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT));
+ ufds = MyMalloc((sizeof *ufds) * (*(unsigned int *) libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)));
+ ufds_size = (*(unsigned int *) libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT));
}
if(LIST_SIZE(scanner->scans) == 0)
/*
- * Copyright (C) 2002 Erik Fears
+ * Copyright (C) 2002-2003 Erik Fears
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
OPM_NODE_T *libopm_node_create(void *data)
{
- OPM_NODE_T *node = MyMalloc(sizeof(OPM_NODE_T));
+ OPM_NODE_T *node = MyMalloc(sizeof *node);
node->next = NULL;
node->prev = NULL;
node->data = (void *) data;
OPM_LIST_T *libopm_list_create()
{
- OPM_LIST_T *list = MyMalloc(sizeof(OPM_LIST_T));
+ OPM_LIST_T *list = MyMalloc(sizeof *list);
list->head = NULL;
list->tail = NULL;