Re: [PATCH 03/21] Refactoring to make verify_tag() and parse_tag_buffer() more similar

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Friday, June 8, 2007 - 7:54 pm

Hi,

On Sat, 9 Jun 2007, Johan Herland wrote:


Why this rename from buffer to data?


Why this change of order?


Are you sure that your buffer is always NUL terminated?


Quite a lot of changes seem to do this object->data. The patch would have 
been much more compact if you just had renamed buffer to object instead of 
data.


This renaming variables has nothing to do with refactoring. In fact, I 
have a hard time to find code changes (which your subject suggests, as you 
want to make two functions more similar).


Any particular reason for this?


Ah, so you terminate the buffer here. From the patch, it is relatively 
hard to see if this line is always hit _before_ the function is called 
that evidently relies on NUL termination. By moving it here, I think it is 
much more likely to overlook the fact that the function, which made sure 
that its assumption was met, needs this line. Whereas if you left it where 
it was, the assumption would always be met.


Again, this has nothing to do with refactoring.


Is this really necessary? Even if (which I doubt), it has nothing to do 
with refactoring.

If you _want_ to _explicitely_ do arithmetic on a char* instead of void*, 
why not DRT and change the function signature?


I am really reluctant with renamings like these. IMHO they don't buy you 
much, except for possible confusion. It is evident that sig means the 
signer (and it is obvious in the case of an unsigned tag, who is meant, 
too).


This cast (and indeed, this function, if you ask me) is unnecessary.

I reviewed only this patch out of your long series, mostly because I found 
the subject line interesting. But IMHO the patch does not what the subject 
line suggests.

Unfortunately, it's unlikely that I will have time until Monday night to 
continue with this patch series.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/21] Refactor the tag object (take 2), Johan Herland, (Fri Jun 8, 5:10 pm)
[PATCH 02/21] Return error messages when parsing fails., Johan Herland, (Fri Jun 8, 5:13 pm)
[PATCH 09/21] Remove unneeded code from mktag.c, Johan Herland, (Fri Jun 8, 5:16 pm)
[PATCH 10/21] Free mktag's buffer before dying, Johan Herland, (Fri Jun 8, 5:16 pm)
[PATCH 17/21] Update comments on tag objects in mktag.c, Johan Herland, (Fri Jun 8, 5:20 pm)
Re: [PATCH 03/21] Refactoring to make verify_tag() and par ..., Johannes Schindelin, (Fri Jun 8, 7:54 pm)
Re: [PATCH 10/21] Free mktag's buffer before dying, Alex Riesen, (Sat Jun 9, 2:37 pm)
Re: [PATCH 09/21] Remove unneeded code from mktag.c, Alex Riesen, (Sat Jun 9, 2:39 pm)
Re: [PATCH 09/21] Remove unneeded code from mktag.c, Johan Herland, (Sat Jun 9, 2:42 pm)
Re: [PATCH 10/21] Free mktag's buffer before dying, Johan Herland, (Sat Jun 9, 2:46 pm)
Re: [PATCH 10/21] Free mktag's buffer before dying, Alex Riesen, (Sat Jun 9, 3:00 pm)
Re: [PATCH 10/21] Free mktag's buffer before dying, Johan Herland, (Sat Jun 9, 3:05 pm)
Re: [PATCH 05/21] Make parse_tag_buffer_internal() handle ..., Johannes Schindelin, (Sun Jun 10, 1:06 am)
Re: [PATCH 06/21] Refactor tag name verification loop to u ..., Johannes Schindelin, (Sun Jun 10, 1:14 am)
Re: [PATCH 07/21] Copy the remaining differences from veri ..., Johannes Schindelin, (Sun Jun 10, 1:22 am)
Re: [PATCH 10/21] Free mktag's buffer before dying, Johannes Schindelin, (Sun Jun 10, 1:38 am)
Re: [PATCH 11/21] Rewrite error messages; fix up line lengths, Johannes Schindelin, (Sun Jun 10, 1:38 am)
Re: [PATCH 12/21] Use prefixcmp() instead of memcmp() for ..., Johannes Schindelin, (Sun Jun 10, 1:41 am)
Re: [PATCH 13/21] Collect skipping of header field names a ..., Johannes Schindelin, (Sun Jun 10, 1:45 am)
Re: [PATCH 06/21] Refactor tag name verification loop to u ..., Johannes Schindelin, (Sun Jun 10, 2:01 am)