Re: Compute buffer size at compile-time
- From: Ico <usenet@xxxxxxx>
- Date: 30 Apr 2006 14:25:41 GMT
Spoon <none> wrote:
Hello,
Consider:
#define BUFFER_SIZE 1234 /* or some other value */
uint8_t buffer[BUFFER_SIZE];
int do_stuff(uint8_t *buf);
where do_stuff() does something with each octet in the buffer.
Assume I've come up with do_stuff_2() similar to do_stuff() but
that works with 16 octets at a time.
I need to compute N at compile time
such that N >= 1234 && N % 16 == 0
#define N (BS / 16) * 16 + 16 ?
--
:wq
^X^Cy^K^X^C^C^C^C
.
- Follow-Ups:
- Re: Compute buffer size at compile-time
- From: Ico
- Re: Compute buffer size at compile-time
- From: Eric Sosman
- Re: Compute buffer size at compile-time
- References:
- Compute buffer size at compile-time
- From: Spoon
- Compute buffer size at compile-time
- Prev by Date: Compute buffer size at compile-time
- Next by Date: Re: Function Signatures In time.h
- Previous by thread: Compute buffer size at compile-time
- Next by thread: Re: Compute buffer size at compile-time
- Index(es):
Relevant Pages
|