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

[PATCH 0/2] Add missing const to char* declarations

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 22, 2011, 22:43 UTC
Message-ID
<1298414603-22338-1-git-send-email-avarab@gmail.com>

These two patches by Jonathan Nieder have been extracted from my soon-to-be-sent updated gettext series, which he's graciously helped with.

Without these changes this code using the new _() function will warn because it's expecting char* but it's returning const char*. Since there's no reason for these not to be const just add a const to the declaration.

Jonathan Nieder (2):
  checkout: add missing const to describe_detached_head
  update-index --refresh --porcelain: add missing const
 builtin/checkout.c |    2 +-
 cache.h            |    2 +-
 read-cache.c       |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
-- 
1.7.2.3
Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “Add missing const to char* declarations”
  1. 0/2 Add missing const to char* declarationsÆvar Arnfjörð Bjarmason, Feb 22, 2011
  2. 1/2 checkout: add missing const to describe_detached_headÆvar Arnfjörð Bjarmason, Feb 22, 2011
  3. 2/2 update-index --refresh --porcelain: add missing constÆvar Arnfjörð Bjarmason, Feb 22, 2011

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.