Patchwork pathencode: eliminate signed integer warnings

login
register
mail settings
Submitter Danek Duvall
Date Feb. 19, 2014, 9:16 p.m.
Message ID <20140219211631.GV109@smelly.us.oracle.com>
Download mbox | patch
Permalink /patch/3703/
State Accepted
Headers show

Comments

Danek Duvall - Feb. 19, 2014, 9:16 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1392844284 28800
#      Wed Feb 19 13:11:24 2014 -0800
# Node ID ad3388693673ef87a4368cb00a14b4a858c37b72
# Parent  0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
pathencode: eliminate signed integer warnings

Compiling mercurial with the Sun Studio compiler gives seven copies of the
following warning on pathencode.c:

    line 533: warning: initializer will be sign-extended: -1

Using explicit unsigned literals silences it.
Matt Mackall - Feb. 19, 2014, 10:48 p.m.
On Wed, 2014-02-19 at 13:16 -0800, Danek Duvall wrote:
> # HG changeset patch
> # User Danek Duvall <danek.duvall@oracle.com>
> # Date 1392844284 28800
> #      Wed Feb 19 13:11:24 2014 -0800
> # Node ID ad3388693673ef87a4368cb00a14b4a858c37b72
> # Parent  0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
> pathencode: eliminate signed integer warnings

Queued for the stable branch, thanks. Please use --flag stable for
bugfixes.

Patch

diff --git a/mercurial/pathencode.c b/mercurial/pathencode.c
--- a/mercurial/pathencode.c
+++ b/mercurial/pathencode.c
@@ -530,7 +530,7 @@  static Py_ssize_t auxencode(char *dest, 
 	static const uint32_t twobytes[8];
 
 	static const uint32_t onebyte[8] = {
-		~0, 0xffff3ffe, ~0, ~0, ~0, ~0, ~0, ~0,
+		~0U, 0xffff3ffe, ~0U, ~0U, ~0U, ~0U, ~0U, ~0U,
 	};
 
 	return _encode(twobytes, onebyte, dest, 0, destsize, src, len, 0);