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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/variables-expected.cc

Issue 1639663003: Clean up rewrite_to_chrome_style naming logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More comprehensive fixes Created 4 years, 11 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 // Global variables 7 // Global variables
8 int frame_count = 0; 8 int frame_count = 0;
9 // Make sure that underscore-insertion doesn't get too confused by acronyms. 9 // Make sure that underscore-insertion doesn't get too confused by acronyms.
10 static int variable_mentioning_http_and_https = 1; 10 static int variable_mentioning_http_and_https = 1;
11 // Already Google style, should not change. 11 // Already Google style, should not change.
12 int already_google_style_; 12 int already_google_style;
13 // Should still get normalized.
14 int goofily_named_variable_for_fun;
15 // "A" should be considered its own word.
16 int nth_a_value;
17 // "V8" and "Data" should be distinct words.
18 int my_v8_data;
19 // "UTF8" and "Data" should be distinct words.
20 int my_utf8_data;
21 // "Latin1" and "Data" should be distinct words.
22 int my_latin1_data;
23 // Identifiers that are all the same case should just be split by underscore,
24 // aka assume the human knows what they're doing.
25 int gl_compressed_rgb_pvrtc_4bppv1_img;
26 int gl_compressed_rgb_s3tc_dxt1_ext;
27 // Weird edge cases.
28 int my_data_from_utf8_masking_top8_bits;
29 bool enable_unsafe_es3_ap_is;
danakj 2016/01/27 00:28:56 itym es3_apis D:
dcheng 2016/01/27 00:38:29 Yeah... previously, this didn't really show up, si
danakj 2016/01/27 00:40:53 that'd be fine.
13 30
14 // Function parameters 31 // Function parameters
15 int Function(int interesting_number) { 32 int Function(int interesting_number) {
16 // Local variables. 33 // Local variables.
17 int a_local_variable = 1; 34 int a_local_variable = 1;
18 // Static locals. 35 // Static locals.
19 static int a_static_local_variable = 2; 36 static int a_static_local_variable = 2;
20 // Make sure references to variables are also rewritten. 37 // Make sure references to variables are also rewritten.
21 return frame_count + 38 return frame_count +
22 variable_mentioning_http_and_https * interesting_number / 39 variable_mentioning_http_and_https * interesting_number /
23 a_local_variable % a_static_local_variable; 40 a_local_variable % a_static_local_variable;
24 } 41 }
25 42
26 } // namespace blink 43 } // namespace blink
27 44
28 int F() { 45 int F() {
29 // Make sure variables qualified with a namespace name are still rewritten 46 // Make sure variables qualified with a namespace name are still rewritten
30 // correctly. 47 // correctly.
31 return blink::frame_count; 48 return blink::frame_count;
32 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698