From 0debe9bd6ffb6f89a0756137837dcdc58fa84de0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 19 Oct 2011 22:11:50 +0200 Subject: pcm_utils: add function pcm_end_pointer() --- src/pcm_utils.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/pcm_utils.h') diff --git a/src/pcm_utils.h b/src/pcm_utils.h index b6a6f3787..001423b37 100644 --- a/src/pcm_utils.h +++ b/src/pcm_utils.h @@ -24,6 +24,17 @@ #include +/** + * Add a byte count to the specified pointer. This is a utility + * function to convert a source pointer and a byte count to an "end" + * pointer for use in loops. + */ +static inline const void * +pcm_end_pointer(const void *p, size_t size) +{ + return (const char *)p + size; +} + /** * Check if the value is within the range of the provided bit size, * and caps it if necessary. -- cgit v1.2.3