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

[PATCH v2 03/37] blame: rename 'this' variables

From
BWBrandon Williams <bmwill@google.com>
Date
Feb 14, 2018, 18:59 UTC
Message-ID
<20180214185959.221906-4-bmwill@google.com>
In-Reply-To
<20180214185959.221906-1-bmwill@google.com>

Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
---
 blame.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/blame.c b/blame.c
index 2893f3c10..21c867664 100644
--- a/blame.c
+++ b/blame.c
@@ -998,28 +998,29 @@ unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entry *e)
 }
 
 /*
- * best_so_far[] and this[] are both a split of an existing blame_entry
- * that passes blame to the parent.  Maintain best_so_far the best split
- * so far, by comparing this and best_so_far and copying this into
+ * best_so_far[] and potential[] are both a split of an existing blame_entry
+ * that passes blame to the parent.  Maintain best_so_far the best split so
+ * far, by comparing potential and best_so_far and copying potential into
  * bst_so_far as needed.
  */
 static void copy_split_if_better(struct blame_scoreboard *sb,
 				 struct blame_entry *best_so_far,
-				 struct blame_entry *this)
+				 struct blame_entry *potential)
 {
 	int i;
 
-	if (!this[1].suspect)
+	if (!potential[1].suspect)
 		return;
 	if (best_so_far[1].suspect) {
-		if (blame_entry_score(sb, &this[1]) < blame_entry_score(sb, &best_so_far[1]))
+		if (blame_entry_score(sb, &potential[1]) <
+		    blame_entry_score(sb, &best_so_far[1]))
 			return;
 	}
 
 	for (i = 0; i < 3; i++)
-		blame_origin_incref(this[i].suspect);
+		blame_origin_incref(potential[i].suspect);
 	decref_split(best_so_far);
-	memcpy(best_so_far, this, sizeof(struct blame_entry [3]));
+	memcpy(best_so_far, potential, sizeof(struct blame_entry[3]));
 }
 
 /*
@@ -1046,12 +1047,12 @@ static void handle_split(struct blame_scoreboard *sb,
 	if (ent->num_lines <= tlno)
 		return;
 	if (tlno < same) {
-		struct blame_entry this[3];
+		struct blame_entry potential[3];
 		tlno += ent->s_lno;
 		same += ent->s_lno;
-		split_overlap(this, ent, tlno, plno, same, parent);
-		copy_split_if_better(sb, split, this);
-		decref_split(this);
+		split_overlap(potential, ent, tlno, plno, same, parent);
+		copy_split_if_better(sb, split, potential);
+		decref_split(potential);
 	}
 }
 
@@ -1273,7 +1274,7 @@ static void find_copy_in_parent(struct blame_scoreboard *sb,
 			struct diff_filepair *p = diff_queued_diff.queue[i];
 			struct blame_origin *norigin;
 			mmfile_t file_p;
-			struct blame_entry this[3];
+			struct blame_entry potential[3];
 
 			if (!DIFF_FILE_VALID(p->one))
 				continue; /* does not exist in parent */
@@ -1292,10 +1293,10 @@ static void find_copy_in_parent(struct blame_scoreboard *sb,
 
 			for (j = 0; j < num_ents; j++) {
 				find_copy_in_blob(sb, blame_list[j].ent,
-						  norigin, this, &file_p);
+						  norigin, potential, &file_p);
 				copy_split_if_better(sb, blame_list[j].split,
-						     this);
-				decref_split(this);
+						     potential);
+				decref_split(potential);
 			}
 			blame_origin_decref(norigin);
 		}
-- 
2.16.1.291.g4437f3f132-goog
Previous: Brandon WilliamsNext: Brandon Williams
Message 52 of 89 in “removal of some c++ keywords”
  1. 00/37 removal of some c++ keywordsBrandon Williams, Jan 29, 2018
  2. 01/37 object_info: change member name from 'typename' to 'type_name'Brandon Williams, Jan 29, 2018
  3. 02/37 object: rename function 'typename' to 'type_name'Brandon Williams, Jan 29, 2018
  4. 03/37 blame: rename 'this' variablesBrandon Williams, Jan 29, 2018
  5. 04/37 pack-objects: rename 'this' variablesBrandon Williams, Jan 29, 2018
  6. 05/37 rev-parse: rename 'this' variableBrandon Williams, Jan 29, 2018
  7. 06/37 diff: rename 'this' variablesBrandon Williams, Jan 29, 2018
  8. 08/37 apply: rename 'new' variablesBrandon Williams, Jan 29, 2018
  9. 07/37 apply: rename 'try' variablesBrandon Williams, Jan 29, 2018
  10. 09/37 checkout: rename 'new' variablesBrandon Williams, Jan 29, 2018
  11. 14/37 combine-diff: rename 'new' variablesBrandon Williams, Jan 29, 2018
  12. 17/37 diff: rename 'new' variablesBrandon Williams, Jan 29, 2018
  13. 18/37 diffcore-delta: rename 'new' variablesBrandon Williams, Jan 29, 2018
  14. 19/37 entry: rename 'new' variablesBrandon Williams, Jan 29, 2018
  15. 23/37 read-cache: rename 'new' variablesBrandon Williams, Jan 29, 2018
  16. 24/37 ref-filter: rename 'new' variablesBrandon Williams, Jan 29, 2018
  17. 26/37 split-index: rename 'new' variablesBrandon Williams, Jan 29, 2018
  18. 25/37 remote: rename 'new' variablesBrandon Williams, Jan 29, 2018
  19. 22/37 line-log: rename 'new' variablesBrandon Williams, Jan 29, 2018
  20. 30/37 init-db: rename 'template' variablesBrandon Williams, Jan 29, 2018
  21. 31/37 environment: rename 'template' variablesBrandon Williams, Jan 29, 2018
  22. 32/37 diff: rename 'template' variablesBrandon Williams, Jan 29, 2018
  23. 34/37 wrapper: rename 'template' variablesBrandon Williams, Jan 29, 2018
  24. 35/37 tempfile: rename 'template' variablesBrandon Williams, Jan 29, 2018
  25. 36/37 trailer: rename 'template' variablesBrandon Williams, Jan 29, 2018
  26. 37/37 replace: rename 'new' variablesBrandon Williams, Jan 29, 2018
  27. Stefan BellerJan 30, 2018
  28. Junio C HamanoJan 30, 2018
  29. 33/37 environment: rename 'namespace' variablesBrandon Williams, Jan 29, 2018
  30. 27/37 submodule: rename 'new' variablesBrandon Williams, Jan 29, 2018
  31. 28/37 trailer: rename 'new' variablesBrandon Williams, Jan 29, 2018
  32. 29/37 unpack-trees: rename 'new' variablesBrandon Williams, Jan 29, 2018
  33. 21/37 imap-send: rename 'new' variablesBrandon Williams, Jan 29, 2018
  34. 20/37 http: rename 'new' variablesBrandon Williams, Jan 29, 2018
  35. 15/37 commit: rename 'new' variablesBrandon Williams, Jan 29, 2018
  36. 16/37 diff-lib: rename 'new' variableBrandon Williams, Jan 29, 2018
  37. 10/37 help: rename 'new' variablesBrandon Williams, Jan 29, 2018
  38. 13/37 remote: rename 'new' variablesBrandon Williams, Jan 29, 2018
  39. 11/37 pack-redundant: rename 'new' variablesBrandon Williams, Jan 29, 2018
  40. 12/37 reflog: rename 'new' variablesBrandon Williams, Jan 29, 2018
  41. Duy NguyenJan 30, 2018
  42. Junio C HamanoJan 30, 2018
  43. Stefan BellerJan 30, 2018
  44. Duy NguyenJan 31, 2018
  45. Stefan BellerJan 31, 2018
  46. Duy NguyenJan 31, 2018
  47. Johannes SixtJan 30, 2018
  48. 00/37 removal of some c++ keywordsBrandon Williams, Feb 14, 2018
  49. 01/37 object_info: change member name from 'typename' to 'type_name'Brandon Williams, Feb 14, 2018
  50. 02/37 object: rename function 'typename' to 'type_name'Brandon Williams, Feb 14, 2018
  51. 04/37 pack-objects: rename 'this' variablesBrandon Williams, Feb 14, 2018
  52. 03/37 blame: rename 'this' variablesBrandon Williams, Feb 14, 2018
  53. 05/37 rev-parse: rename 'this' variableBrandon Williams, Feb 14, 2018
  54. 06/37 diff: rename 'this' variablesBrandon Williams, Feb 14, 2018
  55. Junio C HamanoFeb 14, 2018
  56. Brandon WilliamsFeb 14, 2018
  57. 09/37 checkout: rename 'new' variablesBrandon Williams, Feb 14, 2018
  58. 10/37 help: rename 'new' variablesBrandon Williams, Feb 14, 2018
  59. 11/37 pack-redundant: rename 'new' variablesBrandon Williams, Feb 14, 2018
  60. 12/37 reflog: rename 'new' variablesBrandon Williams, Feb 14, 2018
  61. 15/37 commit: rename 'new' variablesBrandon Williams, Feb 14, 2018
  62. 16/37 diff-lib: rename 'new' variableBrandon Williams, Feb 14, 2018
  63. 18/37 diffcore-delta: rename 'new' variablesBrandon Williams, Feb 14, 2018
  64. 19/37 entry: rename 'new' variablesBrandon Williams, Feb 14, 2018
  65. 20/37 http: rename 'new' variablesBrandon Williams, Feb 14, 2018
  66. 21/37 imap-send: rename 'new' variablesBrandon Williams, Feb 14, 2018
  67. 22/37 line-log: rename 'new' variablesBrandon Williams, Feb 14, 2018
  68. 23/37 read-cache: rename 'new' variablesBrandon Williams, Feb 14, 2018
  69. 24/37 ref-filter: rename 'new' variablesBrandon Williams, Feb 14, 2018
  70. 26/37 split-index: rename 'new' variablesBrandon Williams, Feb 14, 2018
  71. 25/37 remote: rename 'new' variablesBrandon Williams, Feb 14, 2018
  72. 28/37 trailer: rename 'new' variablesBrandon Williams, Feb 14, 2018
  73. 29/37 unpack-trees: rename 'new' variablesBrandon Williams, Feb 14, 2018
  74. 27/37 submodule: rename 'new' variablesBrandon Williams, Feb 14, 2018
  75. 30/37 init-db: rename 'template' variablesBrandon Williams, Feb 14, 2018
  76. 33/37 environment: rename 'namespace' variablesBrandon Williams, Feb 14, 2018
  77. 34/37 wrapper: rename 'template' variablesBrandon Williams, Feb 14, 2018
  78. 35/37 tempfile: rename 'template' variablesBrandon Williams, Feb 14, 2018
  79. 36/37 trailer: rename 'template' variablesBrandon Williams, Feb 14, 2018
  80. 37/37 replace: rename 'new' variablesBrandon Williams, Feb 14, 2018
  81. 31/37 environment: rename 'template' variablesBrandon Williams, Feb 14, 2018
  82. 32/37 diff: rename 'template' variablesBrandon Williams, Feb 14, 2018
  83. 17/37 diff: rename 'new' variablesBrandon Williams, Feb 14, 2018
  84. 07/37 apply: rename 'try' variablesBrandon Williams, Feb 14, 2018
  85. 14/37 combine-diff: rename 'new' variablesBrandon Williams, Feb 14, 2018
  86. 08/37 apply: rename 'new' variablesBrandon Williams, Feb 14, 2018
  87. Stefan BellerFeb 14, 2018
  88. 13/37 remote: rename 'new' variablesBrandon Williams, Feb 14, 2018
  89. Stefan BellerFeb 14, 2018

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.