From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 From: "Kirill A. Shutsemov" To: "Dmitry V. Levin" , Alexey Tourbin Date: Tue, 16 Nov 2010 17:56:40 +0200 Message-Id: <1289923002-14132-7-git-send-email-kirill@shutemov.name> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1289923002-14132-1-git-send-email-kirill@shutemov.name> References: <1289923002-14132-1-git-send-email-kirill@shutemov.name> Cc: "Alexey I. Froloff" , devel@lists.altlinux.org, Alexey Gladkov , "Kirill A. Shutemov" Subject: [devel] [PATCH 6/8] set.c: use function-like syntax for sizeof. X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 15:57:14 -0000 Archived-At: List-Archive: List-Post: From: Kirill A. Shutemov Signed-off-by: Kirill A. Shutemov --- lib/set.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/set.c b/lib/set.c index 2a8d8b3..b4ed87d 100644 --- a/lib/set.c +++ b/lib/set.c @@ -219,7 +219,7 @@ void test_base62(void) /* trigger some 'Z' */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; - const int rnd_bitc = sizeof rnd_bitv; + const int rnd_bitc = sizeof(rnd_bitv); /* encode */ char base62[encode_base62_size(rnd_bitc)]; int len = encode_base62(rnd_bitc, rnd_bitv, base62); @@ -407,7 +407,7 @@ void test_golomb(void) /* koshka sela na taksi */ 7, 6, 5, 4, 3, 2, 1, }; - const int rnd_c = sizeof rnd_v / sizeof *rnd_v; + const int rnd_c = sizeof(rnd_v) / sizeof(*rnd_v); int bpp = 10; int Mshift = encode_golomb_Mshift(rnd_c, bpp); fprintf(stderr, "rnd_c=%d bpp=%d Mshift=%d\n", rnd_c, bpp, Mshift); @@ -522,7 +522,7 @@ int cmpv(const void *arg1, const void *arg2) static void sortv(int c, unsigned *v) { - qsort(v, c, sizeof *v, cmpv); + qsort(v, c, sizeof(*v), cmpv); } static @@ -545,7 +545,7 @@ static void test_aux(void) { unsigned v[] = { 2, 3, 1, 2, 7, 6, 5 }; - int c = sizeof v / sizeof *v; + int c = sizeof(v) / sizeof(*v); maskv(c, v, 4 - 1); sortv(c, v); c = uniqv(c, v); @@ -710,7 +710,7 @@ void test_set(void) 0x82ae, 0x8415, 0xa3e7, 0xb07e, 0xb584, 0xb89f, 0xbb40, 0xf39e, }; - int rnd_c = sizeof rnd_v / sizeof *rnd_v; + int rnd_c = sizeof(rnd_v) / sizeof(*rnd_v); /* encode */ int bpp = 16; char base62[encode_set_size(rnd_c, bpp)]; @@ -833,7 +833,7 @@ struct set { struct set *set_new() { - struct set *set = xmalloc(sizeof *set); + struct set *set = xmalloc(sizeof(*set)); set->c = 0; set->sv = NULL; @@ -923,7 +923,7 @@ const char *set_fini(struct set *set, int bpp) set->sv[i].v = jenkins_hash(set->sv[i].s) & mask; /* sort by hash value */ - qsort(set->sv, set->c, sizeof *set->sv, cmp_sv); + qsort(set->sv, set->c, sizeof(*set->sv), cmp_sv); /* warn on hash collisions */ for (i = 0; i < set->c - 1; i++) { -- 1.7.3.2