summaryrefslogtreecommitdiff
path: root/vpx_mem
diff options
context:
space:
mode:
authorclang-format <noreply@google.com>2016-07-25 14:16:28 -0700
committerJames Zern <jzern@google.com>2016-07-25 14:17:59 -0700
commitd7a3b781d3e256f30d061af2c9fc697f366e7b1b (patch)
tree28cfe61d62874e5b4d95b8c22fe3048227e6d656 /vpx_mem
parent82070ae9393b1e79559d81fcf1aa89c2e4aa58ee (diff)
downloadlibvpx-d7a3b781d3e256f30d061af2c9fc697f366e7b1b.tar
libvpx-d7a3b781d3e256f30d061af2c9fc697f366e7b1b.tar.gz
libvpx-d7a3b781d3e256f30d061af2c9fc697f366e7b1b.tar.bz2
libvpx-d7a3b781d3e256f30d061af2c9fc697f366e7b1b.zip
vpx_mem: apply clang-format
Change-Id: I0440686fc03f1ee02bd0168c91e671a0a2d0056a
Diffstat (limited to 'vpx_mem')
-rw-r--r--vpx_mem/include/vpx_mem_intrnl.h20
-rw-r--r--vpx_mem/vpx_mem.c26
-rw-r--r--vpx_mem/vpx_mem.h17
3 files changed, 28 insertions, 35 deletions
diff --git a/vpx_mem/include/vpx_mem_intrnl.h b/vpx_mem/include/vpx_mem_intrnl.h
index c4dd78550..b62d238fd 100644
--- a/vpx_mem/include/vpx_mem_intrnl.h
+++ b/vpx_mem/include/vpx_mem_intrnl.h
@@ -8,24 +8,24 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#ifndef VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
#define VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
#include "./vpx_config.h"
-#define ADDRESS_STORAGE_SIZE sizeof(size_t)
+#define ADDRESS_STORAGE_SIZE sizeof(size_t)
#ifndef DEFAULT_ALIGNMENT
-# if defined(VXWORKS)
-# define DEFAULT_ALIGNMENT 32 /*default addr alignment to use in
-calls to vpx_* functions other
-than vpx_memalign*/
-# else
-# define DEFAULT_ALIGNMENT (2 * sizeof(void*)) /* NOLINT */
-# endif
+#if defined(VXWORKS)
+/*default addr alignment to use in calls to vpx_* functions other than
+ * vpx_memalign*/
+#define DEFAULT_ALIGNMENT 32
+#else
+#define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */
+#endif
#endif
/*returns an addr aligned to the byte boundary specified by align*/
-#define align_addr(addr,align) (void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align))
+#define align_addr(addr, align) \
+ (void *)(((size_t)(addr) + ((align)-1)) & (size_t) - (align))
#endif // VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
diff --git a/vpx_mem/vpx_mem.c b/vpx_mem/vpx_mem.c
index b261fc0da..cfced2f7d 100644
--- a/vpx_mem/vpx_mem.c
+++ b/vpx_mem/vpx_mem.c
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#include "vpx_mem.h"
#include <stdio.h>
#include <stdlib.h>
@@ -17,8 +16,7 @@
#include "vpx/vpx_integer.h"
void *vpx_memalign(size_t align, size_t size) {
- void *addr,
- * x = NULL;
+ void *addr, *x = NULL;
addr = malloc(size + align - 1 + ADDRESS_STORAGE_SIZE);
@@ -31,24 +29,20 @@ void *vpx_memalign(size_t align, size_t size) {
return x;
}
-void *vpx_malloc(size_t size) {
- return vpx_memalign(DEFAULT_ALIGNMENT, size);
-}
+void *vpx_malloc(size_t size) { return vpx_memalign(DEFAULT_ALIGNMENT, size); }
void *vpx_calloc(size_t num, size_t size) {
void *x;
x = vpx_memalign(DEFAULT_ALIGNMENT, num * size);
- if (x)
- memset(x, 0, num * size);
+ if (x) memset(x, 0, num * size);
return x;
}
void *vpx_realloc(void *memblk, size_t size) {
- void *addr,
- * new_addr = NULL;
+ void *addr, *new_addr = NULL;
int align = DEFAULT_ALIGNMENT;
/*
@@ -64,16 +58,17 @@ void *vpx_realloc(void *memblk, size_t size) {
else if (!size)
vpx_free(memblk);
else {
- addr = (void *)(((size_t *)memblk)[-1]);
+ addr = (void *)(((size_t *)memblk)[-1]);
memblk = NULL;
new_addr = realloc(addr, size + align + ADDRESS_STORAGE_SIZE);
if (new_addr) {
addr = new_addr;
- new_addr = (void *)(((size_t)
- ((unsigned char *)new_addr + ADDRESS_STORAGE_SIZE) + (align - 1)) &
- (size_t) - align);
+ new_addr =
+ (void *)(((size_t)((unsigned char *)new_addr + ADDRESS_STORAGE_SIZE) +
+ (align - 1)) &
+ (size_t)-align);
/* save the actual malloc address */
((size_t *)new_addr)[-1] = (size_t)addr;
}
@@ -93,8 +88,7 @@ void vpx_free(void *memblk) {
void *vpx_memset16(void *dest, int val, size_t length) {
size_t i;
uint16_t *dest16 = (uint16_t *)dest;
- for (i = 0; i < length; i++)
- *dest16++ = val;
+ for (i = 0; i < length; i++) *dest16++ = val;
return dest;
}
#endif // CONFIG_VP9_HIGHBITDEPTH
diff --git a/vpx_mem/vpx_mem.h b/vpx_mem/vpx_mem.h
index a006e0f00..c14f288b8 100644
--- a/vpx_mem/vpx_mem.h
+++ b/vpx_mem/vpx_mem.h
@@ -8,13 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#ifndef VPX_MEM_VPX_MEM_H_
#define VPX_MEM_VPX_MEM_H_
#include "vpx_config.h"
#if defined(__uClinux__)
-# include <lddk.h>
+#include <lddk.h>
#endif
#include <stdlib.h>
@@ -24,20 +23,20 @@
extern "C" {
#endif
- void *vpx_memalign(size_t align, size_t size);
- void *vpx_malloc(size_t size);
- void *vpx_calloc(size_t num, size_t size);
- void *vpx_realloc(void *memblk, size_t size);
- void vpx_free(void *memblk);
+void *vpx_memalign(size_t align, size_t size);
+void *vpx_malloc(size_t size);
+void *vpx_calloc(size_t num, size_t size);
+void *vpx_realloc(void *memblk, size_t size);
+void vpx_free(void *memblk);
#if CONFIG_VP9_HIGHBITDEPTH
- void *vpx_memset16(void *dest, int val, size_t length);
+void *vpx_memset16(void *dest, int val, size_t length);
#endif
#include <string.h>
#ifdef VPX_MEM_PLTFRM
-# include VPX_MEM_PLTFRM
+#include VPX_MEM_PLTFRM
#endif
#if defined(__cplusplus)