public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Junio C Hamano <gitster@pobox•com>
Cc: clement.poulain@ensimag•imag.fr, <git@vger•kernel.org>,
	Axel Bonnet <axel.bonnet@ensimag•imag.fr>
Subject: Re: What's cooking in git.git (Jun 2010, #02; Wed, 16)
Date: Fri, 18 Jun 2010 08:30:33 +0200	[thread overview]
Message-ID: <vpq8w6cc0om.fsf@bauges.imag.fr> (raw)
In-Reply-To: <7vmxut1b8v.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu\, 17 Jun 2010 16\:37\:52 -0700")

Junio C Hamano <gitster@pobox•com> writes:

> Clément Poulain <clement.poulain@ensimag•imag.fr> writes:
>
>> A fix was proposed here:
>> http://mid.gmane.org/1276610328-28532-1-git-send-email-axel.bonnet@ensimag.imag.fr
>
> This one changes textconv_object() to take a pointer to ulong*; a caller
> is changed to cast a long* down to that pointer (in
> fill_origin_blob);

Isn't sign-casting safe? If not, then the existing call to
read_sha1_file should be fixed too:

-file->ptr = read_sha1_file(o->blob_sha1, &type,
-   (unsigned long *)(&(file->size)));
[...]
+file->ptr = read_sha1_file(o->blob_sha1, &type,
+   (unsigned long *)(&(file->size)));

(it's been there for a while)

>     The only portable way in C to convert between types is by assignment. So
>     you have to do:
>
>       unsigned long foo;
>       textconv_object(read_from, null_sha1, &buf.buf, &foo);
>       buf.len = foo;

This is what the patch does a little later:

+unsigned long buf_len;
[...]
+if (DIFF_OPT_TST(opt, ALLOW_TEXTCONV) &&
+    textconv_object(read_from, null_sha1, &buf.buf, &buf_len))
+buf.len = buf_len;

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2010-06-18  6:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17  2:03 What's cooking in git.git (Jun 2010, #02; Wed, 16) Junio C Hamano
2010-06-17 11:35 ` Ævar Arnfjörð Bjarmason
2010-06-17 16:24 ` Junio C Hamano
2010-06-17 16:42   ` Philippe Bruhat (BooK)
2010-06-17 18:16   ` Ævar Arnfjörð Bjarmason
2010-06-17 19:05   ` Clément Poulain
2010-06-17 23:37     ` Junio C Hamano
2010-06-18  6:30       ` Matthieu Moy [this message]
2010-06-21 18:35   ` Zhang Le
2010-06-17 20:10 ` [PATCH v2] send-email: ask about and declare 8bit mails Thomas Rast

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=vpq8w6cc0om.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=axel.bonnet@ensimag$(echo .)imag.fr \
    --cc=clement.poulain@ensimag$(echo .)imag.fr \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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