mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: Re: [PATCH 3/4] String: expand to word-at-a-time
Date: Sun, 3 Feb 2013 18:24:20 -0800	[thread overview]
Message-ID: <20130203182420.0349d5b2.idunham@lavabit.com> (raw)
In-Reply-To: <1359936735-31915-4-git-send-email-nwmcsween@gmail.com>

On Mon,  4 Feb 2013 00:12:14 +0000
Nathan McSween <nwmcsween@gmail.com> wrote:

> -int strcmp(const char *l, const char *r)
> +/**
> + * strcmp - Word sized c standard strcmp.
> + * @c: Comparative
> + * @s: Source
> + */
I have a few comments:

1: Why "comparative" and "source" instead of left/right?
Source implies that there's copying going on, which there isn't (at least in terms of the API).
s1/s2 or l/r is much more understandable.

2: For that many lines, you might as well explain what's going on:
/* Indicate whether string c is less than, greater than, or
equal to string s */
The comments are useless without the standard, and superfluous 
with it.

> +#undef strcmp
Huh?
I don't see why this is needed, unless you messed up your build environment.

> +int strcmp(const char *c, const char *s)

What's the effect of all this on size of the binary?
I see that all this ends up adding ~150 lines.

Is shortening the length of the variable names really useful?

-- 
Isaac Dunham <idunham@lavabit.com>



  reply	other threads:[~2013-02-04  2:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04  0:12 [PATCH 0/4] Refactor and expand string functions Nathan McSween
2013-02-04  0:12 ` [PATCH 1/4] Internal: Add word.h - word-at-a-time fns / macros Nathan McSween
2013-02-04  0:12 ` [PATCH 2/4] String: refactor to utilize word.h and optimize Nathan McSween
2013-02-04  0:12 ` [PATCH 3/4] String: expand to word-at-a-time Nathan McSween
2013-02-04  2:24   ` Isaac Dunham [this message]
2013-02-04  2:55     ` nwmcsween
2013-02-04  0:12 ` [PATCH 4/4] String: refactor to utilize word.h and always terminate string Nathan McSween
2013-02-05  4:25 ` [PATCH 0/4] Refactor and expand string functions Nathan McSween
2013-02-05 11:19   ` Szabolcs Nagy
2013-02-05 14:05     ` Rich Felker
2013-02-05 15:05       ` Szabolcs Nagy

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=20130203182420.0349d5b2.idunham@lavabit.com \
    --to=idunham@lavabit.com \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).