diff options
author | Arne Schwabe <arne@rfc2549.org> | 2015-08-10 13:51:40 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2015-08-10 13:51:40 +0200 |
commit | 98399ed51045871f8d73599322b6947d6b2b80d0 (patch) | |
tree | 28eb352fc1fd89f9c0969cfe0e7c384dee8b17df /main/lzo/src/lzo_ptr.c | |
parent | e6af88b346e9eb5be462429bf9786e7e89ce0e0d (diff) |
Update lzo to 2.09
Diffstat (limited to 'main/lzo/src/lzo_ptr.c')
-rw-r--r-- | main/lzo/src/lzo_ptr.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/main/lzo/src/lzo_ptr.c b/main/lzo/src/lzo_ptr.c index 2896b70b..38359ff2 100644 --- a/main/lzo/src/lzo_ptr.c +++ b/main/lzo/src/lzo_ptr.c @@ -2,7 +2,7 @@ This file is part of the LZO real-time data compression library. - Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer All Rights Reserved. The LZO library is free software; you can redistribute it and/or @@ -61,18 +61,20 @@ __lzo_align_gap(const lzo_voidp ptr, lzo_uint size) #error "__LZO_UINTPTR_T_IS_POINTER is unsupported" #else lzo_uintptr_t p, n; + if (size < 2) return 0; p = __lzo_ptr_linear(ptr); +#if 0 n = (((p + size - 1) / size) * size) - p; +#else + if ((size & (size - 1)) != 0) + return 0; + n = size; n = ((p + n - 1) & ~(n - 1)) - p; +#endif #endif - - assert(size > 0); assert((long)n >= 0); assert(n <= size); return (unsigned)n; } - -/* -vi:ts=4:et -*/ +/* vim:set ts=4 sw=4 et: */ |