mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@gmail.com>
To: Phillip Lougher <phillip@lougher.demon.co.uk>
Cc: "Jörn Engel" <joern@wohnheim.fh-wedel.de>,
	linux-kernel@vger.kernel.org, penberg@cs.helsinki.fi
Subject: Re: [PATCH] remove some usesless casts
Date: Thu, 21 Apr 2005 09:36:18 +0300	[thread overview]
Message-ID: <84144f0205042023366dc0b16@mail.gmail.com> (raw)
In-Reply-To: <4266C0C3.7070002@lougher.demon.co.uk>

Phillip,

Jörn Engel wrote:
> > Your definition of _unnecessary_ casts may differ from mine.
> > Basically, every cast is unnecessary, except for maybe one or two - if
> > that many.

On 4/20/05, Phillip Lougher <phillip@lougher.demon.co.uk> wrote:
> Well we agree to differ then.  In my experience casts are sometimes
> necessary, and are often less clumsy than the alternatives (such as
> unions).  This is probably a generational thing, the fashion today is to
> make languages much more strongly typechecked than before.

I think Jörn means that if you need an opaque data type, use void
pointers (which are automatically cast to the proper type) and that
all other casts are a design smell (except for the one or two special
cases where you actually need them).

                                 Pekka

  parent reply	other threads:[~2005-04-21  6:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-20  6:55 Jörn Engel
2005-04-20 15:20 ` Phillip Lougher
2005-04-20 21:33   ` Jörn Engel
2005-04-20 20:51     ` Phillip Lougher
2005-04-21  1:06       ` Jörn Engel
2005-04-21  6:36       ` Pekka Enberg [this message]
2005-04-21  6:48         ` Jörn Engel
2005-04-21  1:08 ` [PATCH 2/4] squashfs: kmalloc (less stack, less casts) Jörn Engel
2005-04-21  1:10   ` [PATCH 3/4] squashfs: (void*)ify squashfs_get_cached_block Jörn Engel
2005-04-21  1:11     ` [PATCH 4/4] squashfs: (void*)ify squashfs_read_data Jörn Engel
2005-04-22  7:20       ` [PATCH 5/10] squashfs: (void*)ify read_blocklist Jörn Engel
2005-04-22  7:22         ` [PATCH 6/10] squashfs: conserve stack, remove casts Jörn Engel
2005-04-22  7:22           ` [PATCH 6/10] squashfs: remove one cast Jörn Engel
2005-04-22  7:23             ` [PATCH 8/10] squashfs: add swabbing infrastructure Jörn Engel
2005-04-22  7:24               ` [PATCH 9/10] squashfs: remove some more casts Jörn Engel
2005-04-22  7:25                 ` [PATCH 9/10] squashfs: first use of swabbing Jörn Engel
2005-04-22  7:52               ` [PATCH 8/10] squashfs: add swabbing infrastructure Jörn Engel
2005-04-22  7:26             ` [PATCH 6/10] squashfs: remove one cast Jörn Engel

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=84144f0205042023366dc0b16@mail.gmail.com \
    --to=penberg@gmail.com \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=phillip@lougher.demon.co.uk \
    /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

all inboxes | Powered by JetHome®