projects
/
fw
/
pdclib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Porting current working set from CVS.
[fw/pdclib]
/
platform
/
example
/
functions
/
_PDCLIB
/
allocpages.c
diff --git
a/platform/example/functions/_PDCLIB/allocpages.c
b/platform/example/functions/_PDCLIB/allocpages.c
index 48b8dc9cad8ea4ddaa8015501b02a6276db4b42e..55dd9d82a9e767d1f11701a1216df904b6e97e26 100644
(file)
--- a/
platform/example/functions/_PDCLIB/allocpages.c
+++ b/
platform/example/functions/_PDCLIB/allocpages.c
@@
-13,12
+13,14
@@
*/
#include <stdint.h>
*/
#include <stdint.h>
+#include <stddef.h>
-#include <unistd.h>
+int brk( void * );
+void * sbrk( intptr_t );
-#ifndef _PDCLIB_
CONFIG
_H
-#define _PDCLIB_
CONFIG_H _PDCLIB_CONFIG
_H
-#include <_PDCLIB_
config
.h>
+#ifndef _PDCLIB_
GLUE
_H
+#define _PDCLIB_
GLUE_H _PDCLIB_GLUE
_H
+#include <_PDCLIB_
glue
.h>
#endif
static void * membreak = NULL;
#endif
static void * membreak = NULL;
@@
-39,7
+41,7
@@
void * _PDCLIB_allocpages( int const n )
/* error */
return NULL;
}
/* error */
return NULL;
}
- membreak
+=
unaligned;
+ membreak
= (char *)membreak +
unaligned;
}
}
/* increasing or decreasing heap - standard operation */
}
}
/* increasing or decreasing heap - standard operation */
@@
-61,16
+63,13
@@
void * _PDCLIB_allocpages( int const n )
#ifdef TEST
#include <_PDCLIB_test.h>
#ifdef TEST
#include <_PDCLIB_test.h>
-int puts( const char * );
-
-int main()
+int main( void )
{
{
- BEGIN_TESTS;
#ifndef REGTEST
{
#ifndef REGTEST
{
-
void
* startbreak = sbrk( 0 );
+
char
* startbreak = sbrk( 0 );
TESTCASE( _PDCLIB_allocpages( 0 ) );
TESTCASE( _PDCLIB_allocpages( 0 ) );
- TESTCASE( ( sbrk( 0 ) - startbreak ) <= _PDCLIB_PAGESIZE );
+ TESTCASE( (
(char *)
sbrk( 0 ) - startbreak ) <= _PDCLIB_PAGESIZE );
startbreak = sbrk( 0 );
TESTCASE( _PDCLIB_allocpages( 1 ) );
TESTCASE( sbrk( 0 ) == startbreak + ( 1 * _PDCLIB_PAGESIZE ) );
startbreak = sbrk( 0 );
TESTCASE( _PDCLIB_allocpages( 1 ) );
TESTCASE( sbrk( 0 ) == startbreak + ( 1 * _PDCLIB_PAGESIZE ) );