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

[PATCH FYI] reset,cat-file: remove const declaration from array

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 19, 2008, 00:08 UTC
Message-ID
<hjRg2-WPGYEeqAP0h-sXbS8ouecjwZU2ymwwyp8wKIjQ_CGDG5-urQ@cipher.nrlssc.navy.mil>
In-Reply-To
<IH0MHSTEimhAN93AedvpRKq4qfzm1QA814ZYyhbSBtSdNbq8vuE6aw@cipher.nrlssc.navy.mil>
Silence compiler complaints about opt array initialized with local
variables which was declared const.
---
 builtin-cat-file.c |    2 +-
 builtin-reset.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 7441a56..d954c09 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -212,7 +212,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
 	int opt = 0, batch = 0;
 	const char *exp_type = NULL, *obj_name = NULL;
 
-	const struct option options[] = {
+	struct option options[] = {
 		OPT_GROUP("<type> can be one of: blob, tree, commit, tag"),
 		OPT_SET_INT('t', NULL, &opt, "show object type", 't'),
 		OPT_SET_INT('s', NULL, &opt, "show object size", 's'),
diff --git a/builtin-reset.c b/builtin-reset.c
index 4d246c3..28b633f 100644
--- a/builtin-reset.c
+++ b/builtin-reset.c
@@ -176,7 +176,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 				*old_orig = NULL, sha1_old_orig[20];
 	struct commit *commit;
 	char *reflog_action, msg[1024];
-	const struct option options[] = {
+	struct option options[] = {
 		OPT_SET_INT(0, "mixed", &reset_type,
 						"reset HEAD and index", MIXED),
 		OPT_SET_INT(0, "soft", &reset_type, "reset only HEAD", SOFT),
-- 
1.6.0.11.gecc7e
Previous: Johannes SchindelinNext: Brandon Casey
Message 19 of 36 in “[FYI] How I compile on SunOS 5.7 with the SUNWspro compiler and ksh”
  1. Brandon CaseyAug 18, 2008
  2. Makefile: configuration for SunOS 5.7Brandon Casey, Aug 18, 2008
  3. dir.c: avoid c99 array initializationBrandon Casey, Aug 18, 2008
  4. David KågedalAug 28, 2008
  5. Andreas EricssonAug 28, 2008
  6. Brandon CaseyAug 28, 2008
  7. Junio C HamanoAug 28, 2008
  8. Brandon CaseyAug 28, 2008
  9. Alex RiesenAug 28, 2008
  10. Brandon CaseyAug 28, 2008
  11. Alex RiesenAug 28, 2008
  12. Shawn O. PearceAug 28, 2008
  13. Junio C HamanoAug 28, 2008
  14. dir.c: Avoid c99 array initializationBrandon Casey, Aug 28, 2008
  15. Alex RiesenAug 28, 2008
  16. Brandon CaseyAug 28, 2008
  17. Alex RiesenAug 28, 2008
  18. Johannes SchindelinAug 29, 2008
  19. reset,cat-file: remove const declaration from arrayBrandon Casey, Aug 19, 2008
  20. test-lib.sh: work around ksh's trap shortcomingsBrandon Casey, Aug 19, 2008
  21. t1002-read-tree-m-u-2way.sh: use 'git diff -U0' rather than 'diff -U0'Brandon Casey, Aug 19, 2008
  22. Work around sed issuesBrandon Casey, Aug 19, 2008
  23. t9301-fast-export.sh: don't unset config variable while we're skipping test 4Brandon Casey, Aug 19, 2008
  24. Jeff KingAug 19, 2008
  25. Brandon CaseyAug 19, 2008
  26. Jeff KingAug 19, 2008
  27. t9700/test.pl: backwards compatibility improvementsBrandon Casey, Aug 19, 2008
  28. Tom G. ChristensenSep 15, 2008
  29. Brandon CaseySep 15, 2008
  30. Brandon CaseySep 15, 2008
  31. 1/3 t9700/test.pl: no longer requires File::BasenameBrandon Casey, Sep 15, 2008
  32. 2/3 t9700/test.pl: avoid bareword 'STDERR' in 3-argument open()Brandon Casey, Sep 15, 2008
  33. 3/3 t9700/test.pl: remove File::Temp requirementBrandon Casey, Sep 15, 2008
  34. Tom G. ChristensenSep 15, 2008
  35. Alex RiesenAug 19, 2008
  36. Brandon CaseyAug 19, 2008

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.