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

Side by Side Diff: tools/gn/escape.cc

Issue 1549203002: Switch to standard integer types in tools/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « tools/gn/err.cc ('k') | tools/gn/exec_process.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "tools/gn/escape.h" 5 #include "tools/gn/escape.h"
6 6
7 #include <stddef.h>
8
7 #include "base/containers/stack_container.h" 9 #include "base/containers/stack_container.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "build/build_config.h"
9 12
10 namespace { 13 namespace {
11 14
12 // A "1" in this lookup table means that char is valid in the Posix shell. 15 // A "1" in this lookup table means that char is valid in the Posix shell.
13 const char kShellValid[0x80] = { 16 const char kShellValid[0x80] = {
14 // 00-1f: all are invalid 17 // 00-1f: all are invalid
15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17 // ' ' ! " # $ % & ' ( ) * + , - . / 20 // ' ' ! " # $ % & ' ( ) * + , - . /
18 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 21 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 200 }
198 201
199 void EscapeStringToStream(std::ostream& out, 202 void EscapeStringToStream(std::ostream& out,
200 const base::StringPiece& str, 203 const base::StringPiece& str,
201 const EscapeOptions& options) { 204 const EscapeOptions& options) {
202 base::StackString<256> escaped; 205 base::StackString<256> escaped;
203 EscapeStringToString(str, options, &escaped.container(), nullptr); 206 EscapeStringToString(str, options, &escaped.container(), nullptr);
204 if (!escaped->empty()) 207 if (!escaped->empty())
205 out.write(escaped->data(), escaped->size()); 208 out.write(escaped->data(), escaped->size());
206 } 209 }
OLDNEW
« no previous file with comments | « tools/gn/err.cc ('k') | tools/gn/exec_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698