Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
e61ff47a
Commit
e61ff47a
authored
Sep 09, 2015
by
Feng Xiao
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #802 from bsilver8192/master
Small fixes
parents
0e606bc2
21f3d377
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
cpp_file.cc
src/google/protobuf/compiler/cpp/cpp_file.cc
+6
-1
googletest.cc
src/google/protobuf/testing/googletest.cc
+7
-0
No files found.
src/google/protobuf/compiler/cpp/cpp_file.cc
View file @
e61ff47a
...
...
@@ -598,8 +598,13 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
// bytes in length". Declare a static array of characters rather than use a
// string literal.
if
(
breakdown_large_file
&&
file_data
.
size
()
>
65535
)
{
// This has to be explicitly marked as a signed char because the generated
// code puts negative values in the array, and sometimes plain char is
// unsigned. That implicit narrowing conversion is not allowed in C++11.
// <http://stackoverflow.com/questions/4434140/narrowing-conversions-in-c0x-is-it-just-me-or-does-this-sound-like-a-breakin>
// has details on why.
printer
->
Print
(
"static const char descriptor[] = {
\n
"
);
"static const
signed
char descriptor[] = {
\n
"
);
printer
->
Indent
();
// Only write 25 bytes per line.
...
...
src/google/protobuf/testing/googletest.cc
View file @
e61ff47a
...
...
@@ -94,6 +94,13 @@ string TestSourceDir() {
namespace
{
string
GetTemporaryDirectoryName
()
{
// Tests run under Bazel "should not" use /tmp. Bazel sets this environment
// variable for tests to use instead.
char
*
from_environment
=
getenv
(
"TEST_TMPDIR"
);
if
(
from_environment
!=
NULL
&&
from_environment
[
0
]
!=
'\0'
)
{
return
string
(
from_environment
)
+
"/protobuf_tmpdir"
;
}
// tmpnam() is generally not considered safe but we're only using it for
// testing. We cannot use tmpfile() or mkstemp() since we're creating a
// directory.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment