summaryrefslogtreecommitdiff
path: root/main/lzo/tests/align.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/lzo/tests/align.c')
-rw-r--r--main/lzo/tests/align.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/main/lzo/tests/align.c b/main/lzo/tests/align.c
index a4c5f7db..59bf8333 100644
--- a/main/lzo/tests/align.c
+++ b/main/lzo/tests/align.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
@@ -30,7 +30,7 @@
#include "src/lzo_conf.h"
#include "src/lzo_ptr.h"
#endif
-#include "lzo/lzoconf.h"
+#include <lzo/lzoconf.h>
/* utility layer */
#define WANT_LZO_MALLOC 1
@@ -56,12 +56,12 @@ static unsigned long align_test(lzo_bytep block, lzo_uint len, lzo_uint step)
unsigned long i = 0;
assert(step > 0);
- assert(step <= 65536L);
+ assert(step <= 65536ul);
assert((step & (step - 1)) == 0);
for (offset = step; offset < len; offset += step)
{
- k1 = LZO_PTR_ALIGN_UP(b1+1,step);
+ k1 = LZO_PTR_ALIGN_UP(b1 + 1, step);
k2 = b2 + offset;
if (k1 != k2)
{
@@ -109,7 +109,7 @@ static unsigned long align_test(lzo_bytep block, lzo_uint len, lzo_uint step)
for (k = b1 + 1; k <= k1; k++)
{
- x = LZO_PTR_ALIGN_UP(k,step);
+ x = LZO_PTR_ALIGN_UP(k, step);
if (x != k1)
{
printf("error 3: base: %p %p %p i %lu step %ld offset %ld: "
@@ -135,7 +135,7 @@ static unsigned long align_test(lzo_bytep block, lzo_uint len, lzo_uint step)
//
**************************************************************************/
-#define BLOCK_LEN (128*1024ul)
+#define BLOCK_SIZE (128*1024ul)
int main(int argc, char *argv[])
{
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
printf("lzo_init() failed !!!\n");
return 3;
}
- buf = (lzo_bytep) lzo_malloc(2*BLOCK_LEN + 256);
+ buf = (lzo_bytep) lzo_malloc(2*BLOCK_SIZE + 256);
if (buf == NULL)
{
printf("out of memory\n");
@@ -165,22 +165,22 @@ int main(int argc, char *argv[])
printf("Align init: %p ( 0x%lx )\n", buf, (unsigned long) (size_t) buf);
#endif
- for (step = 1; step <= 65536L; step *= 2)
+ for (step = 1; step <= 65536ul; step *= 2)
{
lzo_bytep block = buf;
unsigned long n;
unsigned gap;
- gap = __lzo_align_gap(block,step);
- block = LZO_PTR_ALIGN_UP(block,step);
+ gap = __lzo_align_gap(block, step);
+ block = LZO_PTR_ALIGN_UP(block, step);
if (opt_verbose >= 1)
printf("STEP %5lu: GAP: %5lu %p %p %5lu\n",
(unsigned long) step, (unsigned long) gap, buf, block,
(unsigned long) (block - buf));
- n = align_test(block,BLOCK_LEN,step);
+ n = align_test(block, BLOCK_SIZE, step);
if (n == 0)
return 1;
- if ((n + 1) * step != BLOCK_LEN)
+ if ((n + 1) * step != BLOCK_SIZE)
{
printf("error 4: %ld %lu\n", (long)step, n);
return 1;