From 76cbaa4b2e433ed78031dc75ae1b3183867c55ab Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 19 Jun 2008 23:19:20 -0700 Subject: [PATCH] raa: clean up indentation Clean up in indentation in the RAA code. --- raa.c | 15 ++++++++------- raa.h | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/raa.c b/raa.c index ee5a5a9e..96353123 100644 --- a/raa.c +++ b/raa.c @@ -19,7 +19,8 @@ static struct RAA *real_raa_init(int layers) r->layers = layers; for (i = 0; i < RAA_LAYERSIZE; i++) r->u.b.data[i] = NULL; - r->shift = (RAA_BLKSHIFT-RAA_LAYERSHIFT) + layers*RAA_LAYERSHIFT; + r->shift = + (RAA_BLKSHIFT - RAA_LAYERSHIFT) + layers * RAA_LAYERSHIFT; } return r; } @@ -42,11 +43,11 @@ void raa_free(struct RAA *r) int64_t raa_read(struct RAA *r, int32_t posn) { - if ((uint32_t)posn >= (UINT32_C(1) << (r->shift + LAYERSHIFT(r)))) + if ((uint32_t) posn >= (UINT32_C(1) << (r->shift + LAYERSHIFT(r)))) return 0; /* Return 0 for undefined entries */ while (r->layers > 0) { - int32_t l = posn >> r->shift; - posn &= (UINT32_C(1) << r->shift)-1; + int32_t l = posn >> r->shift; + posn &= (UINT32_C(1) << r->shift) - 1; r = r->u.b.data[l]; if (!r) return 0; /* Return 0 for undefined entries */ @@ -61,7 +62,7 @@ struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value) if (posn < 0) nasm_malloc_error(ERR_PANIC, "negative position in raa_write"); - while ((UINT32_C(1) << (r->shift+LAYERSHIFT(r))) <= (uint32_t)posn) { + while ((UINT32_C(1) << (r->shift + LAYERSHIFT(r))) <= (uint32_t) posn) { /* * Must add a layer. */ @@ -81,8 +82,8 @@ struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value) while (r->layers > 0) { struct RAA **s; - int32_t l = posn >> r->shift; - posn &= (UINT32_C(1) << r->shift)-1; + int32_t l = posn >> r->shift; + posn &= (UINT32_C(1) << r->shift) - 1; s = &r->u.b.data[l]; if (!*s) *s = real_raa_init(r->layers - 1); diff --git a/raa.h b/raa.h index 665e728c..c760f9ae 100644 --- a/raa.h +++ b/raa.h @@ -9,9 +9,9 @@ * chunk. */ -#define RAA_BLKSHIFT 15 /* 2**this many longs allocated at once */ +#define RAA_BLKSHIFT 15 /* 2**this many longs allocated at once */ #define RAA_BLKSIZE (1 << RAA_BLKSHIFT) -#define RAA_LAYERSHIFT 15 /* 2**this many _pointers_ allocated */ +#define RAA_LAYERSHIFT 15 /* 2**this many _pointers_ allocated */ #define RAA_LAYERSIZE (1 << RAA_LAYERSHIFT) typedef struct RAA RAA; @@ -53,4 +53,4 @@ void raa_free(struct RAA *); int64_t raa_read(struct RAA *, int32_t); struct RAA *raa_write(struct RAA *r, int32_t posn, int64_t value); -#endif /* NASM_RAA_H */ +#endif /* NASM_RAA_H */ -- 2.11.4.GIT