git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/3] Apply obvious numerical cast for stupid C compilers.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 5, 2006, 05:35 UTC
Message-ID
<20061105053544.GA4193@spearce.org>

At least one (older) version of the Solaris C compiler won't allow 'unsigned long x = -1' without explicitly casting -1 to a type of unsigned long. As annoying as it may be to explicitly perform the cast the compiler is right; -1 is not an unsigned value.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 builtin-apply.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index db7cdce..d7b3cea 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -43,7 +43,7 @@ static int apply_verbosely;
 static int no_add;
 static int show_index_info;
 static int line_termination = '\n';
-static unsigned long p_context = -1;
+static unsigned long p_context = (unsigned long)-1;
 static const char apply_usage[] =
 "git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=<nowarn|warn|error|error-all|strip>] <patch>...";
 
-- 
1.4.3.3.g9621
Next: Junio C Hamano
Message 1 of 2 in “Apply obvious numerical cast for stupid C compilers.”
  1. 1/3 Apply obvious numerical cast for stupid C compilers.Shawn O. Pearce, Nov 5, 2006
  2. Junio C HamanoNov 5, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.