Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/functions-original.cc

Issue 1647763002: rewrite_to_chrome_style: Don't rename begin()/end()/rbegin()/rend(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rewrite-begin-end: not-static-methods Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 namespace blink { 5 namespace blink {
6 6
7 // Tests that the prototype for a function is updated. 7 // Tests that the prototype for a function is updated.
8 int testFunctionThatTakesTwoInts(int x, int y); 8 int testFunctionThatTakesTwoInts(int x, int y);
9 9
10 // Test that the actual function definition is also updated. 10 // Test that the actual function definition is also updated.
11 int testFunctionThatTakesTwoInts(int x, int y) { 11 int testFunctionThatTakesTwoInts(int x, int y) {
12 if (x == 0) 12 if (x == 0)
13 return y; 13 return y;
14 // Calls to the function also need to be updated. 14 // Calls to the function also need to be updated.
15 return testFunctionThatTakesTwoInts(x - 1, y + 1); 15 return testFunctionThatTakesTwoInts(x - 1, y + 1);
16 } 16 }
17 17
18 // This is named like the begin() method which isn't renamed, but
19 // here it's not a method so it should be.
20 void begin() {}
dcheng 2016/01/28 06:58:12 Hopefully there are no uses of non-member begin()
danakj 2016/01/28 19:47:58 Ya, but better safe than sorry? :)
21
18 // Note: F is already Google style and should not change. 22 // Note: F is already Google style and should not change.
19 void F() { 23 void F() {
20 // Test referencing a function without calling it. 24 // Test referencing a function without calling it.
21 int (*functionPointer)(int, int) = &testFunctionThatTakesTwoInts; 25 int (*functionPointer)(int, int) = &testFunctionThatTakesTwoInts;
22 } 26 }
23 27
24 } // namespace blink 28 } // namespace blink
25 29
26 void G() { 30 void G() {
27 blink::testFunctionThatTakesTwoInts(1, 2); 31 blink::testFunctionThatTakesTwoInts(1, 2);
28 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698