From: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
To: Morten Welinder <mwelinder@gmail.com>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] Use fixed-size integers for .idx file I/O
Date: Thu, 18 Jan 2007 15:56:06 +0100 [thread overview]
Message-ID: <45AF8A86.7070101@fs.ei.tum.de> (raw)
In-Reply-To: <118833cc0701180651w3b5ac164m4e396399f1d58cb7@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 794 bytes --]
Morten Welinder wrote:
>> - return ntohl(*((unsigned int *) ((char *)
>> index + (24 * mi))));
>> + return ntohl(*((uint32_t *)((char *)index +
>> (24 * mi))));
>
> Is that pointer gymnastics guaranteed to work? I.e., how do we know
> that we can access an uint32_t (or unsigned) at such an address?
if index is always aligned to a 4-byte boundary, this is safe. apart from that, the problem already existed.
cheers
simon
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2007-01-18 14:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-18 7:24 [PATCH 2/2] Use fixed-size integers for .idx file I/O Junio C Hamano
2007-01-18 14:51 ` Morten Welinder
2007-01-18 14:56 ` Simon 'corecode' Schubert [this message]
2007-01-18 15:15 ` Johannes Schindelin
2007-01-18 15:21 ` Shawn O. Pearce
2007-01-18 15:30 ` 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=45AF8A86.7070101@fs.ei.tum.de \
--to=corecode@fs.ei.tum.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=mwelinder@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.