linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Rafi Rubin <rafi@seas.upenn.edu>
Cc: linux-input@vger.kernel.org, jkosina@suse.cz, chatty@enac.fr,
	evilynux@gmail.com
Subject: Re: [PATCH] HID: Major update to N-Trig touchscreen
Date: Thu, 4 Feb 2010 21:53:02 -0800	[thread overview]
Message-ID: <20100205055302.GA17121@core.coreip.homeip.net> (raw)
In-Reply-To: <1265341963-5315-1-git-send-email-rafi@seas.upenn.edu>

On Thu, Feb 04, 2010 at 10:52:43PM -0500, Rafi Rubin wrote:
 +
> +		if (matched < nd->contact_count) {
> +			for (i = 0; i < nd->contact_count; i++) {
> +				if (nd->contacts[i].logical_id < 0) {
> +					for (j = 0; j < nd->prev_contact_count;
> +					     j++) {
> +						if (nd->
> +						    prev_contacts[j].confidence
> +						    &&
> +						    (contact_map
> +						     [nd->
> +						      prev_contacts
> +						      [j].logical_id] < 0)
> +						    &&
> +						    (abs
> +						     (nd->contacts[i].x -
> +						      nd->prev_contacts[j].x) <
> +						     nd->max_width)
> +						    &&
> +						    (abs
> +						     (nd->contacts[i].y -
> +						      nd->prev_contacts[j].y) <
> +						     nd->max_height)) {
> +							nd->contacts
> +							    [i].logical_id =
> +							    nd->prev_contacts
> +							    [j].logical_id;
> +							contact_map
> +							    [nd->prev_contacts
> +							     [j].logical_id]
> +							    = i;
> +							matched++;

OK, this kind code just makes me want to poke my eyes with a fork... 5
times...

Seriously, either factor it out into a nice function, or say "screw it"
to the 80 columt limit, or maybe both. Anything but this.

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2010-02-05  5:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  3:52 [PATCH] HID: Major update to N-Trig touchscreen Rafi Rubin
2010-02-05  4:16 ` Rafi Rubin
2010-02-05  5:53 ` Dmitry Torokhov [this message]
2010-02-05  7:27   ` Rafi Rubin
2010-02-05 10:39   ` Jiri Kosina
2010-02-06  0:50   ` Rafi Rubin
2010-02-05  9:40 ` Antonio Ospite
2010-02-06  0:44 Rafi Rubin
2010-02-06  0:57 ` Rafi Rubin
2010-02-06  0:56 Rafi Rubin
2010-02-06  1:01 Rafi Rubin
2010-02-06  1:03 ` Rafi Rubin
2010-02-08 15:49   ` Jiri Kosina
2010-02-08 16:45     ` Rafi Rubin

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=20100205055302.GA17121@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=chatty@enac.fr \
    --cc=evilynux@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=rafi@seas.upenn.edu \
    /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;
as well as URLs for NNTP newsgroup(s).