Browse Source

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

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
73e3e02367
3 changed files with 3 additions and 2 deletions
  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 View File

4
 
4
 
5
 #include "etherboot.h"
5
 #include "etherboot.h"
6
 #include "console.h"
6
 #include "console.h"
7
+#include <stdlib.h>
7
 
8
 
8
 /**************************************************************************
9
 /**************************************************************************
9
 IPCHKSUM - Checksum IP Header
10
 IPCHKSUM - Checksum IP Header
59
 /**************************************************************************
60
 /**************************************************************************
60
 RANDOM - compute a random number between 0 and 2147483647L or 2147483562?
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
 	static int32_t seed = 0;
65
 	static int32_t seed = 0;
65
 	int32_t q;
66
 	int32_t q;

+ 0
- 1
src/include/etherboot.h View File

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

+ 1
- 0
src/include/stdlib.h View File

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

Loading…
Cancel
Save