SylixOS defines its own versions of these functions in its standard
library, which collide with ours. However, their prototypes make
more sense, because they follow the prototypes of the non-x versions
in the C standard, so there is no harm in following them.
/*
* The PCI Utilities -- Common Functions
*
/*
* The PCI Utilities -- Common Functions
*
- * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2016 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-xmalloc(unsigned int howmuch)
{
void *p = malloc(howmuch);
if (!p)
{
void *p = malloc(howmuch);
if (!p)
- die("Unable to allocate %d bytes of memory", howmuch);
+ die("Unable to allocate %d bytes of memory", (int) howmuch);
-xrealloc(void *ptr, unsigned int howmuch)
+xrealloc(void *ptr, size_t howmuch)
{
void *p = realloc(ptr, howmuch);
if (!p)
{
void *p = realloc(ptr, howmuch);
if (!p)
- die("Unable to allocate %d bytes of memory", howmuch);
+ die("Unable to allocate %d bytes of memory", (int) howmuch);
+xstrdup(const char *str)
{
int len = strlen(str) + 1;
char *copy = xmalloc(len);
{
int len = strlen(str) + 1;
char *copy = xmalloc(len);
/*
* The PCI Utilities -- Declarations
*
/*
* The PCI Utilities -- Declarations
*
- * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2016 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
extern const char program_name[];
void die(char *msg, ...) NONRET PCI_PRINTF(1,2);
extern const char program_name[];
void die(char *msg, ...) NONRET PCI_PRINTF(1,2);
-void *xmalloc(unsigned int howmuch);
-void *xrealloc(void *ptr, unsigned int howmuch);
-char *xstrdup(char *str);
+void *xmalloc(size_t howmuch);
+void *xrealloc(void *ptr, size_t howmuch);
+char *xstrdup(const char *str);
int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
#ifdef PCI_HAVE_PM_INTEL_CONF
int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
#ifdef PCI_HAVE_PM_INTEL_CONF