git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan McGee <dpmcgee@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix type-punning issues
Date: Mon, 18 May 2009 23:32:48 -0500	[thread overview]
Message-ID: <449c10960905182132h2c1b38b4jd28721adaeb38484@mail.gmail.com> (raw)
In-Reply-To: <7vy6t292ix.fsf@alter.siamese.dyndns.org>

On Tue, May 12, 2009 at 2:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Dan McGee <dpmcgee@gmail.com> writes:
>
>> In these two places we are casting part of our unsigned char sha1 array into
>> an unsigned int, which violates GCCs strict-aliasing rules (and probably
>> other compilers).
>
> Yay.
>

> It might make more sense to have one canonical
>
>        unsigned int hash_obj(const struct object *obj, unsigned int n)
>
> here, export it to object.h, and remove the one in decorate.c.
>
> Or am I missing something?

(argh: sorry Junio for sending the last reply to just you)

So due to me taking so long to resubmit, I see you committed a
stripped-down version of my patch. I had a patch just like this (minus
one newline diff), but it was in a series of 4 I will submit in just a
second.

The three remaining patches implement the above suggestion of having
one canonical "hash" function. However, the name changes to hash_char
and takes a unsigned char pointer rather than a struct object pointer
so we can use the same function for both insertion into the hashes as
well as lookup.

Looking forward to any feedback.

-Dan

  reply	other threads:[~2009-05-19  4:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12  1:17 [PATCH] Fix type-punning issues Dan McGee
2009-05-12  7:57 ` Junio C Hamano
2009-05-19  4:32   ` Dan McGee [this message]
2009-05-19  4:34     ` [PATCH 1/3] Unify signedness in hashing calls Dan McGee
2009-05-19  4:34       ` [PATCH 2/3] Convert hash functions to char instead of struct object Dan McGee
2009-05-19  4:34         ` [PATCH 3/3] Unify sha1 char hash functions Dan McGee
2009-05-19  6:23         ` [PATCH 2/3] Convert hash functions to char instead of struct object Johannes Sixt
2009-05-19  7:04           ` Junio C Hamano
2009-05-12  8:13 ` [PATCH] Fix type-punning issues Johannes Schindelin

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=449c10960905182132h2c1b38b4jd28721adaeb38484@mail.gmail.com \
    --to=dpmcgee@gmail.com \
    --cc=git@vger.kernel.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: 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).