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

Side by Side Diff: third_party/re2/util/stringprintf.cc

Issue 564293002: Reduce diff to upstream re2 a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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 | « third_party/re2/re2.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2002 The RE2 Authors. All Rights Reserved. 1 // Copyright 2002 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include "util/util.h" 5 #include "util/util.h"
6 6
7 #ifndef va_copy
8 #define va_copy(d,s) ((d) = (s)) //KLUGE: for MS compilers
9 #endif
10
11 namespace re2 { 7 namespace re2 {
12 8
13 static void StringAppendV(string* dst, const char* format, va_list ap) { 9 static void StringAppendV(string* dst, const char* format, va_list ap) {
14 // First try with a small fixed size buffer 10 // First try with a small fixed size buffer
15 char space[1024]; 11 char space[1024];
16 12
17 // It's possible for methods that use a va_list to invalidate 13 // It's possible for methods that use a va_list to invalidate
18 // the data in it upon use. The fix is to make a copy 14 // the data in it upon use. The fix is to make a copy
19 // of the structure before using it and use that copy instead. 15 // of the structure before using it and use that copy instead.
20 va_list backup_ap; 16 va_list backup_ap;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 69 }
74 70
75 void StringAppendF(string* dst, const char* format, ...) { 71 void StringAppendF(string* dst, const char* format, ...) {
76 va_list ap; 72 va_list ap;
77 va_start(ap, format); 73 va_start(ap, format);
78 StringAppendV(dst, format, ap); 74 StringAppendV(dst, format, ap);
79 va_end(ap); 75 va_end(ap);
80 } 76 }
81 77
82 } // namespace re2 78 } // namespace re2
OLDNEW
« no previous file with comments | « third_party/re2/re2.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698