diff options
author | drivehappy <drivehappy@gmail.com> | 2017-08-21 10:10:34 -0700 |
---|---|---|
committer | drivehappy <drivehappy@gmail.com> | 2017-08-21 10:10:34 -0700 |
commit | 1183f4864bfedfbd21e061c236c9ff47961832ae (patch) | |
tree | 8c1ed69f5ae2c665016c3b0bee33f3cd0ced283a | |
parent | 1825d6d8f0aedcd7966c5c137a71e46ae650b3da (diff) | |
download | protobuf-1183f4864bfedfbd21e061c236c9ff47961832ae.tar.gz protobuf-1183f4864bfedfbd21e061c236c9ff47961832ae.tar.bz2 protobuf-1183f4864bfedfbd21e061c236c9ff47961832ae.zip |
Fixing unused parameter warnings under Clang.
-rw-r--r-- | src/google/protobuf/map.h | 3 | ||||
-rw-r--r-- | src/google/protobuf/map_type_handler.h | 59 |
2 files changed, 33 insertions, 29 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 6a88600c..ec487fcd 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -181,7 +181,7 @@ class Map { MapAllocator(const MapAllocator<X>& allocator) : arena_(allocator.arena()) {} - pointer allocate(size_type n, const void* hint = 0) { + pointer allocate(size_type n, const void* /* hint */ = 0) { // If arena is not given, malloc needs to be called which doesn't // construct element object. if (arena_ == NULL) { @@ -197,6 +197,7 @@ class Map { #if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation) ::operator delete(p, n * sizeof(value_type)); #else + (void)n; ::operator delete(p); #endif } diff --git a/src/google/protobuf/map_type_handler.h b/src/google/protobuf/map_type_handler.h index aa365991..549a77c8 100644 --- a/src/google/protobuf/map_type_handler.h +++ b/src/google/protobuf/map_type_handler.h @@ -73,7 +73,7 @@ class MapValueInitializer<true, Type> { template <typename Type> class MapValueInitializer<false, Type> { public: - static inline void Initialize(Type& value, int default_enum_value) {} + static inline void Initialize(Type& /* value */, int /* default_enum_value */) {} }; template <typename Type, bool is_arena_constructable> @@ -302,7 +302,7 @@ GOOGLE_PROTOBUF_BYTE_SIZE(ENUM , Enum) #define FIXED_BYTE_SIZE(FieldType, DeclaredType) \ template <typename Type> \ inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \ - const MapEntryAccessorType& value) { \ + const MapEntryAccessorType& /* value */) { \ return WireFormatLite::k##DeclaredType##Size; \ } @@ -349,7 +349,7 @@ GET_CACHED_SIZE(ENUM , Enum) template <typename Type> \ inline int \ MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::GetCachedSize( \ - const MapEntryAccessorType& value) { \ + const MapEntryAccessorType& /* value */) { \ return WireFormatLite::k##DeclaredType##Size; \ } @@ -480,20 +480,20 @@ size_t MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::SpaceUsedInMapLong( template <typename Type> inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Clear( - Type** value, Arena* arena) { + Type** value, Arena* /* arena */) { if (*value != NULL) (*value)->Clear(); } template <typename Type> inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ClearMaybeByDefaultEnum(Type** value, - Arena* arena, - int default_enum_value) { + Arena* /* arena */, + int /* default_enum_value */) { if (*value != NULL) (*value)->Clear(); } template <typename Type> inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Merge( - const Type& from, Type** to, Arena* arena) { + const Type& from, Type** to, Arena* /* arena */) { (*to)->MergeFrom(from); } @@ -512,14 +512,14 @@ inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, template <typename Type> inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Initialize(Type** x, - Arena* arena) { + Arena* /* arena */) { *x = NULL; } template <typename Type> inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>:: - InitializeMaybeByDefaultEnum(Type** x, int default_enum_value, - Arena* arena) { + InitializeMaybeByDefaultEnum(Type** x, int /* default_enum_value */, + Arena* /* arena */) { *x = NULL; } @@ -584,7 +584,7 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>:: \ ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* arena, \ - int default_enum) { \ + int /* default_enum */) { \ Clear(value, arena); \ } \ template <typename Type> \ @@ -599,18 +599,19 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ - Type>::AssignDefaultValue(TypeOnMemory* value) {} \ + Type>::AssignDefaultValue(TypeOnMemory* /* value */) {} \ template <typename Type> \ inline void \ MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Initialize( \ - TypeOnMemory* value, Arena* arena) { \ + TypeOnMemory* value, Arena* /* arena */) { \ value->UnsafeSetDefault( \ &::google::protobuf::internal::GetEmptyStringAlreadyInited()); \ } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>:: \ InitializeMaybeByDefaultEnum(TypeOnMemory* value, \ - int default_enum_value, Arena* arena) { \ + int /* default_enum_value */, \ + Arena* arena) { \ Initialize(value, arena); \ } \ template <typename Type> \ @@ -627,12 +628,12 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ Type>::DefaultIfNotInitialized(const TypeOnMemory& value, \ const TypeOnMemory& \ - default_value) { \ + /* default_value */) { \ return value.Get(); \ } \ template <typename Type> \ inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ - Type>::IsInitialized(const TypeOnMemory& value) { \ + Type>::IsInitialized(const TypeOnMemory& /* value */) { \ return true; \ } STRING_OR_BYTES_HANDLER_FUNCTIONS(STRING) @@ -650,54 +651,56 @@ STRING_OR_BYTES_HANDLER_FUNCTIONS(BYTES) template <typename Type> \ inline size_t \ MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ - Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& value) { \ + Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& /* value */) { \ return 0; \ } \ template <typename Type> \ inline size_t \ MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong( \ - const TypeOnMemory& value) { \ + const TypeOnMemory& /* value */) { \ return sizeof(Type); \ } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear( \ - TypeOnMemory* value, Arena* arena) { \ + TypeOnMemory* value, Arena* /* arena */) { \ *value = 0; \ } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>:: \ - ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* arena, \ + ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* /* arena */, \ int default_enum_value) { \ *value = static_cast<TypeOnMemory>(default_enum_value); \ } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge( \ - const MapEntryAccessorType& from, TypeOnMemory* to, Arena* arena) { \ + const MapEntryAccessorType& from, TypeOnMemory* to, \ + Arena* /* arena */) { \ *to = from; \ } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ - Type>::DeleteNoArena(TypeOnMemory& x) {} \ + Type>::DeleteNoArena(TypeOnMemory& /* x */) {} \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ - Type>::AssignDefaultValue(TypeOnMemory* value) {} \ + Type>::AssignDefaultValue(TypeOnMemory* /* value */) {} \ template <typename Type> \ inline void \ MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Initialize( \ - TypeOnMemory* value, Arena* arena) { \ + TypeOnMemory* value, Arena* /* arena */) { \ *value = 0; \ } \ template <typename Type> \ inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>:: \ InitializeMaybeByDefaultEnum(TypeOnMemory* value, \ - int default_enum_value, Arena* arena) { \ + int default_enum_value, \ + Arena* /* arena */) { \ *value = static_cast<TypeOnMemory>(default_enum_value); \ } \ template <typename Type> \ inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ Type>::MapEntryAccessorType* \ MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable( \ - TypeOnMemory* value, Arena* arena) { \ + TypeOnMemory* value, Arena* /* arena */) { \ return value; \ } \ template <typename Type> \ @@ -706,12 +709,12 @@ STRING_OR_BYTES_HANDLER_FUNCTIONS(BYTES) MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ Type>::DefaultIfNotInitialized(const TypeOnMemory& value, \ const TypeOnMemory& \ - default_value) { \ + /* default_value */) { \ return value; \ } \ template <typename Type> \ inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType, \ - Type>::IsInitialized(const TypeOnMemory& value) { \ + Type>::IsInitialized(const TypeOnMemory& /* value */) { \ return true; \ } PRIMITIVE_HANDLER_FUNCTIONS(INT64) |