From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Marios Makris <marios.makris@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 3/3] Changed nconv variable from long to int in /lib/bytes_by_prefix.c
Date: Mon, 14 May 2012 15:24:56 +0800 [thread overview]
Message-ID: <4FB0B348.3020601@cn.fujitsu.com> (raw)
In-Reply-To: <1336655089-26941-3-git-send-email-marios.makris@gmail.com>
On 05/10/2012 09:04 PM, Marios Makris wrote:
> According to sscanf man page the return value is int
> therefore the holding variable should be int as well.
>
> Also changed the loop variable name of the main method
> from ind to i in order to better represent that it is
> just a loop variable.
>
> Signed-off-by: Marios Makris <marios.makris@gmail.com>
But Marios,
In the previous patch, you changed the library function
from str_to_bytes to bytes_by_prefix, if you'd prefer
the latter name, please also replace the using of str_to_bytes
with the new name, if not, it'll not be compiled.
Thanks,
Wanlong Gao
> ---
> lib/bytes_by_prefix.c | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/lib/bytes_by_prefix.c b/lib/bytes_by_prefix.c
> index b9ac565..eebff83 100644
> --- a/lib/bytes_by_prefix.c
> +++ b/lib/bytes_by_prefix.c
> @@ -108,7 +108,7 @@ int bytes_by_prefix(char *s)
> long lbytes_by_prefix(char *s)
> {
> char mult, junk;
> - long nconv;
> + int nconv;
> float num;
>
> nconv = sscanf(s, "%f%c%c", &num, &mult, &junk);
> @@ -145,7 +145,7 @@ long lbytes_by_prefix(char *s)
> long long llbytes_by_prefix(char *s)
> {
> char mult, junk;
> - long nconv;
> + int nconv;
> double num;
>
> nconv = sscanf(s, "%lf%c%c", &num, &mult, &junk);
> @@ -179,23 +179,23 @@ long long llbytes_by_prefix(char *s)
>
> main(int argc, char **argv)
> {
> - int ind;
> + int i;
>
> if (argc == 1) {
> fprintf(stderr, "missing bytes_by_prefix() parameteres\n");
> exit(1);
> }
>
> - for (ind = 1; ind < argc; ind++) {
> + for (i = 1; i < argc; i++) {
>
> printf("bytes_by_prefix(%s) returned %d\n",
> - argv[ind], bytes_by_prefix(argv[ind]));
> + argv[i], bytes_by_prefix(argv[i]));
>
> printf("lbytes_by_prefix(%s) returned %ld\n",
> - argv[ind], lbytes_by_prefix(argv[ind]));
> + argv[i], lbytes_by_prefix(argv[i]));
>
> printf("llbytes_by_prefix(%s) returned %lld\n",
> - argv[ind], llbytes_by_prefix(argv[ind]));
> + argv[i], llbytes_by_prefix(argv[i]));
> }
> }
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2012-05-14 7:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1336655089-26941-1-git-send-email-marios.makris@gmail.com>
2012-05-14 7:15 ` [LTP] [PATCH 1/3] Indentation and coding style fixes on /lib/str_to_bytes.c as well as /include/str_to_bytes.h Wanlong Gao
2012-05-16 14:23 ` Cyril Hrubis
[not found] ` <1336655089-26941-2-git-send-email-marios.makris@gmail.com>
2012-05-14 7:16 ` [LTP] [PATCH 2/3] Renamed /lib/str_to_bytes.c and /include str_to bytes.h Wanlong Gao
[not found] ` <1336655089-26941-3-git-send-email-marios.makris@gmail.com>
2012-05-14 7:24 ` Wanlong Gao [this message]
2012-05-15 11:51 ` [LTP] [PATCH 3/3] Changed nconv variable from long to int in /lib/bytes_by_prefix.c Marioh mrs
2012-05-15 12:02 ` Wanlong Gao
2012-05-15 12:36 ` Marioh mrs
2012-05-15 12:50 ` Wanlong Gao
2012-05-15 12:58 ` Marioh mrs
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=4FB0B348.3020601@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=marios.makris@gmail.com \
/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
Be 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