Get rid of some build warnings.

pull/116/head
Feng Xiao 10 years ago
parent 7f2a9fb1af
commit 9173ba22a9
  1. 1
      configure.ac
  2. 6
      src/google/protobuf/arena.cc
  3. 2
      src/google/protobuf/descriptor.cc
  4. 2
      src/google/protobuf/extension_set.cc
  5. 4
      src/google/protobuf/generated_message_reflection.cc
  6. 5
      src/google/protobuf/stubs/common.h
  7. 2
      src/google/protobuf/stubs/map_util.h

@ -46,6 +46,7 @@ AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
ACX_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
# test_util.cc takes forever to compile with GCC and optimization turned on.

@ -46,10 +46,10 @@ void Arena::Init(const ArenaOptions& options) {
max_block_size_ = options.max_block_size;
block_alloc = options.block_alloc;
block_dealloc = options.block_dealloc;
blocks_ = NULL;
hint_ = NULL;
blocks_ = 0;
hint_ = 0;
owns_first_block_ = true;
cleanup_list_ = NULL;
cleanup_list_ = 0;
if (options.initial_block != NULL && options.initial_block_size > 0) {
// Add first unowned block to list.

@ -144,6 +144,8 @@ const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) {
case SYNTAX_UNKNOWN:
return "unknown";
}
GOOGLE_LOG(FATAL) << "can't reach here.";
return NULL;
}
static const char * const kNonLinkedWeakMessageReplacementName = "google.protobuf.Empty";

@ -71,6 +71,8 @@ inline bool is_packable(WireFormatLite::WireType type) {
// Do not add a default statement. Let the compiler complain when someone
// adds a new wire type.
}
GOOGLE_LOG(FATAL) << "can't reach here.";
return false;
}
// Registry stuff.

@ -487,11 +487,11 @@ void GeneratedMessageReflection::SwapOneofField(
double temp_double;
bool temp_bool;
int temp_int;
Message* temp_message;
Message* temp_message = NULL;
string temp_string;
// Stores message1's oneof field to a temp variable.
const FieldDescriptor* field1;
const FieldDescriptor* field1 = NULL;
if (oneof_case1 > 0) {
field1 = descriptor_->FindFieldByNumber(oneof_case1);
//oneof_descriptor->field(oneof_case1);

@ -381,8 +381,9 @@ struct CompileAssert {
#undef GOOGLE_COMPILE_ASSERT
#define GOOGLE_COMPILE_ASSERT(expr, msg) \
typedef ::google::protobuf::internal::CompileAssert<(bool(expr))> \
msg[bool(expr) ? 1 : -1]
::google::protobuf::internal::CompileAssert<(bool(expr))> \
msg[bool(expr) ? 1 : -1]; \
(void)msg
// Implementation details of COMPILE_ASSERT:

@ -353,7 +353,6 @@ template <class Collection>
void InsertOrDie(Collection* const collection,
const typename Collection::value_type::first_type& key,
const typename Collection::value_type::second_type& data) {
typedef typename Collection::value_type value_type;
GOOGLE_CHECK(InsertIfNotPresent(collection, key, data))
<< "duplicate key: " << key;
}
@ -364,7 +363,6 @@ void InsertOrDieNoPrint(
Collection* const collection,
const typename Collection::value_type::first_type& key,
const typename Collection::value_type::second_type& data) {
typedef typename Collection::value_type value_type;
GOOGLE_CHECK(InsertIfNotPresent(collection, key, data)) << "duplicate key.";
}

Loading…
Cancel
Save