From 73e3e02367e1b8aa45dd3d137ba81f94ee76f0f9 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 22 Dec 2006 01:44:51 +0000 Subject: [PATCH] Fix prototype of random() and move to stdlib.h --- src/core/misc.c | 3 ++- src/include/etherboot.h | 1 - src/include/stdlib.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/misc.c b/src/core/misc.c index 3930d265..19d114cc 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -4,6 +4,7 @@ MISC Support Routines #include "etherboot.h" #include "console.h" +#include /************************************************************************** IPCHKSUM - Checksum IP Header @@ -59,7 +60,7 @@ uint16_t add_ipchksums(unsigned long offset, uint16_t sum, uint16_t new) /************************************************************************** RANDOM - compute a random number between 0 and 2147483647L or 2147483562? **************************************************************************/ -int32_t random(void) +long int random(void) { static int32_t seed = 0; int32_t q; diff --git a/src/include/etherboot.h b/src/include/etherboot.h index b26379c2..82519fdf 100644 --- a/src/include/etherboot.h +++ b/src/include/etherboot.h @@ -208,7 +208,6 @@ extern int decode_rfc1533 P((unsigned char *, unsigned int, unsigned int, int)); #define RAND_MAX 2147483647L extern uint16_t ipchksum P((const void *ip, unsigned long len)); extern uint16_t add_ipchksums P((unsigned long offset, uint16_t sum, uint16_t new)); -extern int32_t random P((void)); extern long rfc2131_sleep_interval P((long base, int exp)); extern void cleanup P((void)); diff --git a/src/include/stdlib.h b/src/include/stdlib.h index d71ee1ab..2b6471e1 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -6,6 +6,7 @@ extern void * realloc ( void *old_ptr, size_t new_size ); extern void * malloc ( size_t size ); extern void free ( void *ptr ); extern int system ( const char *command ); +extern long int random ( void ); /** * Allocate cleared memory