Browse Source

alloc: fix examples so they compile.

Rusty Russell 15 years ago
parent
commit
10dda3056e
1 changed files with 2 additions and 6 deletions
  1. 2 6
      ccan/alloc/alloc.h

+ 2 - 6
ccan/alloc/alloc.h

@@ -100,7 +100,6 @@ unsigned long alloc_size(void *pool, unsigned long poolsize, void *p);
  *
  *
  * Example:
  * Example:
  *	#include <assert.h>
  *	#include <assert.h>
- *
  *	...
  *	...
  *		assert(alloc_check(pool, 32*1024*1024));
  *		assert(alloc_check(pool, 32*1024*1024));
  */
  */
@@ -117,15 +116,12 @@ bool alloc_check(void *pool, unsigned long poolsize);
  * suspect corruption call alloc_check() first.
  * suspect corruption call alloc_check() first.
  *
  *
  * Example:
  * Example:
- *	#include <stdio.h>
- *
- *	double *d = alloc_get(pool, 32*1024*1024,
- *			      sizeof(*d), ALIGNOF(*d));
+ *	d = alloc_get(pool, 32*1024*1024, sizeof(*d), ALIGNOF(*d));
  *	if (!d) {
  *	if (!d) {
  *		fprintf(stderr, "Allocation failed!\n");
  *		fprintf(stderr, "Allocation failed!\n");
  *		if (!alloc_check(pool, 32*1024*1024))
  *		if (!alloc_check(pool, 32*1024*1024))
  *			errx(1, "Allocation pool is corrupt");
  *			errx(1, "Allocation pool is corrupt");
- *		alloc_visualize(stderr, pool, 32*1024*1024));
+ *		alloc_visualize(stderr, pool, 32*1024*1024);
  *		exit(1);
  *		exit(1);
  *	}
  *	}
  */
  */