public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/libdm libdm-config.c Date: Thu, 01 Sep 2011 14:02:00 -0000 [thread overview] Message-ID: <20110901140208.7987.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2011-09-01 14:02:07 Modified files: libdm : libdm-config.c Log message: Use const casting when it's needed Keep the lookup operation const and use const casting at the dm_ function level. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-config.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4 --- LVM2/libdm/libdm-config.c 2011/08/31 15:19:20 1.3 +++ LVM2/libdm/libdm-config.c 2011/09/01 14:02:05 1.4 @@ -809,8 +809,8 @@ /* * utility functions */ -static struct dm_config_node *_find_config_node(const void *start, - const char *path) +static const struct dm_config_node *_find_config_node(const void *start, + const char *path) { const char *e; const struct dm_config_node *cn = start; @@ -848,15 +848,15 @@ path = e; } - return (struct dm_config_node *) cn_found; + return cn_found; } -typedef struct dm_config_node *_node_lookup_fn(const void *start, const char *path); +typedef const struct dm_config_node *_node_lookup_fn(const void *start, const char *path); -static struct dm_config_node *_find_first_config_node(const void *start, const char *path) +static const struct dm_config_node *_find_first_config_node(const void *start, const char *path) { const struct dm_config_tree *cft = start; - struct dm_config_node *cn = NULL; + const struct dm_config_node *cn = NULL; while (cft) { if ((cn = _find_config_node(cft->root, path))) @@ -976,7 +976,7 @@ struct dm_config_node *dm_config_find_node(struct dm_config_node *cn, const char *path) { - return _find_config_node(cn, path); + return (struct dm_config_node *) _find_config_node(cn, path); } int dm_config_find_int(const struct dm_config_node *cn, const char *path, int fail)
next reply other threads:[~2011-09-01 14:02 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-09-01 14:02 zkabelac [this message] 2011-09-25 19:39 zkabelac 2011-09-25 19:40 zkabelac 2011-09-25 19:41 zkabelac 2011-09-25 19:42 zkabelac 2011-09-25 19:43 zkabelac 2011-09-25 19:45 zkabelac 2011-12-11 15:18 mornfall 2012-01-19 15:16 zkabelac 2012-01-23 17:47 agk 2012-02-28 17:46 agk
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=20110901140208.7987.qmail@sourceware.org \ --to=zkabelac@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).