<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/convert-objects.c, branch v1.5.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.5.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.5.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2007-04-19T02:26:33Z</updated>
<entry>
<title>fix up strtoul_ui error handling</title>
<updated>2007-04-19T02:26:33Z</updated>
<author>
<name>Andy Whitcroft</name>
<email>apw@shadowen.org</email>
</author>
<published>2007-04-19T02:08:15Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6e6db39afc305e1205a4d2dcf34680bfa80bfc24'/>
<id>urn:sha1:6e6db39afc305e1205a4d2dcf34680bfa80bfc24</id>
<content type='text'>
Two scanf() calls were converted to strtoul_ui() but the return
values were not updated to match.  scanf() returns the number of
matched "values" which for this usage is 1 on success.  strtoul_ui()
return 0 on success.  Update these call sites to match.

Signed-off-by: Andy Whitcroft &lt;apw@shadowen.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>sscanf/strtoul: parse integers robustly</title>
<updated>2007-04-15T02:47:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2007-04-09T23:01:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=61d6ed139ff572937c8ff342cfa16e40d2f9011e'/>
<id>urn:sha1:61d6ed139ff572937c8ff342cfa16e40d2f9011e</id>
<content type='text'>
* builtin-grep.c (strtoul_ui): Move function definition from here, to...
* git-compat-util.h (strtoul_ui): ...here, with an added "base" parameter.
* builtin-grep.c (cmd_grep): Update use of strtoul_ui to include base, "10".
* builtin-update-index.c (read_index_info): Diagnose an invalid mode integer
that is out of range or merely larger than INT_MAX.
(cmd_update_index): Use strtoul_ui, not sscanf.
* convert-objects.c (write_subdirectory): Likewise.

Signed-off-by: Jim Meyering &lt;jim@meyering.net&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>General const correctness fixes</title>
<updated>2007-03-07T18:47:10Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-07T01:44:17Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3a55602eeca4ac8670e8698a7187e18b95683344'/>
<id>urn:sha1:3a55602eeca4ac8670e8698a7187e18b95683344</id>
<content type='text'>
We shouldn't attempt to assign constant strings into char*, as the
string is not writable at runtime.  Likewise we should always be
treating unsigned values as unsigned values, not as signed values.

Most of these are very straightforward.  The only exception is the
(unnecessary) xstrdup/free in builtin-branch.c for the detached
head case.  Since this is a user-level interactive type program
and that particular code path is executed no more than once, I feel
that the extra xstrdup call is well worth the easy elimination of
this warning.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>convert object type handling from a string to a number</title>
<updated>2007-02-27T09:34:21Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nico@cam.org</email>
</author>
<published>2007-02-26T19:55:59Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=21666f1aae4e890d8f50924f9e80763b27e6a45d'/>
<id>urn:sha1:21666f1aae4e890d8f50924f9e80763b27e6a45d</id>
<content type='text'>
We currently have two parallel notation for dealing with object types
in the code: a string and a numerical value.  One of them is obviously
redundent, and the most used one requires more stack space and a bunch
of strcmp() all over the place.

This is an initial step for the removal of the version using a char array
found in object reading code paths.  The patch is unfortunately large but
there is no sane way to split it in smaller parts without breaking the
system.

Signed-off-by: Nicolas Pitre &lt;nico@cam.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>simplify inclusion of system header files.</title>
<updated>2006-12-20T17:51:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-12-19T22:34:12Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=85023577a8f4b540aa64aa37f6f44578c0c305a3'/>
<id>urn:sha1:85023577a8f4b540aa64aa37f6f44578c0c305a3</id>
<content type='text'>
This is a mechanical clean-up of the way *.c files include
system header files.

 (1) sources under compat/, platform sha-1 implementations, and
     xdelta code are exempt from the following rules;

 (2) the first #include must be "git-compat-util.h" or one of
     our own header file that includes it first (e.g. config.h,
     builtin.h, pkt-line.h);

 (3) system headers that are included in "git-compat-util.h"
     need not be included in individual C source files.

 (4) "git-compat-util.h" does not have to include subsystem
     specific header files (e.g. expat.h).

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>convert-objects: set _XOPEN_SOURCE to 600</title>
<updated>2006-11-15T22:57:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-11-15T22:57:47Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=73fbd33cce281f116852d02963935f2ae90acc76'/>
<id>urn:sha1:73fbd33cce281f116852d02963935f2ae90acc76</id>
<content type='text'>
Otherwise OpenBSD header files drop S_ISLNK() definition which is used in
an inline defined in cache.h

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Convert memcpy(a,b,20) to hashcpy(a,b).</title>
<updated>2006-08-23T20:53:10Z</updated>
<author>
<name>Shawn Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2006-08-23T06:49:00Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e702496e434a160f798447b95b9cea3cd138c140'/>
<id>urn:sha1:e702496e434a160f798447b95b9cea3cd138c140</id>
<content type='text'>
This abstracts away the size of the hash values when copying them
from memory location to memory location, much as the introduction
of hashcmp abstracted away hash value comparsion.

A few call sites were using char* rather than unsigned char* so
I added the cast rather than open hashcpy to be void*.  This is a
reasonable tradeoff as most call sites already use unsigned char*
and the existing hashcmp is also declared to be unsigned char*.

[jc: Splitted the patch to "master" part, to be followed by a
 patch for merge-recursive.c which is not in "master" yet.

 Fixed the cast in the latter hunk to combine-diff.c which was
 wrong in the original.

 Also converted ones left-over in combine-diff.c, diff-lib.c and
 upload-pack.c ]

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Do not use memcmp(sha1_1, sha1_2, 20) with hardcoded length.</title>
<updated>2006-08-17T21:23:53Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2006-08-17T18:54:57Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=a89fccd28197fa179828c8596791ff16e2268d20'/>
<id>urn:sha1:a89fccd28197fa179828c8596791ff16e2268d20</id>
<content type='text'>
Introduces global inline:

	hashcmp(const unsigned char *sha1, const unsigned char *sha2)

Uses memcmp for comparison and returns the result based on the length of
the hash name (a future runtime decision).

Acked-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix header breakage with _XOPEN_SOURCE.</title>
<updated>2006-08-02T07:27:48Z</updated>
<author>
<name>Ramsay Allan Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2006-07-30T15:52:09Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=da7bad50ed0816cf2ee7f558ed154a7c67fb546d'/>
<id>urn:sha1:da7bad50ed0816cf2ee7f558ed154a7c67fb546d</id>
<content type='text'>
convert-objects.c sets _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED before
including &lt;time.h&gt;, in order to get the declaration of strptime().
This leads to breakage in cache.h, due to S_ISLNK and S_IFLNK no longer
being defined by &lt;sys/stat.h&gt;.  These definitions are protected by the
__USE_BSD symbol, which is not set when _XOPEN_SOURCE is set.  Moving
the #defines and #include &lt;time.h&gt; below all other #includes does not
fix the problem, however, since now _USE_XOPEN, which protects the
declaration of strptime(), is now not defined (don't ask!).

The fix is to #define _GNU_SOURCE, which enables the definition of
practically everything.

Signed-off-by: Ramsay Allan Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Avoid C99 comments, use old-style C comments instead.</title>
<updated>2006-07-10T07:47:13Z</updated>
<author>
<name>Pavel Roskin</name>
<email>proski@gnu.org</email>
</author>
<published>2006-07-10T06:57:51Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=a9486b02ec7e03d17317fe538b0d06ca04379f23'/>
<id>urn:sha1:a9486b02ec7e03d17317fe538b0d06ca04379f23</id>
<content type='text'>
This doesn't make the code uglier or harder to read, yet it makes the
code more portable.  This also simplifies checking for other potential
incompatibilities.  "gcc -std=c89 -pedantic" can flag many incompatible
constructs as warnings, but C99 comments will cause it to emit an error.

Signed-off-by: Pavel Roskin &lt;proski@gnu.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
