Bläddra i källkod

Fix prototype of random() and move to stdlib.h

tags/v0.9.3
Michael Brown 18 år sedan
förälder
incheckning
73e3e02367
3 ändrade filer med 3 tillägg och 2 borttagningar
  1. 2
    1
      src/core/misc.c
  2. 0
    1
      src/include/etherboot.h
  3. 1
    0
      src/include/stdlib.h

+ 2
- 1
src/core/misc.c Visa fil

@@ -4,6 +4,7 @@ MISC Support Routines
4 4
 
5 5
 #include "etherboot.h"
6 6
 #include "console.h"
7
+#include <stdlib.h>
7 8
 
8 9
 /**************************************************************************
9 10
 IPCHKSUM - Checksum IP Header
@@ -59,7 +60,7 @@ uint16_t add_ipchksums(unsigned long offset, uint16_t sum, uint16_t new)
59 60
 /**************************************************************************
60 61
 RANDOM - compute a random number between 0 and 2147483647L or 2147483562?
61 62
 **************************************************************************/
62
-int32_t random(void)
63
+long int random(void)
63 64
 {
64 65
 	static int32_t seed = 0;
65 66
 	int32_t q;

+ 0
- 1
src/include/etherboot.h Visa fil

@@ -208,7 +208,6 @@ extern int decode_rfc1533 P((unsigned char *, unsigned int, unsigned int, int));
208 208
 #define RAND_MAX 2147483647L
209 209
 extern uint16_t ipchksum P((const void *ip, unsigned long len));
210 210
 extern uint16_t add_ipchksums P((unsigned long offset, uint16_t sum, uint16_t new));
211
-extern int32_t random P((void));
212 211
 extern long rfc2131_sleep_interval P((long base, int exp));
213 212
 extern void cleanup P((void));
214 213
 

+ 1
- 0
src/include/stdlib.h Visa fil

@@ -6,6 +6,7 @@ extern void * realloc ( void *old_ptr, size_t new_size );
6 6
 extern void * malloc ( size_t size );
7 7
 extern void free ( void *ptr );
8 8
 extern int system ( const char *command );
9
+extern long int random ( void );
9 10
 
10 11
 /**
11 12
  * Allocate cleared memory

Laddar…
Avbryt
Spara