<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/git.git/compat/regex, branch pb/commit-editmsg-path</title>
<subtitle>github.com: git/git.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/'/>
<entry>
<title>Silence GCC's "cast of pointer to integer of a different size" warning</title>
<updated>2015-10-26T20:24:03+00:00</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2015-10-26T13:15:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=56a1a3ab449df33268776a8b72a301d3ee67ad8d'/>
<id>56a1a3ab449df33268776a8b72a301d3ee67ad8d</id>
<content type='text'>
When calculating hashes from pointers, it actually makes sense to cut
off the most significant bits. In that case, said warning does not make
a whole lot of sense.

So let's just work around it by casting the pointer first to intptr_t
and then casting up/down to the final integral type.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When calculating hashes from pointers, it actually makes sense to cut
off the most significant bits. In that case, said warning does not make
a whole lot of sense.

So let's just work around it by casting the pointer first to intptr_t
and then casting up/down to the final integral type.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>C: have space around &amp;&amp; and || operators</title>
<updated>2013-10-16T17:26:39+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-16T17:26:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=c01499ef6933bd0e3fc65277559dc80f13d6a49e'/>
<id>c01499ef6933bd0e3fc65277559dc80f13d6a49e</id>
<content type='text'>
Correct all hits from

    git grep -e '\(&amp;&amp;\|||\)[^ ]' -e '[^	 ]\(&amp;&amp;\|||\)' -- '*.c'

i.e. &amp;&amp; or || operators that are followed by anything but a SP,
or that follow something other than a SP or a HT, so that these
operators have a SP around it when necessary.

We usually refrain from making this kind of a tree-wide change in
order to avoid unnecessary conflicts with other "real work" patches,
but in this case, the end result does not have a potentially
cumbersome tree-wide impact, while this is a tree-wide cleanup.

Fixes to compat/regex/regcomp.c and xdiff/xemit.c are to replace a
HT immediately after &amp;&amp; with a SP.

This is based on Felipe's patch to bultin/symbolic-ref.c; I did all
the finding out what other files in the whole tree need to be fixed
and did the fix and also the log message while reviewing that single
liner, so any screw-ups in this version are mine.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Correct all hits from

    git grep -e '\(&amp;&amp;\|||\)[^ ]' -e '[^	 ]\(&amp;&amp;\|||\)' -- '*.c'

i.e. &amp;&amp; or || operators that are followed by anything but a SP,
or that follow something other than a SP or a HT, so that these
operators have a SP around it when necessary.

We usually refrain from making this kind of a tree-wide change in
order to avoid unnecessary conflicts with other "real work" patches,
but in this case, the end result does not have a potentially
cumbersome tree-wide impact, while this is a tree-wide cleanup.

Fixes to compat/regex/regcomp.c and xdiff/xemit.c are to replace a
HT immediately after &amp;&amp; with a SP.

This is based on Felipe's patch to bultin/symbolic-ref.c; I did all
the finding out what other files in the whole tree need to be fixed
and did the fix and also the log message while reviewing that single
liner, so any screw-ups in this version are mine.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>typofix: in-code comments</title>
<updated>2013-07-22T23:06:49+00:00</updated>
<author>
<name>Ondřej Bílka</name>
<email>neleai@seznam.cz</email>
</author>
<published>2013-07-22T21:02:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=749f763dbbe4dbcc4082f02bf98bfc1a09427c6f'/>
<id>749f763dbbe4dbcc4082f02bf98bfc1a09427c6f</id>
<content type='text'>
Signed-off-by: Ondřej Bílka &lt;neleai@seznam.cz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ondřej Bílka &lt;neleai@seznam.cz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compat/regex/regexec.c: Fix some sparse warnings</title>
<updated>2013-04-28T19:24:18+00:00</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2013-04-27T18:43:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=5b62e6374aabb20297b22bdd72952ff582b2198b'/>
<id>5b62e6374aabb20297b22bdd72952ff582b2198b</id>
<content type='text'>
Sparse issues an "Using plain integer as NULL pointer" warning along
with two "symbol was not declared. Should it be static?" type warnings
for the 'merge_state_with_log' and 'find_recover_state' functions.

In order to suppress the warnings, we replace the use of '0' as a null
pointer constant with NULL and add the static modifier to the function
definitions.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sparse issues an "Using plain integer as NULL pointer" warning along
with two "symbol was not declared. Should it be static?" type warnings
for the 'merge_state_with_log' and 'find_recover_state' functions.

In order to suppress the warnings, we replace the use of '0' as a null
pointer constant with NULL and add the static modifier to the function
definitions.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compat/regex: fix spelling and grammar in comments</title>
<updated>2013-04-12T19:23:44+00:00</updated>
<author>
<name>Stefano Lattarini</name>
<email>stefano.lattarini@gmail.com</email>
</author>
<published>2013-04-11T22:36:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=ce9171cd63dc64bd6cfcbb09df630774b2b2a99c'/>
<id>ce9171cd63dc64bd6cfcbb09df630774b2b2a99c</id>
<content type='text'>
Some of these were found using Lucas De Marchi's codespell tool.
Others noticed by Eric Sunshine.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Stefano Lattarini &lt;stefano.lattarini@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Acked-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some of these were found using Lucas De Marchi's codespell tool.
Others noticed by Eric Sunshine.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Stefano Lattarini &lt;stefano.lattarini@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Acked-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix compat/regex ANSIfication on MinGW</title>
<updated>2010-08-26T16:25:53+00:00</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2010-08-26T07:58:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=ce518bbd6c891f1b9e172b8cb9212c05d731c18e'/>
<id>ce518bbd6c891f1b9e172b8cb9212c05d731c18e</id>
<content type='text'>
compat/regexec.c had a weird combination of function declaration in ANSI
style and function definition in K&amp;R style, for example:

 static unsigned
 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
      int nregs, int regs_allocated) internal_function;

 static unsigned
 re_copy_regs (regs, pmatch, nregs, regs_allocated)
     struct re_registers *regs;
     regmatch_t *pmatch;
     int nregs, regs_allocated;
 { ... }

with this #define:

 #ifndef _LIBC
 # ifdef __i386__
 #  define internal_function   __attribute ((regparm (3), stdcall))
 # else
 #  define internal_function
 # endif
 #endif

The original version as shown above was fine, but with the ANSIfied
function definition and in the case where internal_function is not empty,
gcc identifies the declaration and definition as different and bails out.

Adding internal_function to the definition doesn't help (it results in
a syntax error); hence, remove it from the subset of declarations that gcc
flags as erroneous.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
compat/regexec.c had a weird combination of function declaration in ANSI
style and function definition in K&amp;R style, for example:

 static unsigned
 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
      int nregs, int regs_allocated) internal_function;

 static unsigned
 re_copy_regs (regs, pmatch, nregs, regs_allocated)
     struct re_registers *regs;
     regmatch_t *pmatch;
     int nregs, regs_allocated;
 { ... }

with this #define:

 #ifndef _LIBC
 # ifdef __i386__
 #  define internal_function   __attribute ((regparm (3), stdcall))
 # else
 #  define internal_function
 # endif
 #endif

The original version as shown above was fine, but with the ANSIfied
function definition and in the case where internal_function is not empty,
gcc identifies the declaration and definition as different and bails out.

Adding internal_function to the definition doesn't help (it results in
a syntax error); hence, remove it from the subset of declarations that gcc
flags as erroneous.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compat/regex: get rid of old-style definition</title>
<updated>2010-08-19T22:46:06+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-08-19T22:31:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=178b33157aba98e34f641408105be54f42cbe5bc'/>
<id>178b33157aba98e34f641408105be54f42cbe5bc</id>
<content type='text'>
These files mostly used ANSI style function definitions, but with small
number of old-style ones.  Convert them to consistently use ANSI style.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These files mostly used ANSI style function definitions, but with small
number of old-style ones.  Convert them to consistently use ANSI style.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compat/regex: define out variables only used under RE_ENABLE_I18N</title>
<updated>2010-08-19T20:00:44+00:00</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2010-08-19T18:30:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=b50f37098fcf7efb097c01daa3d60df8b9704025'/>
<id>b50f37098fcf7efb097c01daa3d60df8b9704025</id>
<content type='text'>
Wrap variables that were only used RE_ENABLE_I18N in `#ifdef
RE_ENABLE_I18N`. This eliminates compiler warnings when compiling with
NO_REGEX=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wrap variables that were only used RE_ENABLE_I18N in `#ifdef
RE_ENABLE_I18N`. This eliminates compiler warnings when compiling with
NO_REGEX=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Change regerror() declaration from K&amp;R style to ANSI C (C89)</title>
<updated>2010-08-18T21:06:54+00:00</updated>
<author>
<name>Frank Li</name>
<email>lznuaa@gmail.com</email>
</author>
<published>2010-08-17T09:24:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=de831726decd9c2fcaf7c71136560cf6f5c38a59'/>
<id>de831726decd9c2fcaf7c71136560cf6f5c38a59</id>
<content type='text'>
The MSVC headers typedef errcode as int, and thus confused the compiler in
the K&amp;R style definition. ANSI style deconfuses it.

This patch was originally applied as v1.6.5-rc2~23 but needs to be
re-applied since compat/regex was overwritten by Ævar Arnfjörð
Bjarmason with the gawk regex engine.

Signed-off-by: Frank Li &lt;lznuaa@gmail.com&gt;
Signed-off-by: Marius Storm-Olsen &lt;mstormo@gmail.com&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The MSVC headers typedef errcode as int, and thus confused the compiler in
the K&amp;R style definition. ANSI style deconfuses it.

This patch was originally applied as v1.6.5-rc2~23 but needs to be
re-applied since compat/regex was overwritten by Ævar Arnfjörð
Bjarmason with the gawk regex engine.

Signed-off-by: Frank Li &lt;lznuaa@gmail.com&gt;
Signed-off-by: Marius Storm-Olsen &lt;mstormo@gmail.com&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compat/regex: get the gawk regex engine to compile within git</title>
<updated>2010-08-18T21:06:54+00:00</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2010-08-17T09:24:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=a997bf423d4baac5b2286edccd1cef897108397f'/>
<id>a997bf423d4baac5b2286edccd1cef897108397f</id>
<content type='text'>
We need to define -DGAWK -DNO_MBSUPPORT so that the gawk regex engine
will compile, and include stdio.h and stddef.h in regex.h. Gawk itself
includes these headers before it includes the regex.h header.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to define -DGAWK -DNO_MBSUPPORT so that the gawk regex engine
will compile, and include stdio.h and stddef.h in regex.h. Gawk itself
includes these headers before it includes the regex.h header.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
