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
2726e7a6
Commit
2726e7a6
authored
Dec 03, 2010
by
liujisi@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues: 166 167 172 175 181 188 192 194 195.
parent
0acafda8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
67 deletions
+35
-67
MessageLiteOrBuilder.java
...c/main/java/com/google/protobuf/MessageLiteOrBuilder.java
+3
-1
acx_pthread.m4
m4/acx_pthread.m4
+4
-2
message.py
python/google/protobuf/message.py
+3
-0
Makefile.am
src/Makefile.am
+0
-1
command_line_interface.cc
src/google/protobuf/compiler/command_line_interface.cc
+2
-2
cpp_unittest.cc
src/google/protobuf/compiler/cpp/cpp_unittest.cc
+8
-8
descriptor_database.cc
src/google/protobuf/descriptor_database.cc
+2
-2
repeated_field.h
src/google/protobuf/repeated_field.h
+3
-3
common.h
src/google/protobuf/stubs/common.h
+9
-6
hash.cc
src/google/protobuf/stubs/hash.cc
+0
-41
wire_format_lite_inl.h
src/google/protobuf/wire_format_lite_inl.h
+1
-1
No files found.
java/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java
View file @
2726e7a6
...
@@ -38,7 +38,9 @@ package com.google.protobuf;
...
@@ -38,7 +38,9 @@ package com.google.protobuf;
*/
*/
public
interface
MessageLiteOrBuilder
{
public
interface
MessageLiteOrBuilder
{
/**
/**
* Get an instance of the type with all fields set to their default values.
* Get an instance of the type with no fields set. Because no fields are set,
* all getters for singular fields will return default values and repeated
* fields will appear empty.
* This may or may not be a singleton. This differs from the
* This may or may not be a singleton. This differs from the
* {@code getDefaultInstance()} method of generated message classes in that
* {@code getDefaultInstance()} method of generated message classes in that
* this method is an abstract method of the {@code MessageLite} interface
* this method is an abstract method of the {@code MessageLite} interface
...
...
m4/acx_pthread.m4
View file @
2726e7a6
...
@@ -272,9 +272,11 @@ if test "x$acx_pthread_ok" = xyes; then
...
@@ -272,9 +272,11 @@ if test "x$acx_pthread_ok" = xyes; then
AC_TRY_LINK(,, , [done=yes])
AC_TRY_LINK(,, , [done=yes])
if test "x$done" = xyes ; then
if test "x$done" = xyes ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AC_MSG_RESULT([yes])
done="no"
else
AC_MSG_RESULT([no])
done="yes"
fi
fi
fi
fi
...
...
python/google/protobuf/message.py
View file @
2726e7a6
...
@@ -226,6 +226,9 @@ class Message(object):
...
@@ -226,6 +226,9 @@ class Message(object):
raise
NotImplementedError
raise
NotImplementedError
def
HasField
(
self
,
field_name
):
def
HasField
(
self
,
field_name
):
"""Checks if a certain field is set for the message. Note if the
field_name is not defined in the message descriptor, ValueError will be
raised."""
raise
NotImplementedError
raise
NotImplementedError
def
ClearField
(
self
,
field_name
):
def
ClearField
(
self
,
field_name
):
...
...
src/Makefile.am
View file @
2726e7a6
...
@@ -81,7 +81,6 @@ libprotobuf_lite_la_LDFLAGS = -version-info 6:0:0 -export-dynamic -no-undefined
...
@@ -81,7 +81,6 @@ libprotobuf_lite_la_LDFLAGS = -version-info 6:0:0 -export-dynamic -no-undefined
libprotobuf_lite_la_SOURCES
=
\
libprotobuf_lite_la_SOURCES
=
\
google/protobuf/stubs/common.cc
\
google/protobuf/stubs/common.cc
\
google/protobuf/stubs/once.cc
\
google/protobuf/stubs/once.cc
\
google/protobuf/stubs/hash.cc
\
google/protobuf/stubs/hash.h
\
google/protobuf/stubs/hash.h
\
google/protobuf/stubs/map-util.h
\
google/protobuf/stubs/map-util.h
\
google/protobuf/stubs/stl_util-inl.h
\
google/protobuf/stubs/stl_util-inl.h
\
...
...
src/google/protobuf/compiler/command_line_interface.cc
View file @
2726e7a6
...
@@ -781,7 +781,7 @@ bool CommandLineInterface::ParseArguments(int argc, const char* const argv[]) {
...
@@ -781,7 +781,7 @@ bool CommandLineInterface::ParseArguments(int argc, const char* const argv[]) {
// If no --proto_path was given, use the current working directory.
// If no --proto_path was given, use the current working directory.
if
(
proto_path_
.
empty
())
{
if
(
proto_path_
.
empty
())
{
proto_path_
.
push_back
(
make_pair
(
""
,
"."
));
proto_path_
.
push_back
(
make_pair
<
string
,
string
>
(
""
,
"."
));
}
}
// Check some errror cases.
// Check some errror cases.
...
@@ -910,7 +910,7 @@ bool CommandLineInterface::InterpretArgument(const string& name,
...
@@ -910,7 +910,7 @@ bool CommandLineInterface::InterpretArgument(const string& name,
cerr
<<
disk_path
<<
": warning: directory does not exist."
<<
endl
;
cerr
<<
disk_path
<<
": warning: directory does not exist."
<<
endl
;
}
}
proto_path_
.
push_back
(
make_pair
(
virtual_path
,
disk_path
));
proto_path_
.
push_back
(
make_pair
<
string
,
string
>
(
virtual_path
,
disk_path
));
}
}
}
else
if
(
name
==
"-o"
||
name
==
"--descriptor_set_out"
)
{
}
else
if
(
name
==
"-o"
||
name
==
"--descriptor_set_out"
)
{
...
...
src/google/protobuf/compiler/cpp/cpp_unittest.cc
View file @
2726e7a6
...
@@ -853,14 +853,14 @@ TEST(GeneratedEnumTest, MinAndMax) {
...
@@ -853,14 +853,14 @@ TEST(GeneratedEnumTest, MinAndMax) {
EXPECT_EQ
(
12589235
,
unittest
::
TestSparseEnum_ARRAYSIZE
);
EXPECT_EQ
(
12589235
,
unittest
::
TestSparseEnum_ARRAYSIZE
);
// Make sure we can take the address of _MIN, _MAX and _ARRAYSIZE.
// Make sure we can take the address of _MIN, _MAX and _ARRAYSIZE.
void
*
null
pt
r
=
0
;
// NULL may be integer-type, not pointer-type.
void
*
null
_pointe
r
=
0
;
// NULL may be integer-type, not pointer-type.
EXPECT_NE
(
null
pt
r
,
&
unittest
::
TestAllTypes
::
NestedEnum_MIN
);
EXPECT_NE
(
null
_pointe
r
,
&
unittest
::
TestAllTypes
::
NestedEnum_MIN
);
EXPECT_NE
(
null
pt
r
,
&
unittest
::
TestAllTypes
::
NestedEnum_MAX
);
EXPECT_NE
(
null
_pointe
r
,
&
unittest
::
TestAllTypes
::
NestedEnum_MAX
);
EXPECT_NE
(
null
pt
r
,
&
unittest
::
TestAllTypes
::
NestedEnum_ARRAYSIZE
);
EXPECT_NE
(
null
_pointe
r
,
&
unittest
::
TestAllTypes
::
NestedEnum_ARRAYSIZE
);
EXPECT_NE
(
null
pt
r
,
&
unittest
::
ForeignEnum_MIN
);
EXPECT_NE
(
null
_pointe
r
,
&
unittest
::
ForeignEnum_MIN
);
EXPECT_NE
(
null
pt
r
,
&
unittest
::
ForeignEnum_MAX
);
EXPECT_NE
(
null
_pointe
r
,
&
unittest
::
ForeignEnum_MAX
);
EXPECT_NE
(
null
pt
r
,
&
unittest
::
ForeignEnum_ARRAYSIZE
);
EXPECT_NE
(
null
_pointe
r
,
&
unittest
::
ForeignEnum_ARRAYSIZE
);
// Make sure we can use _MIN, _MAX and _ARRAYSIZE as switch cases.
// Make sure we can use _MIN, _MAX and _ARRAYSIZE as switch cases.
switch
(
unittest
::
SPARSE_A
)
{
switch
(
unittest
::
SPARSE_A
)
{
...
...
src/google/protobuf/descriptor_database.cc
View file @
2726e7a6
...
@@ -101,7 +101,7 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
...
@@ -101,7 +101,7 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
if
(
iter
==
by_symbol_
.
end
())
{
if
(
iter
==
by_symbol_
.
end
())
{
// Apparently the map is currently empty. Just insert and be done with it.
// Apparently the map is currently empty. Just insert and be done with it.
by_symbol_
.
insert
(
make_pair
(
name
,
value
));
by_symbol_
.
insert
(
typename
map
<
string
,
Value
>::
value_type
(
name
,
value
));
return
true
;
return
true
;
}
}
...
@@ -128,7 +128,7 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
...
@@ -128,7 +128,7 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
// Insert the new symbol using the iterator as a hint, the new entry will
// Insert the new symbol using the iterator as a hint, the new entry will
// appear immediately before the one the iterator is pointing at.
// appear immediately before the one the iterator is pointing at.
by_symbol_
.
insert
(
iter
,
make_pair
(
name
,
value
));
by_symbol_
.
insert
(
iter
,
typename
map
<
string
,
Value
>::
value_type
(
name
,
value
));
return
true
;
return
true
;
}
}
...
...
src/google/protobuf/repeated_field.h
View file @
2726e7a6
...
@@ -1199,7 +1199,7 @@ template<typename T> class RepeatedFieldBackInsertIterator
...
@@ -1199,7 +1199,7 @@ template<typename T> class RepeatedFieldBackInsertIterator
}
}
private
:
private
:
RepeatedField
<
T
>*
const
field_
;
RepeatedField
<
T
>*
field_
;
};
};
// A back inserter for RepeatedPtrField objects.
// A back inserter for RepeatedPtrField objects.
...
@@ -1230,7 +1230,7 @@ template<typename T> class RepeatedPtrFieldBackInsertIterator
...
@@ -1230,7 +1230,7 @@ template<typename T> class RepeatedPtrFieldBackInsertIterator
}
}
private
:
private
:
RepeatedPtrField
<
T
>*
const
field_
;
RepeatedPtrField
<
T
>*
field_
;
};
};
// A back inserter for RepeatedPtrFields that inserts by transfering ownership
// A back inserter for RepeatedPtrFields that inserts by transfering ownership
...
@@ -1259,7 +1259,7 @@ template<typename T> class AllocatedRepeatedPtrFieldBackInsertIterator
...
@@ -1259,7 +1259,7 @@ template<typename T> class AllocatedRepeatedPtrFieldBackInsertIterator
}
}
private
:
private
:
RepeatedPtrField
<
T
>*
const
field_
;
RepeatedPtrField
<
T
>*
field_
;
};
};
}
// namespace internal
}
// namespace internal
...
...
src/google/protobuf/stubs/common.h
View file @
2726e7a6
...
@@ -71,8 +71,6 @@ namespace std {}
...
@@ -71,8 +71,6 @@ namespace std {}
namespace
google
{
namespace
google
{
namespace
protobuf
{
namespace
protobuf
{
using
namespace
std
;
// Don't do this at home, kids.
#undef GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
#undef GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName) \
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName) \
TypeName(const TypeName&); \
TypeName(const TypeName&); \
...
@@ -126,7 +124,7 @@ void LIBPROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion,
...
@@ -126,7 +124,7 @@ void LIBPROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion,
const
char
*
filename
);
const
char
*
filename
);
// Converts a numeric version number to a string.
// Converts a numeric version number to a string.
string
LIBPROTOBUF_EXPORT
VersionString
(
int
version
);
st
d
::
st
ring
LIBPROTOBUF_EXPORT
VersionString
(
int
version
);
}
// namespace internal
}
// namespace internal
...
@@ -369,6 +367,7 @@ struct CompileAssert {
...
@@ -369,6 +367,7 @@ struct CompileAssert {
typedef ::google::protobuf::internal::CompileAssert<(bool(expr))> \
typedef ::google::protobuf::internal::CompileAssert<(bool(expr))> \
msg[bool(expr) ? 1 : -1]
msg[bool(expr) ? 1 : -1]
// Implementation details of COMPILE_ASSERT:
// Implementation details of COMPILE_ASSERT:
//
//
// - COMPILE_ASSERT works by defining an array type that has -1
// - COMPILE_ASSERT works by defining an array type that has -1
...
@@ -636,7 +635,7 @@ class LIBPROTOBUF_EXPORT LogMessage {
...
@@ -636,7 +635,7 @@ class LIBPROTOBUF_EXPORT LogMessage {
LogMessage
(
LogLevel
level
,
const
char
*
filename
,
int
line
);
LogMessage
(
LogLevel
level
,
const
char
*
filename
,
int
line
);
~
LogMessage
();
~
LogMessage
();
LogMessage
&
operator
<<
(
const
string
&
value
);
LogMessage
&
operator
<<
(
const
st
d
::
st
ring
&
value
);
LogMessage
&
operator
<<
(
const
char
*
value
);
LogMessage
&
operator
<<
(
const
char
*
value
);
LogMessage
&
operator
<<
(
char
value
);
LogMessage
&
operator
<<
(
char
value
);
LogMessage
&
operator
<<
(
int
value
);
LogMessage
&
operator
<<
(
int
value
);
...
@@ -652,7 +651,7 @@ class LIBPROTOBUF_EXPORT LogMessage {
...
@@ -652,7 +651,7 @@ class LIBPROTOBUF_EXPORT LogMessage {
LogLevel
level_
;
LogLevel
level_
;
const
char
*
filename_
;
const
char
*
filename_
;
int
line_
;
int
line_
;
string
message_
;
st
d
::
st
ring
message_
;
};
};
// Used to make the entire "LOG(BLAH) << etc." expression have a void return
// Used to make the entire "LOG(BLAH) << etc." expression have a void return
...
@@ -731,7 +730,7 @@ class LIBPROTOBUF_EXPORT LogFinisher {
...
@@ -731,7 +730,7 @@ class LIBPROTOBUF_EXPORT LogFinisher {
#endif // !NDEBUG
#endif // !NDEBUG
typedef
void
LogHandler
(
LogLevel
level
,
const
char
*
filename
,
int
line
,
typedef
void
LogHandler
(
LogLevel
level
,
const
char
*
filename
,
int
line
,
const
string
&
message
);
const
st
d
::
st
ring
&
message
);
// The protobuf library sometimes writes warning and error messages to
// The protobuf library sometimes writes warning and error messages to
// stderr. These messages are primarily useful for developers, but may
// stderr. These messages are primarily useful for developers, but may
...
@@ -1173,6 +1172,10 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)());
...
@@ -1173,6 +1172,10 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)());
}
// namespace internal
}
// namespace internal
// This is at the end of the file instead of the beginning to work around a bug
// in some versions of MSVC.
using
namespace
std
;
// Don't do this at home, kids.
}
// namespace protobuf
}
// namespace protobuf
}
// namespace google
}
// namespace google
...
...
src/google/protobuf/stubs/hash.cc
deleted
100644 → 0
View file @
0acafda8
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Author: kenton@google.com (Kenton Varda)
#include <google/protobuf/stubs/hash.h>
namespace
google
{
namespace
protobuf
{
// Nothing needed here right now.
}
// namespace protobuf
}
// namespace google
src/google/protobuf/wire_format_lite_inl.h
View file @
2726e7a6
...
@@ -222,7 +222,7 @@ inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
...
@@ -222,7 +222,7 @@ inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
}
}
template
<
typename
CType
,
enum
WireFormatLite
::
FieldType
DeclaredType
>
template
<
typename
CType
,
enum
WireFormatLite
::
FieldType
DeclaredType
>
inline
bool
WireFormatLite
::
ReadRepeatedPrimitive
(
int
tag_size
,
inline
bool
WireFormatLite
::
ReadRepeatedPrimitive
(
int
,
// tag_size, unused.
uint32
tag
,
uint32
tag
,
io
::
CodedInputStream
*
input
,
io
::
CodedInputStream
*
input
,
RepeatedField
<
CType
>*
values
)
{
RepeatedField
<
CType
>*
values
)
{
...
...
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