Re: Compute buffer size at compile-time
- From: Ico <usenet@xxxxxxx>
- Date: 30 Apr 2006 15:00:26 GMT
Ico <usenet@xxxxxxx> wrote:
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 ?
Hmm, please ignore this, it's wrong *and* doesnt answer the OP's
question.
--
:wq
^X^Cy^K^X^C^C^C^C
.
- References:
- Compute buffer size at compile-time
- From: Spoon
- Re: Compute buffer size at compile-time
- From: Ico
- Compute buffer size at compile-time
- Prev by Date: Re: Compute buffer size at compile-time
- Next by Date: Re: Boost process and C
- Previous by thread: Re: Compute buffer size at compile-time
- Index(es):
Relevant Pages
|