From: "Kirill A. Shutsemov" <kirill@shutemov.name> To: "Dmitry V. Levin" <ldv@altlinux.org>, Alexey Tourbin <at@altlinux.ru> Cc: "Alexey I. Froloff" <raorn@altlinux.org>, devel@lists.altlinux.org, Alexey Gladkov <legion@altlinux.ru>, "Kirill A. Shutemov" <kirill@shutemov.name> Subject: [devel] [PATCH 6/8] set.c: use function-like syntax for sizeof. Date: Tue, 16 Nov 2010 17:56:40 +0200 Message-ID: <1289923002-14132-7-git-send-email-kirill@shutemov.name> (raw) In-Reply-To: <1289923002-14132-1-git-send-email-kirill@shutemov.name> From: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> --- 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
next prev parent reply other threads:[~2010-11-16 15:56 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-11-16 15:56 [devel] [PATCH 0/8] rpm: cleanup set.c and set.h Kirill A. Shutsemov 2010-11-16 15:56 ` [devel] [PATCH 1/8] set.c, set.h: get rid of C++-style comments Kirill A. Shutsemov 2010-11-16 15:56 ` [devel] [PATCH 2/8] set.c: get rid of nested functions Kirill A. Shutsemov 2010-11-16 22:14 ` Dmitry V. Levin 2010-11-16 22:54 ` Kirill A. Shutemov 2010-11-16 23:07 ` Dmitry V. Levin 2010-11-16 23:10 ` Kirill A. Shutemov 2010-11-17 17:55 ` Dmitry V. Levin 2010-11-16 15:56 ` [devel] [PATCH 3/8] set.c: fixup self-test functions declaration Kirill A. Shutsemov 2010-11-16 15:56 ` [devel] [PATCH 4/8] set.c: slightly reformat code to increase its readability Kirill A. Shutsemov 2010-11-16 15:56 ` [devel] [PATCH 5/8] set.c: do not mix declarations and code Kirill A. Shutsemov 2010-11-16 15:56 ` Kirill A. Shutsemov [this message] 2010-11-16 15:56 ` [devel] [PATCH 7/8] set.c: cleanup self-tests Kirill A. Shutsemov 2010-11-16 15:56 ` [devel] [PATCH 8/8] set.c: update copyright notice Kirill A. Shutsemov 2010-11-22 5:49 ` Alexey Tourbin 2010-11-23 0:48 ` Alexey Tourbin 2010-11-23 0:56 ` Dmitry V. Levin 2010-11-23 1:38 ` Alexey Tourbin 2010-11-23 6:42 ` Kirill A. Shutemov 2010-11-23 11:50 ` Alexey Tourbin 2010-11-25 22:02 ` Kirill A. Shutemov 2010-11-26 18:03 ` Michael Shigorin 2010-11-17 6:59 ` [devel] [PATCH 0/8] rpm: cleanup set.c and set.h REAL 2010-11-22 5:40 ` Alexey Tourbin 2010-11-22 7:14 ` Kirill A. Shutemov 2010-11-22 7:38 ` Alexey Tourbin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1289923002-14132-7-git-send-email-kirill@shutemov.name \ --to=kirill@shutemov.name \ --cc=at@altlinux.ru \ --cc=devel@lists.altlinux.org \ --cc=ldv@altlinux.org \ --cc=legion@altlinux.ru \ --cc=raorn@altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git