Fix lots of spelling errors (#7751)

* Fix a typo

* Fix lots of spelling errors

* Fix a few more spelling mistakes

* s/parsable/parseable/

* Don't touch the third party files

* Cloneable is the preferred C# term

* Copyable is the preferred C++ term

* Revert "s/parsable/parseable/"

This reverts commit 534ecf7675.

* Revert unparseable->unparsable corrections
pull/7752/head^2
Peter Newman 4 years ago committed by GitHub
parent 8d74659c7a
commit e2cc2de304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitignore
  2. 2
      benchmarks/README.md
  3. 12
      benchmarks/js/js_benchmark.js
  4. 12
      benchmarks/protobuf.js/protobufjs_benchmark.js
  5. 2
      cmake/CMakeLists.txt
  6. 4
      cmake/protobuf-options.cmake
  7. 4
      conformance/conformance.proto
  8. 6
      conformance/third_party/jsoncpp/json.h
  9. 2
      conformance/third_party/jsoncpp/jsoncpp.cpp
  10. 2
      csharp/src/AddressBook/Program.cs
  11. 4
      csharp/src/Google.Protobuf.Conformance/Conformance.cs
  12. 2
      csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs
  13. 2
      csharp/src/Google.Protobuf.Test/IssuesTest.cs
  14. 2
      csharp/src/Google.Protobuf/ByteString.cs
  15. 2
      csharp/src/Google.Protobuf/CodedInputStream.cs
  16. 2
      csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs
  17. 2
      csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
  18. 2
      docs/csharp/proto2.md
  19. 2
      docs/field_presence.md
  20. 2
      docs/implementing_proto3_presence.md
  21. 2
      java/README.md
  22. 2
      java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/descriptor.proto
  23. 2
      java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/descriptor.proto
  24. 4
      java/core/src/main/java/com/google/protobuf/ArrayDecoders.java
  25. 2
      java/core/src/main/java/com/google/protobuf/Descriptors.java
  26. 2
      java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java
  27. 2
      java/core/src/main/java/com/google/protobuf/MapEntryLite.java
  28. 2
      js/binary/utils.js
  29. 28
      js/experimental/runtime/kernel/kernel_test.js
  30. 4
      js/experimental/runtime/kernel/tag_test.js
  31. 2
      kokoro/release/collect_all_artifacts.sh
  32. 2
      objectivec/DevTools/compile_testing_protos.sh
  33. 2
      objectivec/DevTools/full_mac_build.sh
  34. 2
      objectivec/DevTools/pddm.py
  35. 2
      objectivec/GPBApi.pbobjc.h
  36. 4
      objectivec/GPBExtensionInternals.m
  37. 2
      objectivec/GPBMessage.m
  38. 2
      objectivec/GPBUtilities.m
  39. 2
      objectivec/GPBUtilities_PackagePrivate.h
  40. 2
      objectivec/README.md
  41. 2
      objectivec/Tests/CocoaPods/run_tests.sh
  42. 2
      objectivec/Tests/GPBCodedInputStreamTests.m
  43. 2
      objectivec/Tests/GPBCodedOuputStreamTests.m
  44. 4
      php/ext/google/protobuf/php-upb.h
  45. 2
      php/src/Google/Protobuf/Mixin.php
  46. 2
      php/tests/descriptors_test.php
  47. 2
      php/tests/test.sh
  48. 2
      python/README.md
  49. 2
      python/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/descriptor.proto
  50. 4
      python/google/protobuf/descriptor.py
  51. 2
      python/google/protobuf/descriptor_database.py
  52. 2
      python/google/protobuf/internal/json_format_test.py
  53. 2
      python/google/protobuf/internal/message_test.py
  54. 4
      python/google/protobuf/internal/reflection_test.py
  55. 2
      python/google/protobuf/internal/well_known_types.py
  56. 2
      python/google/protobuf/pyext/scoped_pyobject_ptr.h
  57. 4
      ruby/ext/google/protobuf_c/upb.h
  58. 2
      src/google/protobuf/api.proto
  59. 2
      src/google/protobuf/arena_test_util.h
  60. 2
      src/google/protobuf/compiler/command_line_interface.h
  61. 2
      src/google/protobuf/compiler/cpp/cpp_message.h
  62. 4
      src/google/protobuf/compiler/importer_unittest.cc
  63. 2
      src/google/protobuf/compiler/java/java_enum_field.cc
  64. 2
      src/google/protobuf/compiler/java/java_message_field.cc
  65. 2
      src/google/protobuf/compiler/java/java_primitive_field.cc
  66. 2
      src/google/protobuf/compiler/java/java_string_field.cc
  67. 4
      src/google/protobuf/compiler/js/js_generator.h
  68. 2
      src/google/protobuf/compiler/objectivec/objectivec_file.cc
  69. 2
      src/google/protobuf/compiler/objectivec/objectivec_generator.cc
  70. 2
      src/google/protobuf/compiler/python/python_generator.cc
  71. 2
      src/google/protobuf/compiler/ruby/ruby_generator.cc
  72. 2
      src/google/protobuf/descriptor.cc
  73. 2
      src/google/protobuf/descriptor_unittest.cc
  74. 2
      src/google/protobuf/generated_message_table_driven.h
  75. 4
      src/google/protobuf/io/coded_stream.h
  76. 2
      src/google/protobuf/io/zero_copy_stream_unittest.cc
  77. 2
      src/google/protobuf/map.h
  78. 4
      src/google/protobuf/map_field.h
  79. 2
      src/google/protobuf/map_field_lite.h
  80. 2
      src/google/protobuf/map_test.cc
  81. 2
      src/google/protobuf/message.h
  82. 2
      src/google/protobuf/parse_context.cc
  83. 2
      src/google/protobuf/stubs/casts.h
  84. 2
      src/google/protobuf/stubs/common.cc
  85. 2
      src/google/protobuf/stubs/time_test.cc
  86. 4
      src/google/protobuf/text_format_unittest.cc
  87. 6
      src/google/protobuf/util/field_mask_util.cc
  88. 2
      src/google/protobuf/util/internal/constants.h
  89. 2
      src/google/protobuf/util/internal/json_objectwriter.h
  90. 2
      src/google/protobuf/util/internal/json_stream_parser_test.cc
  91. 2
      src/google/protobuf/util/internal/type_info_test_helper.h
  92. 2
      src/google/protobuf/util/internal/utility.h
  93. 2
      src/google/protobuf/util/message_differencer.cc
  94. 2
      src/google/protobuf/util/message_differencer.h

2
.gitignore vendored

@ -104,7 +104,7 @@ build_msvc
# needed to trigger "pod install" to rerun the preinstall commands. # needed to trigger "pod install" to rerun the preinstall commands.
Pods/ Pods/
# Comformance test output # Conformance test output
conformance/.libs/ conformance/.libs/
conformance/com/ conformance/com/
conformance/conformance-cpp conformance/conformance-cpp

@ -135,7 +135,7 @@ $ make go
### PHP ### PHP
We have two version of php protobuf implemention: pure php, php with c extension. To run these version benchmark, you need to: We have two version of php protobuf implementation: pure php, php with c extension. To run these version benchmark, you need to:
#### Pure PHP #### Pure PHP
``` ```
$ make php $ make php

@ -41,9 +41,9 @@ process.argv.forEach(function(filename, index) {
totalBytes += onePayload.length; totalBytes += onePayload.length;
}); });
var senarios = benchmarkSuite.newBenchmark( var scenarios = benchmarkSuite.newBenchmark(
benchmarkDataset.getMessageName(), filename, "js"); benchmarkDataset.getMessageName(), filename, "js");
senarios.suite scenarios.suite
.add("js deserialize", function() { .add("js deserialize", function() {
benchmarkDataset.getPayloadList().forEach(function(onePayload) { benchmarkDataset.getPayloadList().forEach(function(onePayload) {
var protoType = getNewPrototype(benchmarkDataset.getMessageName()); var protoType = getNewPrototype(benchmarkDataset.getMessageName());
@ -61,15 +61,15 @@ process.argv.forEach(function(filename, index) {
results.push({ results.push({
filename: filename, filename: filename,
benchmarks: { benchmarks: {
protobufjs_decoding: senarios.benches[0] * totalBytes / 1024 / 1024, protobufjs_decoding: scenarios.benches[0] * totalBytes / 1024 / 1024,
protobufjs_encoding: senarios.benches[1] * totalBytes / 1024 / 1024 protobufjs_encoding: scenarios.benches[1] * totalBytes / 1024 / 1024
} }
}) })
console.log("Throughput for deserialize: " console.log("Throughput for deserialize: "
+ senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
console.log("Throughput for serialize: " console.log("Throughput for serialize: "
+ senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
console.log(""); console.log("");
}); });
console.log("#####################################################"); console.log("#####################################################");

@ -31,9 +31,9 @@ process.argv.forEach(function(filename, index) {
totalBytes += onePayload.length; totalBytes += onePayload.length;
}); });
var senarios = benchmarkSuite.newBenchmark( var scenarios = benchmarkSuite.newBenchmark(
benchmarkDataset.messageName, filename, "protobufjs"); benchmarkDataset.messageName, filename, "protobufjs");
senarios.suite scenarios.suite
.add("protobuf.js static decoding", function() { .add("protobuf.js static decoding", function() {
benchmarkDataset.payload.forEach(function(onePayload) { benchmarkDataset.payload.forEach(function(onePayload) {
var protoType = getNewPrototype(benchmarkDataset.messageName); var protoType = getNewPrototype(benchmarkDataset.messageName);
@ -51,15 +51,15 @@ process.argv.forEach(function(filename, index) {
results.push({ results.push({
filename: filename, filename: filename,
benchmarks: { benchmarks: {
protobufjs_decoding: senarios.benches[0] * totalBytes, protobufjs_decoding: scenarios.benches[0] * totalBytes,
protobufjs_encoding: senarios.benches[1] * totalBytes protobufjs_encoding: scenarios.benches[1] * totalBytes
} }
}) })
console.log("Throughput for decoding: " console.log("Throughput for decoding: "
+ senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
console.log("Throughput for encoding: " console.log("Throughput for encoding: "
+ senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
console.log(""); console.log("");
}); });
console.log("#####################################################"); console.log("#####################################################");

@ -29,7 +29,7 @@ else()
endif() endif()
# The Intel compiler isn't able to deal with noinline member functions of # The Intel compiler isn't able to deal with noinline member functions of
# template classses defined in headers. As such it spams the output with # template classes defined in headers. As such it spams the output with
# warning #2196: routine is both "inline" and "noinline" # warning #2196: routine is both "inline" and "noinline"
# This silences that warning. # This silences that warning.
if (CMAKE_CXX_COMPILER_ID MATCHES Intel) if (CMAKE_CXX_COMPILER_ID MATCHES Intel)

@ -2,6 +2,6 @@
option(protobuf_VERBOSE "Enable for verbose output" OFF) option(protobuf_VERBOSE "Enable for verbose output" OFF)
mark_as_advanced(protobuf_VERBOSE) mark_as_advanced(protobuf_VERBOSE)
# FindProtobuf module compatibel # FindProtobuf module compatible
option(protobuf_MODULE_COMPATIBLE "CMake build-in FindProtobuf.cmake module compatible" OFF) option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF)
mark_as_advanced(protobuf_MODULE_COMPATIBLE) mark_as_advanced(protobuf_MODULE_COMPATIBLE)

@ -64,7 +64,7 @@ enum TestCategory {
BINARY_TEST = 1; // Test binary wire format. BINARY_TEST = 1; // Test binary wire format.
JSON_TEST = 2; // Test json wire format. JSON_TEST = 2; // Test json wire format.
// Similar to JSON_TEST. However, during parsing json, testee should ignore // Similar to JSON_TEST. However, during parsing json, testee should ignore
// unknown fields. This feature is optional. Each implementation can descide // unknown fields. This feature is optional. Each implementation can decide
// whether to support it. See // whether to support it. See
// https://developers.google.com/protocol-buffers/docs/proto3#json_options // https://developers.google.com/protocol-buffers/docs/proto3#json_options
// for more detail. // for more detail.
@ -113,7 +113,7 @@ message ConformanceRequest {
string message_type = 4; string message_type = 4;
// Each test is given a specific test category. Some category may need // Each test is given a specific test category. Some category may need
// spedific support in testee programs. Refer to the definition of TestCategory // specific support in testee programs. Refer to the definition of TestCategory
// for more information. // for more information.
TestCategory test_category = 5; TestCategory test_category = 5;

@ -1371,7 +1371,7 @@ public:
*/ */
std::string getFormattedErrorMessages() const; std::string getFormattedErrorMessages() const;
/** \brief Returns a vector of structured errors encounted while parsing. /** \brief Returns a vector of structured errors encountered while parsing.
* \return A (possibly empty) vector of StructuredError objects. Currently * \return A (possibly empty) vector of StructuredError objects. Currently
* only one error can be returned, but the caller should tolerate * only one error can be returned, but the caller should tolerate
* multiple * multiple
@ -1867,7 +1867,7 @@ private:
* - otherwise, it the values do not fit on one line, or the array contains * - otherwise, it the values do not fit on one line, or the array contains
* object or non empty array, then print one value per line. * object or non empty array, then print one value per line.
* *
* If the Value have comments then they are outputed according to their * If the Value have comments then they are outputted according to their
*#CommentPlacement. *#CommentPlacement.
* *
* \sa Reader, Value, Value::setComment() * \sa Reader, Value, Value::setComment()
@ -1928,7 +1928,7 @@ private:
* - otherwise, it the values do not fit on one line, or the array contains * - otherwise, it the values do not fit on one line, or the array contains
* object or non empty array, then print one value per line. * object or non empty array, then print one value per line.
* *
* If the Value have comments then they are outputed according to their * If the Value have comments then they are outputted according to their
#CommentPlacement. #CommentPlacement.
* *
* \param indentation Each level will be indented by this amount extra. * \param indentation Each level will be indented by this amount extra.

@ -142,7 +142,7 @@ enum {
typedef char UIntToStringBuffer[uintToStringBufferSize]; typedef char UIntToStringBuffer[uintToStringBufferSize];
/** Converts an unsigned integer to string. /** Converts an unsigned integer to string.
* @param value Unsigned interger to convert to string * @param value Unsigned integer to convert to string
* @param current Input/Output string buffer. * @param current Input/Output string buffer.
* Must have at least uintToStringBufferSize chars free. * Must have at least uintToStringBufferSize chars free.
*/ */

@ -37,7 +37,7 @@ namespace Google.Protobuf.Examples.AddressBook
/// <summary> /// <summary>
/// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour
/// to individual actions. Each action has its own Main method, so that it can be used as an /// to individual actions. Each action has its own Main method, so that it can be used as an
/// invidual complete program. /// individual complete program.
/// </summary> /// </summary>
internal class Program internal class Program
{ {

@ -82,7 +82,7 @@ namespace Conformance {
[pbr::OriginalName("JSON_TEST")] JsonTest = 2, [pbr::OriginalName("JSON_TEST")] JsonTest = 2,
/// <summary> /// <summary>
/// Similar to JSON_TEST. However, during parsing json, testee should ignore /// Similar to JSON_TEST. However, during parsing json, testee should ignore
/// unknown fields. This feature is optional. Each implementation can descide /// unknown fields. This feature is optional. Each implementation can decide
/// whether to support it. See /// whether to support it. See
/// https://developers.google.com/protocol-buffers/docs/proto3#json_options /// https://developers.google.com/protocol-buffers/docs/proto3#json_options
/// for more detail. /// for more detail.
@ -414,7 +414,7 @@ namespace Conformance {
private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest; private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest;
/// <summary> /// <summary>
/// Each test is given a specific test category. Some category may need /// Each test is given a specific test category. Some category may need
/// spedific support in testee programs. Refer to the definition of TestCategory /// specific support in testee programs. Refer to the definition of TestCategory
/// for more information. /// for more information.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]

@ -60,7 +60,7 @@ namespace Google.Protobuf.Buffers
} }
/// <summary> /// <summary>
/// Userful for testing writing to buffer writer with a lot of small segments. /// Useful for testing writing to buffer writer with a lot of small segments.
/// If set, it limits the max number of bytes by which the buffer grows by at once. /// If set, it limits the max number of bytes by which the buffer grows by at once.
/// </summary> /// </summary>
public int? MaxGrowBy { get; set; } public int? MaxGrowBy { get; set; }

@ -108,7 +108,7 @@ namespace Google.Protobuf
// we still must read the tag correctly, even though the tag is at the very end of our limited input // we still must read the tag correctly, even though the tag is at the very end of our limited input
// (which is a corner case and will most likely result in an error when trying to read value of the field // (which is a corner case and will most likely result in an error when trying to read value of the field
// decribed by this tag, but it would be a logical error not to read the tag that's actually present). // described by this tag, but it would be a logical error not to read the tag that's actually present).
// See https://github.com/protocolbuffers/protobuf/pull/7289 // See https://github.com/protocolbuffers/protobuf/pull/7289
cis.AssertNextTag(WireFormat.MakeTag(11, WireFormat.WireType.Varint)); cis.AssertNextTag(WireFormat.MakeTag(11, WireFormat.WireType.Varint));
} }

@ -269,7 +269,7 @@ namespace Google.Protobuf
} }
/// <summary> /// <summary>
/// Retuns the byte at the given index. /// Returns the byte at the given index.
/// </summary> /// </summary>
public byte this[int index] public byte this[int index]
{ {

@ -652,7 +652,7 @@ namespace Google.Protobuf
/// <summary> /// <summary>
/// Called when buffer is empty to read more bytes from the /// Called when buffer is empty to read more bytes from the
/// input. If <paramref name="mustSucceed"/> is true, RefillBuffer() gurantees that /// input. If <paramref name="mustSucceed"/> is true, RefillBuffer() guarantees that
/// either there will be at least one byte in the buffer when it returns /// either there will be at least one byte in the buffer when it returns
/// or it will throw an exception. If <paramref name="mustSucceed"/> is false, /// or it will throw an exception. If <paramref name="mustSucceed"/> is false,
/// RefillBuffer() returns false if no more bytes were available. /// RefillBuffer() returns false if no more bytes were available.

@ -63,7 +63,7 @@ namespace Google.Protobuf.Reflection
internal static OneofAccessor ForSyntheticOneof(OneofDescriptor descriptor) internal static OneofAccessor ForSyntheticOneof(OneofDescriptor descriptor)
{ {
// Note: descriptor.Fields will be null when this method is called, because we haven't // Note: descriptor.Fields will be null when this method is called, because we haven't
// cross-linked yet. But by the time the delgates are called by user code, all will be // cross-linked yet. But by the time the delegates are called by user code, all will be
// well. (That's why we capture the descriptor itself rather than a field.) // well. (That's why we capture the descriptor itself rather than a field.)
return new OneofAccessor(descriptor, return new OneofAccessor(descriptor,
message => descriptor.Fields[0].Accessor.HasValue(message) ? descriptor.Fields[0].FieldNumber : 0, message => descriptor.Fields[0].Accessor.HasValue(message) ? descriptor.Fields[0].FieldNumber : 0,

@ -918,7 +918,7 @@ namespace Google.Protobuf.WellKnownTypes {
/// The mixin construct implies that all methods in `AccessControl` are /// The mixin construct implies that all methods in `AccessControl` are
/// also declared with same name and request/response types in /// also declared with same name and request/response types in
/// `Storage`. A documentation generator or annotation processor will /// `Storage`. A documentation generator or annotation processor will
/// see the effective `Storage.GetAcl` method after inherting /// see the effective `Storage.GetAcl` method after inheriting
/// documentation and annotations as follows: /// documentation and annotations as follows:
/// ///
/// service Storage { /// service Storage {

@ -97,7 +97,7 @@ foo.GetOrInitializeExtension(RepeatedFooExt).Add(new Baz());
### Message initialization ### Message initialization
Initialization refers to checking the status of required fields in a proto2 message. If a message is uninitialized, not all required fields are set in either the message itself or any of its submessages. In other languages, missing required fields throw errors depending on the merge method used. This could cause unforseen errors at runtime if the incorrect method is used. Initialization refers to checking the status of required fields in a proto2 message. If a message is uninitialized, not all required fields are set in either the message itself or any of its submessages. In other languages, missing required fields throw errors depending on the merge method used. This could cause unforeseen errors at runtime if the incorrect method is used.
However, in this implementation, parsers and input streams don't check messages for initialization on their own and throw errors. Instead it's up to you to handle messages with missing required fields in whatever way you see fit. However, in this implementation, parsers and input streams don't check messages for initialization on their own and throw errors. Instead it's up to you to handle messages with missing required fields in whatever way you see fit.
Checking message initialization can be done manually via the `IsInitialized` extension method in `MessageExtensions`. Checking message initialization can be done manually via the `IsInitialized` extension method in `MessageExtensions`.

@ -127,7 +127,7 @@ The _no presence_ serialization discipline results in visible differences from t
### Considerations for merging ### Considerations for merging
Under the _no presence_ rules, it is effectively impossible for a target field to merge-from its default value (using the protobuf's API merging functions). This is because default values are skipped, simliar to the _no presence_ serialization discipline. Merging only updates the target (merged-to) message using the non-skipped values from the update (merged-from) message. Under the _no presence_ rules, it is effectively impossible for a target field to merge-from its default value (using the protobuf's API merging functions). This is because default values are skipped, similar to the _no presence_ serialization discipline. Merging only updates the target (merged-to) message using the non-skipped values from the update (merged-from) message.
The difference in merging behavior has further implications for protocols which rely on partial "patch" updates. If field presence is not tracked, then an update patch alone cannot represent an update to the default value, because only non-default values are merged-from. The difference in merging behavior has further implications for protocols which rely on partial "patch" updates. If field presence is not tracked, then an update patch alone cannot represent an update to the default value, because only non-default values are merged-from.

@ -13,7 +13,7 @@ optional fields. First-party code generators developed by Google are being
updated already. However third-party code generators will need to be updated updated already. However third-party code generators will need to be updated
independently by their authors. This includes: independently by their authors. This includes:
- implementations of Protocol Buffers for other languges. - implementations of Protocol Buffers for other languages.
- alternate implementations of Protocol Buffers that target specialized use - alternate implementations of Protocol Buffers that target specialized use
cases. cases.
- RPC code generators that create generated APIs for service calls. - RPC code generators that create generated APIs for service calls.

@ -68,7 +68,7 @@ how to use them.
Most users should follow the instructions above to use protobuf Java runtime. Most users should follow the instructions above to use protobuf Java runtime.
If you are contributing code to protobuf or want to use a protobuf version If you are contributing code to protobuf or want to use a protobuf version
that hasn't been officially released yet, you can folllow the instructions that hasn't been officially released yet, you can follow the instructions
below to build protobuf from source code. below to build protobuf from source code.
### Build from Source - With Maven ### Build from Source - With Maven

@ -74,7 +74,7 @@ message FileDescriptorProto {
optional FileOptions options = 8; optional FileOptions options = 8;
// This field contains optional information about the original source code. // This field contains optional information about the original source code.
// You may safely remove this entire field whithout harming runtime // You may safely remove this entire field without harming runtime
// functionality of the descriptors -- the information is needed only by // functionality of the descriptors -- the information is needed only by
// development tools. // development tools.
optional SourceCodeInfo source_code_info = 9; optional SourceCodeInfo source_code_info = 9;

@ -74,7 +74,7 @@ message FileDescriptorProto {
optional FileOptions options = 8; optional FileOptions options = 8;
// This field contains optional information about the original source code. // This field contains optional information about the original source code.
// You may safely remove this entire field whithout harming runtime // You may safely remove this entire field without harming runtime
// functionality of the descriptors -- the information is needed only by // functionality of the descriptors -- the information is needed only by
// development tools. // development tools.
optional SourceCodeInfo source_code_info = 9; optional SourceCodeInfo source_code_info = 9;

@ -39,7 +39,7 @@ import java.io.IOException;
* Helper functions to decode protobuf wire format from a byte array. * Helper functions to decode protobuf wire format from a byte array.
* *
* <p>Note that these functions don't do boundary check on the byte array but instead rely on Java * <p>Note that these functions don't do boundary check on the byte array but instead rely on Java
* VM to check it. That means parsing rountines utilizing these functions must catch * VM to check it. That means parsing routines utilizing these functions must catch
* IndexOutOfBoundsException and convert it to protobuf's InvalidProtocolBufferException when * IndexOutOfBoundsException and convert it to protobuf's InvalidProtocolBufferException when
* crossing protobuf public API boundaries. * crossing protobuf public API boundaries.
*/ */
@ -51,7 +51,7 @@ final class ArrayDecoders {
* multiple values and let the function set the return value in this Registers instance instead. * multiple values and let the function set the return value in this Registers instance instead.
* *
* <p>TODO(xiaofeng): This could be merged into CodedInputStream or CodedInputStreamReader which * <p>TODO(xiaofeng): This could be merged into CodedInputStream or CodedInputStreamReader which
* is already being passed through all the parsing rountines. * is already being passed through all the parsing routines.
*/ */
static final class Registers { static final class Registers {
public int int1; public int int1;

@ -1084,7 +1084,7 @@ public final class Descriptors {
/** /**
* Does this field have the {@code [packed = true]} option or is this field packable in proto3 * Does this field have the {@code [packed = true]} option or is this field packable in proto3
* and not explicitly setted to unpacked? * and not explicitly set to unpacked?
*/ */
@Override @Override
public boolean isPacked() { public boolean isPacked() {

@ -223,7 +223,7 @@ public abstract class GeneratedMessageLite<
/** /**
* A method that implements different types of operations described in {@link MethodToInvoke}. * A method that implements different types of operations described in {@link MethodToInvoke}.
* Theses different kinds of operations are required to implement message-level operations for * These different kinds of operations are required to implement message-level operations for
* builders in the runtime. This method bundles those operations to reduce the generated methods * builders in the runtime. This method bundles those operations to reduce the generated methods
* count. * count.
* *

@ -192,7 +192,7 @@ public class MapEntryLite<K, V> {
} }
/** /**
* Parses an entry off of the input into the map. This helper avoids allocaton of a {@link * Parses an entry off of the input into the map. This helper avoids allocation of a {@link
* MapEntryLite} by parsing directly into the provided {@link MapFieldLite}. * MapEntryLite} by parsing directly into the provided {@link MapFieldLite}.
*/ */
public void parseInto( public void parseInto(

@ -258,7 +258,7 @@ jspb.utils.splitFloat64 = function(value) {
// Compute the least significant exponent needed to represent the magnitude of // Compute the least significant exponent needed to represent the magnitude of
// the value by repeadly dividing/multiplying by 2 until the magnitude // the value by repeadly dividing/multiplying by 2 until the magnitude
// crosses 2. While tempting to use log math to find the exponent, at the // crosses 2. While tempting to use log math to find the exponent, at the
// bounadaries of precision, the result can be off by one. // boundaries of precision, the result can be off by one.
var maxDoubleExponent = 1023; var maxDoubleExponent = 1023;
var minDoubleExponent = -1022; var minDoubleExponent = -1022;
var x = value; var x = value;

@ -699,7 +699,7 @@ describe('Bytes access', () => {
expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString); expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer( const accessor = Kernel.fromArrayBuffer(
createArrayBuffer(0x0A, 0x01, 0x00, 0x0A, 0x01, 0x01)); createArrayBuffer(0x0A, 0x01, 0x00, 0x0A, 0x01, 0x01));
expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString); expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString);
@ -801,7 +801,7 @@ describe('Fixed32 access', () => {
expect(accessor.getFixed32WithDefault(1)).toEqual(1); expect(accessor.getFixed32WithDefault(1)).toEqual(1);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer( const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00)); 0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00));
expect(accessor.getFixed32WithDefault(1)).toEqual(2); expect(accessor.getFixed32WithDefault(1)).toEqual(2);
@ -909,7 +909,7 @@ describe('Fixed64 access', () => {
expect(accessor.getFixed64WithDefault(1)).toEqual(Int64.fromInt(1)); expect(accessor.getFixed64WithDefault(1)).toEqual(Int64.fromInt(1));
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer( const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00)); 0x00, 0x00, 0x00, 0x00, 0x00, 0x00));
@ -1008,7 +1008,7 @@ describe('Float access', () => {
expect(accessor.getFloatWithDefault(1)).toEqual(1); expect(accessor.getFloatWithDefault(1)).toEqual(1);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer( const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x0D, 0x00, 0x00, 0x80, 0x3F, 0x0D, 0x00, 0x00, 0x80, 0xBF)); 0x0D, 0x00, 0x00, 0x80, 0x3F, 0x0D, 0x00, 0x00, 0x80, 0xBF));
expect(accessor.getFloatWithDefault(1)).toEqual(-1); expect(accessor.getFloatWithDefault(1)).toEqual(-1);
@ -1110,7 +1110,7 @@ describe('Int32 access', () => {
expect(accessor.getInt32WithDefault(1)).toEqual(1); expect(accessor.getInt32WithDefault(1)).toEqual(1);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getInt32WithDefault(1)).toEqual(2); expect(accessor.getInt32WithDefault(1)).toEqual(2);
@ -1207,7 +1207,7 @@ describe('Int64 access', () => {
expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(1)); expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(1));
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(2)); expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(2));
@ -1306,7 +1306,7 @@ describe('Sfixed32 access', () => {
expect(accessor.getSfixed32WithDefault(1)).toEqual(1); expect(accessor.getSfixed32WithDefault(1)).toEqual(1);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer( const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00)); 0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00));
expect(accessor.getSfixed32WithDefault(1)).toEqual(2); expect(accessor.getSfixed32WithDefault(1)).toEqual(2);
@ -1404,7 +1404,7 @@ describe('Sfixed64 access', () => {
expect(accessor.getSfixed64WithDefault(1)).toEqual(Int64.fromInt(1)); expect(accessor.getSfixed64WithDefault(1)).toEqual(Int64.fromInt(1));
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer( const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00)); 0x00, 0x00, 0x00, 0x00, 0x00, 0x00));
@ -1502,7 +1502,7 @@ describe('Sint32 access', () => {
expect(accessor.getSint32WithDefault(1)).toEqual(1); expect(accessor.getSint32WithDefault(1)).toEqual(1);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x03, 0x08, 0x02)); Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x03, 0x08, 0x02));
expect(accessor.getSint32WithDefault(1)).toEqual(1); expect(accessor.getSint32WithDefault(1)).toEqual(1);
@ -1599,7 +1599,7 @@ describe('SInt64 access', () => {
expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1)); expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1));
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1)); expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1));
@ -1698,7 +1698,7 @@ describe('String access', () => {
expect(accessor.getStringWithDefault(1)).toEqual('a'); expect(accessor.getStringWithDefault(1)).toEqual('a');
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer( const accessor = Kernel.fromArrayBuffer(
createArrayBuffer(0x0A, 0x01, 0x60, 0x0A, 0x01, 0x61)); createArrayBuffer(0x0A, 0x01, 0x60, 0x0A, 0x01, 0x61));
expect(accessor.getStringWithDefault(1)).toEqual('a'); expect(accessor.getStringWithDefault(1)).toEqual('a');
@ -1789,7 +1789,7 @@ describe('Uint32 access', () => {
expect(accessor.getUint32WithDefault(1)).toEqual(1); expect(accessor.getUint32WithDefault(1)).toEqual(1);
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getUint32WithDefault(1)).toEqual(2); expect(accessor.getUint32WithDefault(1)).toEqual(2);
@ -1896,7 +1896,7 @@ describe('Uint64 access', () => {
expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(1)); expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(1));
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(2)); expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(2));
@ -1996,7 +1996,7 @@ describe('Double access', () => {
}); });
it('decodes value from wire with multple values being present', () => { it('decodes value from wire with multiple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer( const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x09, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF)); 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF));

@ -95,12 +95,12 @@ describe('skipField', () => {
it('skips group in group', () => { it('skips group in group', () => {
const buffer = createArrayBuffer( const buffer = createArrayBuffer(
0x0B, // start outter 0x0B, // start outer
0x10, 0x01, // field: 2, value: 1 0x10, 0x01, // field: 2, value: 1
0x0B, // start inner group 0x0B, // start inner group
0x10, 0x01, // payload inner group 0x10, 0x01, // payload inner group
0x0C, // stop inner group 0x0C, // stop inner group
0x0C // end outter 0x0C // end outer
); );
const bufferDecoder = BufferDecoder.fromArrayBuffer(buffer); const bufferDecoder = BufferDecoder.fromArrayBuffer(buffer);
bufferDecoder.setCursor(1); bufferDecoder.setCursor(1);

@ -39,7 +39,7 @@ cp ${INPUT_ARTIFACTS_DIR}/build64/Release/protoc.exe protoc/windows_x64/protoc.e
mkdir -p protoc/linux_x86 mkdir -p protoc/linux_x86
mkdir -p protoc/linux_x64 mkdir -p protoc/linux_x64
# Because of maven unrelated reasonse the linux protoc binaries have a dummy .exe extension. # Because of maven unrelated reasonse the linux protoc binaries have a dummy .exe extension.
# For the Google.Protobuf.Tools nuget, we don't want that expection, so we just remove it. # For the Google.Protobuf.Tools nuget, we don't want that exception, so we just remove it.
cp ${INPUT_ARTIFACTS_DIR}/protoc-artifacts/target/linux/x86_32/protoc.exe protoc/linux_x86/protoc cp ${INPUT_ARTIFACTS_DIR}/protoc-artifacts/target/linux/x86_32/protoc.exe protoc/linux_x86/protoc
cp ${INPUT_ARTIFACTS_DIR}/protoc-artifacts/target/linux/x86_64/protoc.exe protoc/linux_x64/protoc cp ${INPUT_ARTIFACTS_DIR}/protoc-artifacts/target/linux/x86_64/protoc.exe protoc/linux_x64/protoc

@ -95,7 +95,7 @@ cd "${SRCROOT}/.."
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
RUN_PROTOC=no RUN_PROTOC=no
# Check to if all the output files exist (incase a new one got added). # Check to if all the output files exist (in case a new one got added).
for PROTO_FILE in "${CORE_PROTO_FILES[@]}" "${OBJC_TEST_PROTO_FILES[@]}"; do for PROTO_FILE in "${CORE_PROTO_FILES[@]}" "${OBJC_TEST_PROTO_FILES[@]}"; do
DIR=${PROTO_FILE%/*} DIR=${PROTO_FILE%/*}

@ -285,7 +285,7 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
-destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
-destination "platform=iOS Simulator,name=iPhone 7,OS=latest" # 64bit -destination "platform=iOS Simulator,name=iPhone 7,OS=latest" # 64bit
# 10.x also seems to often fail running destinations in parallel (with # 10.x also seems to often fail running destinations in parallel (with
# 32bit one include atleast) # 32bit one include at least)
-disable-concurrent-destination-testing -disable-concurrent-destination-testing
) )
;; ;;

@ -645,7 +645,7 @@ def main(args):
opts, extra_args = parser.parse_args(args) opts, extra_args = parser.parse_args(args)
if not extra_args: if not extra_args:
parser.error('Need atleast one file to process') parser.error('Need at least one file to process')
result = 0 result = 0
for a_path in extra_args: for a_path in extra_args:

@ -257,7 +257,7 @@ typedef GPB_ENUM(GPBMixin_FieldNumber) {
* The mixin construct implies that all methods in `AccessControl` are * The mixin construct implies that all methods in `AccessControl` are
* also declared with same name and request/response types in * also declared with same name and request/response types in
* `Storage`. A documentation generator or annotation processor will * `Storage`. A documentation generator or annotation processor will
* see the effective `Storage.GetAcl` method after inherting * see the effective `Storage.GetAcl` method after inheriting
* documentation and annotations as follows: * documentation and annotations as follows:
* *
* service Storage { * service Storage {

@ -361,8 +361,8 @@ static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension,
if (existingValue) { if (existingValue) {
message = [existingValue retain]; message = [existingValue retain];
} else { } else {
GPBDescriptor *decriptor = [extension.msgClass descriptor]; GPBDescriptor *descriptor = [extension.msgClass descriptor];
message = [[decriptor.messageClass alloc] init]; message = [[descriptor.messageClass alloc] init];
} }
if (description->dataType == GPBDataTypeGroup) { if (description->dataType == GPBDataTypeGroup) {

@ -3286,7 +3286,7 @@ static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field,
// if a sub message in a field has extensions, the issue still exists. A // if a sub message in a field has extensions, the issue still exists. A
// recursive check could be done here (like the work in // recursive check could be done here (like the work in
// GPBMessageDropUnknownFieldsRecursively()), but that has the potential to // GPBMessageDropUnknownFieldsRecursively()), but that has the potential to
// be expensive and could slow down serialization in DEBUG enought to cause // be expensive and could slow down serialization in DEBUG enough to cause
// developers other problems. // developers other problems.
NSLog(@"Warning: writing out a GPBMessage (%@) via NSCoding and it" NSLog(@"Warning: writing out a GPBMessage (%@) via NSCoding and it"
@" has %ld extensions; when read back in, those fields will be" @" has %ld extensions; when read back in, those fields will be"

@ -219,7 +219,7 @@ void GPBCheckRuntimeVersionSupport(int32_t objcRuntimeVersion) {
// Library is too old for headers. // Library is too old for headers.
[NSException raise:NSInternalInconsistencyException [NSException raise:NSInternalInconsistencyException
format:@"Linked to ProtocolBuffer runtime version %d," format:@"Linked to ProtocolBuffer runtime version %d,"
@" but code compiled needing atleast %d!", @" but code compiled needing at least %d!",
GOOGLE_PROTOBUF_OBJC_VERSION, objcRuntimeVersion]; GOOGLE_PROTOBUF_OBJC_VERSION, objcRuntimeVersion];
} }
if (objcRuntimeVersion < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION) { if (objcRuntimeVersion < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION) {

@ -304,7 +304,7 @@ void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self,
const char *GPBMessageEncodingForSelector(SEL selector, BOOL instanceSel); const char *GPBMessageEncodingForSelector(SEL selector, BOOL instanceSel);
// Helper for text format name encoding. // Helper for text format name encoding.
// decodeData is the data describing the sepecial decodes. // decodeData is the data describing the special decodes.
// key and inputString are the input that needs decoding. // key and inputString are the input that needs decoding.
NSString *GPBDecodeTextFormatName(const uint8_t *decodeData, int32_t key, NSString *GPBDecodeTextFormatName(const uint8_t *decodeData, int32_t key,
NSString *inputString); NSString *inputString);

@ -168,7 +168,7 @@ supported keys are:
Any number of files can be listed for a framework, just separate them with Any number of files can be listed for a framework, just separate them with
commas. commas.
There can be multiple lines listing the same frameworkName incase it has a There can be multiple lines listing the same frameworkName in case it has a
lot of proto files included in it; and having multiple lines makes things lot of proto files included in it; and having multiple lines makes things
easier to read. easier to read.

@ -90,7 +90,7 @@ cleanup() {
echo "Cleaning up..." echo "Cleaning up..."
# Generally don't let things fail, and eat common stdout, but let stderr show # Generally don't let things fail, and eat common stdout, but let stderr show
# incase something does hiccup. # in case something does hiccup.
xcodebuild -workspace "${TEST_NAME}.xcworkspace" -scheme "${TEST_NAME}" clean > /dev/null || true xcodebuild -workspace "${TEST_NAME}.xcworkspace" -scheme "${TEST_NAME}" clean > /dev/null || true
pod deintegrate > /dev/null || true pod deintegrate > /dev/null || true
# Flush the cache so nothing is left behind. # Flush the cache so nothing is left behind.

@ -422,7 +422,7 @@
- (void)testBOMWithinStrings { - (void)testBOMWithinStrings {
// We've seen servers that end up with BOMs within strings (not always at the // We've seen servers that end up with BOMs within strings (not always at the
// start, and sometimes in multiple places), make sure they always parse // start, and sometimes in multiple places), make sure they always parse
// correctly. (Again, this is inpart incase a custom string class is ever // correctly. (Again, this is inpart in case a custom string class is ever
// used again.) // used again.)
const char* strs[] = { const char* strs[] = {
"\xEF\xBB\xBF String with BOM", "\xEF\xBB\xBF String with BOM",

@ -400,7 +400,7 @@
- (void)testWriteStringsWithZeroChar { - (void)testWriteStringsWithZeroChar {
// Unicode allows `\0` as a character, and NSString is a class cluster, so // Unicode allows `\0` as a character, and NSString is a class cluster, so
// there are a few different classes that could end up beind a given string. // there are a few different classes that could end up behind a given string.
// Historically, we've seen differences based on constant strings in code and // Historically, we've seen differences based on constant strings in code and
// strings built via the NSString apis. So this round trips them to ensure // strings built via the NSString apis. So this round trips them to ensure
// they are acting as expected. // they are acting as expected.

@ -208,7 +208,7 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
** store pointers or integers of at least 32 bits (upb isn't really useful on ** store pointers or integers of at least 32 bits (upb isn't really useful on
** systems where sizeof(void*) < 4). ** systems where sizeof(void*) < 4).
** **
** The table must be homogenous (all values of the same type). In debug ** The table must be homogeneous (all values of the same type). In debug
** mode, we check this on insert and lookup. ** mode, we check this on insert and lookup.
*/ */
@ -3831,7 +3831,7 @@ extern "C" {
#endif #endif
enum { enum {
/* When set, emits 0/default values. TOOD(haberman): proto3 only? */ /* When set, emits 0/default values. TODO(haberman): proto3 only? */
UPB_JSONENC_EMITDEFAULTS = 1, UPB_JSONENC_EMITDEFAULTS = 1,
/* When set, use normal (snake_caes) field names instead of JSON (camelCase) /* When set, use normal (snake_caes) field names instead of JSON (camelCase)

@ -46,7 +46,7 @@ use Google\Protobuf\Internal\GPBUtil;
* The mixin construct implies that all methods in `AccessControl` are * The mixin construct implies that all methods in `AccessControl` are
* also declared with same name and request/response types in * also declared with same name and request/response types in
* `Storage`. A documentation generator or annotation processor will * `Storage`. A documentation generator or annotation processor will
* see the effective `Storage.GetAcl` method after inherting * see the effective `Storage.GetAcl` method after inheriting
* documentation and annotations as follows: * documentation and annotations as follows:
* service Storage { * service Storage {
* // Get the underlying ACL object. * // Get the underlying ACL object.

@ -108,7 +108,7 @@ class DescriptorsTest extends TestBase
public function testEnumDescriptor() public function testEnumDescriptor()
{ {
// WARNINIG - we need to do this so that TestDescriptorsEnum is registered!!? // WARNING - we need to do this so that TestDescriptorsEnum is registered!!?
new TestDescriptorsMessage(); new TestDescriptorsMessage();
$pool = DescriptorPool::getGeneratedPool(); $pool = DescriptorPool::getGeneratedPool();

@ -55,7 +55,7 @@ valgrind --leak-check=yes php -dextension=../ext/google/protobuf/modules/protobu
valgrind --leak-check=yes php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php valgrind --leak-check=yes php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php
# TODO(teboring): Only for debug (phpunit has memory leak which blocks this beging used by # TODO(teboring): Only for debug (phpunit has memory leak which blocks this beging used by
# regresssion test.) # regression test.)
# for t in "${tests[@]}" # for t in "${tests[@]}"
# do # do

@ -22,7 +22,7 @@ package.
Development Warning Development Warning
=================== ===================
The pure python performance is slow. For better preformance please The pure python performance is slow. For better performance please
use python c++ implementation. use python c++ implementation.
Installation Installation

@ -74,7 +74,7 @@ message FileDescriptorProto {
optional FileOptions options = 8; optional FileOptions options = 8;
// This field contains optional information about the original source code. // This field contains optional information about the original source code.
// You may safely remove this entire field whithout harming runtime // You may safely remove this entire field without harming runtime
// functionality of the descriptors -- the information is needed only by // functionality of the descriptors -- the information is needed only by
// development tools. // development tools.
optional SourceCodeInfo source_code_info = 9; optional SourceCodeInfo source_code_info = 9;

@ -227,7 +227,7 @@ class _NestedDescriptorBase(DescriptorBase):
proto: An empty proto instance from descriptor_pb2. proto: An empty proto instance from descriptor_pb2.
Raises: Raises:
Error: If self couldnt be serialized, due to to few constructor arguments. Error: If self couldn't be serialized, due to to few constructor arguments.
""" """
if (self.file is not None and if (self.file is not None and
self._serialized_start is not None and self._serialized_start is not None and
@ -827,7 +827,7 @@ class ServiceDescriptor(_NestedDescriptorBase):
Args: Args:
name (str): Name of the method. name (str): Name of the method.
Returns: Returns:
MethodDescriptor or None: the desctiptor for the requested method, if MethodDescriptor or None: the descriptor for the requested method, if
found. found.
""" """
return self.methods_by_name.get(name, None) return self.methods_by_name.get(name, None)

@ -58,7 +58,7 @@ class DescriptorDatabase(object):
Raises: Raises:
DescriptorDatabaseConflictingDefinitionError: if an attempt is made to DescriptorDatabaseConflictingDefinitionError: if an attempt is made to
add a proto with the same name but different definition than an add a proto with the same name but different definition than an
exisiting proto in the database. existing proto in the database.
""" """
proto_name = file_desc_proto.name proto_name = file_desc_proto.name
if proto_name not in self._file_desc_protos_by_file: if proto_name not in self._file_desc_protos_by_file:

@ -1064,7 +1064,7 @@ class JsonFormatTest(JsonFormatBase):
json_format.ParseError, json_format.ParseError,
'Failed to parse value field: year (0 )?is out of range.', 'Failed to parse value field: year (0 )?is out of range.',
json_format.Parse, text, message) json_format.Parse, text, message)
# Time bigger than maxinum time. # Time bigger than maximum time.
message.value.seconds = 253402300800 message.value.seconds = 253402300800
self.assertRaisesRegexp( self.assertRaisesRegexp(
OverflowError, OverflowError,

@ -1059,7 +1059,7 @@ class MessageTest(unittest.TestCase):
self.assertIsInstance(m.optional_string, six.text_type) self.assertIsInstance(m.optional_string, six.text_type)
def testLongValuedSlice(self, message_module): def testLongValuedSlice(self, message_module):
"""It should be possible to use long-valued indicies in slices """It should be possible to use long-valued indices in slices
This didn't used to work in the v2 C++ implementation. This didn't used to work in the v2 C++ implementation.
""" """

@ -2813,7 +2813,7 @@ class SerializationTest(unittest.TestCase):
proto2.MergeFromString(serialized)) proto2.MergeFromString(serialized))
def _CheckRaises(self, exc_class, callable_obj, exception): def _CheckRaises(self, exc_class, callable_obj, exception):
"""This method checks if the excpetion type and message are as expected.""" """This method checks if the exception type and message are as expected."""
try: try:
callable_obj() callable_obj()
except exc_class as ex: except exc_class as ex:
@ -3267,7 +3267,7 @@ class ClassAPITest(unittest.TestCase):
# conflicting message descriptors. # conflicting message descriptors.
def testParsingFlatClassWithExplicitClassDeclaration(self): def testParsingFlatClassWithExplicitClassDeclaration(self):
"""Test that the generated class can parse a flat message.""" """Test that the generated class can parse a flat message."""
# TODO(xiaofeng): This test fails with cpp implemetnation in the call # TODO(xiaofeng): This test fails with cpp implementation in the call
# of six.with_metaclass(). The other two callsites of with_metaclass # of six.with_metaclass(). The other two callsites of with_metaclass
# in this file are both excluded from cpp test, so it might be expected # in this file are both excluded from cpp test, so it might be expected
# to fail. Need someone more familiar with the python code to take a # to fail. Need someone more familiar with the python code to take a

@ -401,7 +401,7 @@ def _CheckDurationValid(seconds, nanos):
def _RoundTowardZero(value, divider): def _RoundTowardZero(value, divider):
"""Truncates the remainder part after division.""" """Truncates the remainder part after division."""
# For some languanges, the sign of the remainder is implementation # For some languages, the sign of the remainder is implementation
# dependent if any of the operands is negative. Here we enforce # dependent if any of the operands is negative. Here we enforce
# "rounded toward zero" semantics. For example, for (-5) / 2 an # "rounded toward zero" semantics. For example, for (-5) / 2 an
# implementation may give -3 as the result with the remainder being # implementation may give -3 as the result with the remainder being

@ -77,7 +77,7 @@ class ScopedPythonPtr {
PyObject* as_pyobject() const { return reinterpret_cast<PyObject*>(ptr_); } PyObject* as_pyobject() const { return reinterpret_cast<PyObject*>(ptr_); }
// Increments the reference count fo the current object. // Increments the reference count of the current object.
// Should not be called when no object is held. // Should not be called when no object is held.
void inc() const { Py_INCREF(ptr_); } void inc() const { Py_INCREF(ptr_); }

@ -200,7 +200,7 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
** store pointers or integers of at least 32 bits (upb isn't really useful on ** store pointers or integers of at least 32 bits (upb isn't really useful on
** systems where sizeof(void*) < 4). ** systems where sizeof(void*) < 4).
** **
** The table must be homogenous (all values of the same type). In debug ** The table must be homogeneous (all values of the same type). In debug
** mode, we check this on insert and lookup. ** mode, we check this on insert and lookup.
*/ */
@ -6057,7 +6057,7 @@ typedef struct {
typedef struct { typedef struct {
/* Space optimization note: we store two pointers here that the JIT /* Space optimization note: we store two pointers here that the JIT
* doesn't need at all; the upb_handlers* inside the sink and * doesn't need at all; the upb_handlers* inside the sink and
* the dispatch table pointer. We can optimze so that the JIT uses * the dispatch table pointer. We can optimize so that the JIT uses
* smaller stack frames than the interpreter. The only thing we need * smaller stack frames than the interpreter. The only thing we need
* to guarantee is that the fallback routines can find end_ofs. */ * to guarantee is that the fallback routines can find end_ofs. */
upb_sink sink; upb_sink sink;

@ -169,7 +169,7 @@ message Method {
// The mixin construct implies that all methods in `AccessControl` are // The mixin construct implies that all methods in `AccessControl` are
// also declared with same name and request/response types in // also declared with same name and request/response types in
// `Storage`. A documentation generator or annotation processor will // `Storage`. A documentation generator or annotation processor will
// see the effective `Storage.GetAcl` method after inherting // see the effective `Storage.GetAcl` method after inheriting
// documentation and annotations as follows: // documentation and annotations as follows:
// //
// service Storage { // service Storage {

@ -84,7 +84,7 @@ class NoHeapChecker {
private: private:
class NewDeleteCapture { class NewDeleteCapture {
public: public:
// TOOD(xiaofeng): Implement this for opensource protobuf. // TODO(xiaofeng): Implement this for opensource protobuf.
void Hook() {} void Hook() {}
void Unhook() {} void Unhook() {}
int alloc_count() { return 0; } int alloc_count() { return 0; }

@ -104,7 +104,7 @@ class DiskSourceTree; // importer.h
// 2. protoc --proto_path=src foo.proto (virtual path relative to src) // 2. protoc --proto_path=src foo.proto (virtual path relative to src)
// //
// If a file path can be interpreted both as a physical file path and as a // If a file path can be interpreted both as a physical file path and as a
// relative virtual path, the physical file path takes precendence. // relative virtual path, the physical file path takes precedence.
// //
// For a full description of the command-line syntax, invoke it with --help. // For a full description of the command-line syntax, invoke it with --help.
class PROTOC_EXPORT CommandLineInterface { class PROTOC_EXPORT CommandLineInterface {

@ -113,7 +113,7 @@ class MessageGenerator {
bool GenerateParseTable(io::Printer* printer, size_t offset, bool GenerateParseTable(io::Printer* printer, size_t offset,
size_t aux_offset); size_t aux_offset);
// Generate the field offsets array. Returns the a pair of the total numer // Generate the field offsets array. Returns the a pair of the total number
// of entries generated and the index of the first has_bit entry. // of entries generated and the index of the first has_bit entry.
std::pair<size_t, size_t> GenerateOffsets(io::Printer* printer); std::pair<size_t, size_t> GenerateOffsets(io::Printer* printer);
void GenerateSchema(io::Printer* printer, int offset, int has_offset); void GenerateSchema(io::Printer* printer, int offset, int has_offset);

@ -463,13 +463,13 @@ TEST_F(DiskSourceTreeTest, DiskFileToVirtualFileCanonicalization) {
source_tree_.DiskFileToVirtualFile("../../baz", &virtual_file, source_tree_.DiskFileToVirtualFile("../../baz", &virtual_file,
&shadowing_disk_file)); &shadowing_disk_file));
// "/foo" is not mapped (it should not be misintepreted as being under "."). // "/foo" is not mapped (it should not be misinterpreted as being under ".").
EXPECT_EQ(DiskSourceTree::NO_MAPPING, EXPECT_EQ(DiskSourceTree::NO_MAPPING,
source_tree_.DiskFileToVirtualFile("/foo", &virtual_file, source_tree_.DiskFileToVirtualFile("/foo", &virtual_file,
&shadowing_disk_file)); &shadowing_disk_file));
#ifdef WIN32 #ifdef WIN32
// "C:\foo" is not mapped (it should not be misintepreted as being under "."). // "C:\foo" is not mapped (it should not be misinterpreted as being under ".").
EXPECT_EQ(DiskSourceTree::NO_MAPPING, EXPECT_EQ(DiskSourceTree::NO_MAPPING,
source_tree_.DiskFileToVirtualFile("C:\\foo", &virtual_file, source_tree_.DiskFileToVirtualFile("C:\\foo", &virtual_file,
&shadowing_disk_file)); &shadowing_disk_file));

@ -712,7 +712,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
// list is immutable. If it's immutable, the invariant is that it must // list is immutable. If it's immutable, the invariant is that it must
// either an instance of Collections.emptyList() or it's an ArrayList // either an instance of Collections.emptyList() or it's an ArrayList
// wrapped in a Collections.unmodifiableList() wrapper and nobody else has // wrapped in a Collections.unmodifiableList() wrapper and nobody else has
// a refererence to the underlying ArrayList. This invariant allows us to // a reference to the underlying ArrayList. This invariant allows us to
// share instances of lists between protocol buffers avoiding expensive // share instances of lists between protocol buffers avoiding expensive
// memory allocations. Note, immutable is a strong guarantee here -- not // memory allocations. Note, immutable is a strong guarantee here -- not
// just that the list cannot be modified via the reference but that the // just that the list cannot be modified via the reference but that the

@ -944,7 +944,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers(
// list is immutable. If it's immutable, the invariant is that it must // list is immutable. If it's immutable, the invariant is that it must
// either an instance of Collections.emptyList() or it's an ArrayList // either an instance of Collections.emptyList() or it's an ArrayList
// wrapped in a Collections.unmodifiableList() wrapper and nobody else has // wrapped in a Collections.unmodifiableList() wrapper and nobody else has
// a refererence to the underlying ArrayList. This invariant allows us to // a reference to the underlying ArrayList. This invariant allows us to
// share instances of lists between protocol buffers avoiding expensive // share instances of lists between protocol buffers avoiding expensive
// memory allocations. Note, immutable is a strong guarantee here -- not // memory allocations. Note, immutable is a strong guarantee here -- not
// just that the list cannot be modified via the reference but that the // just that the list cannot be modified via the reference but that the

@ -703,7 +703,7 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
// list is immutable. If it's immutable, the invariant is that it must // list is immutable. If it's immutable, the invariant is that it must
// either an instance of Collections.emptyList() or it's an ArrayList // either an instance of Collections.emptyList() or it's an ArrayList
// wrapped in a Collections.unmodifiableList() wrapper and nobody else has // wrapped in a Collections.unmodifiableList() wrapper and nobody else has
// a refererence to the underlying ArrayList. This invariant allows us to // a reference to the underlying ArrayList. This invariant allows us to
// share instances of lists between protocol buffers avoiding expensive // share instances of lists between protocol buffers avoiding expensive
// memory allocations. Note, immutable is a strong guarantee here -- not // memory allocations. Note, immutable is a strong guarantee here -- not
// just that the list cannot be modified via the reference but that the // just that the list cannot be modified via the reference but that the

@ -801,7 +801,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers(
// list is immutable. If it's immutable, the invariant is that it must // list is immutable. If it's immutable, the invariant is that it must
// either an instance of Collections.emptyList() or it's an ArrayList // either an instance of Collections.emptyList() or it's an ArrayList
// wrapped in a Collections.unmodifiableList() wrapper and nobody else has // wrapped in a Collections.unmodifiableList() wrapper and nobody else has
// a refererence to the underlying ArrayList. This invariant allows us to // a reference to the underlying ArrayList. This invariant allows us to
// share instances of lists between protocol buffers avoiding expensive // share instances of lists between protocol buffers avoiding expensive
// memory allocations. Note, immutable is a strong guarantee here -- not // memory allocations. Note, immutable is a strong guarantee here -- not
// just that the list cannot be modified via the reference but that the // just that the list cannot be modified via the reference but that the

@ -125,10 +125,10 @@ struct GeneratorOptions {
std::string extension; std::string extension;
// Create a separate output file for each input file? // Create a separate output file for each input file?
bool one_output_file_per_input_file; bool one_output_file_per_input_file;
// If true, we should append annotations as commen on the last line for // If true, we should append annotations as comments on the last line for
// generated .js file. Annotations used by tools like https://kythe.io // generated .js file. Annotations used by tools like https://kythe.io
// to provide cross-references between .js and .proto files. Annotations // to provide cross-references between .js and .proto files. Annotations
// are enced as base64 proto of GeneratedCodeInfo message (see // are encoded as base64 proto of GeneratedCodeInfo message (see
// descriptor.proto). // descriptor.proto).
bool annotate_code; bool annotate_code;
}; };

@ -421,7 +421,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
"#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n"); "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n");
if (includes_oneof) { if (includes_oneof) {
// The generated code for oneof's uses direct ivar access, suppress the // The generated code for oneof's uses direct ivar access, suppress the
// warning incase developer turn that on in the context they compile the // warning in case developer turn that on in the context they compile the
// generated code. // generated code.
printer->Print( printer->Print(
"#pragma clang diagnostic ignored \"-Wdirect-ivar-access\"\n"); "#pragma clang diagnostic ignored \"-Wdirect-ivar-access\"\n");

@ -123,7 +123,7 @@ bool ObjectiveCGenerator::GenerateAll(const std::vector<const FileDescriptor*>&
// Any number of files can be listed for a framework, just separate them // Any number of files can be listed for a framework, just separate them
// with commas. // with commas.
// //
// There can be multiple lines listing the same frameworkName incase it // There can be multiple lines listing the same frameworkName in case it
// has a lot of proto files included in it; having multiple lines makes // has a lot of proto files included in it; having multiple lines makes
// things easier to read. If a proto file is not configured in the // things easier to read. If a proto file is not configured in the
// mappings file, it will use the default framework name if one was passed // mappings file, it will use the default framework name if one was passed

@ -1067,7 +1067,7 @@ void Generator::FixContainingTypeInDescriptor(
} }
// Prints statements setting the message_type and enum_type fields in the // Prints statements setting the message_type and enum_type fields in the
// Python descriptor objects we've already output in ths file. We must // Python descriptor objects we've already output in the file. We must
// do this in a separate step due to circular references (otherwise, we'd // do this in a separate step due to circular references (otherwise, we'd
// just set everything in the initial assignment statements). // just set everything in the initial assignment statements).
void Generator::FixForeignFieldsInDescriptors() const { void Generator::FixForeignFieldsInDescriptors() const {

@ -413,7 +413,7 @@ int GeneratePackageModules(const FileDescriptor* file, io::Printer* printer) {
// If :: is in the package use the Ruby formatted name as-is // If :: is in the package use the Ruby formatted name as-is
// -> A::B::C // -> A::B::C
// otherwise, use the dot seperator // otherwise, use the dot separator
// -> A.B.C // -> A.B.C
if (package_name.find("::") != std::string::npos) { if (package_name.find("::") != std::string::npos) {
need_change_to_module = false; need_change_to_module = false;

@ -6131,7 +6131,7 @@ void DescriptorBuilder::ValidateFieldOptions(
// json_name option is not allowed on extension fields. Note that the // json_name option is not allowed on extension fields. Note that the
// json_name field in FieldDescriptorProto is always populated by protoc // json_name field in FieldDescriptorProto is always populated by protoc
// when it sends descriptor data to plugins (caculated from field name if // when it sends descriptor data to plugins (calculated from field name if
// the option is not explicitly set) so we can't rely on its presence to // the option is not explicitly set) so we can't rely on its presence to
// determine whether the json_name option is set on the field. Here we // determine whether the json_name option is set on the field. Here we
// compare it against the default calculated json_name value and consider // compare it against the default calculated json_name value and consider

@ -479,7 +479,7 @@ TEST_F(FileDescriptorTest, FindExtensionByNumber) {
TEST_F(FileDescriptorTest, BuildAgain) { TEST_F(FileDescriptorTest, BuildAgain) {
// Test that if te call BuildFile again on the same input we get the same // Test that if we call BuildFile again on the same input we get the same
// FileDescriptor back. // FileDescriptor back.
FileDescriptorProto file; FileDescriptorProto file;
foo_file_->CopyTo(&file); foo_file_->CopyTo(&file);

@ -102,7 +102,7 @@ struct PROTOBUF_EXPORT FieldMetadata {
kNumTypeClasses // must be last enum kNumTypeClasses // must be last enum
}; };
// C++ protobuf has 20 fundamental types, were we added Cord and StringPiece // C++ protobuf has 20 fundamental types, were we added Cord and StringPiece
// and also distinquish the same types if they have different wire format. // and also distinguish the same types if they have different wire format.
enum { enum {
kCordType = 19, kCordType = 19,
kStringPieceType = 20, kStringPieceType = 20,

@ -960,7 +960,7 @@ class PROTOBUF_EXPORT EpsCopyOutputStream {
// buffers to ensure there is no error as of yet. // buffers to ensure there is no error as of yet.
uint8* FlushAndResetBuffer(uint8*); uint8* FlushAndResetBuffer(uint8*);
// The following functions mimick the old CodedOutputStream behavior as close // The following functions mimic the old CodedOutputStream behavior as close
// as possible. They flush the current state to the stream, behave as // as possible. They flush the current state to the stream, behave as
// the old CodedOutputStream and then return to normal operation. // the old CodedOutputStream and then return to normal operation.
bool Skip(int count, uint8** pp); bool Skip(int count, uint8** pp);
@ -1159,7 +1159,7 @@ class PROTOBUF_EXPORT CodedOutputStream {
// This is identical to WriteVarint32(), but optimized for writing tags. // This is identical to WriteVarint32(), but optimized for writing tags.
// In particular, if the input is a compile-time constant, this method // In particular, if the input is a compile-time constant, this method
// compiles down to a couple instructions. // compiles down to a couple instructions.
// Always inline because otherwise the aformentioned optimization can't work, // Always inline because otherwise the aforementioned optimization can't work,
// but GCC by default doesn't want to inline this. // but GCC by default doesn't want to inline this.
void WriteTag(uint32 value); void WriteTag(uint32 value);
// Like WriteTag() but writing directly to the target array. // Like WriteTag() but writing directly to the target array.

@ -112,7 +112,7 @@ class IoTest : public testing::Test {
// that it matches the string. // that it matches the string.
void ReadString(ZeroCopyInputStream* input, const std::string& str); void ReadString(ZeroCopyInputStream* input, const std::string& str);
// Writes some text to the output stream in a particular order. Returns // Writes some text to the output stream in a particular order. Returns
// the number of bytes written, incase the caller needs that to set up an // the number of bytes written, in case the caller needs that to set up an
// input stream. // input stream.
int WriteStuff(ZeroCopyOutputStream* output); int WriteStuff(ZeroCopyOutputStream* output);
// Reads text from an input stream and expects it to match what // Reads text from an input stream and expects it to match what

@ -385,7 +385,7 @@ class Map {
// 9. Except for erase(iterator), any non-const method can reorder iterators. // 9. Except for erase(iterator), any non-const method can reorder iterators.
// 10. InnerMap uses KeyForTree<Key> when using the Tree representation, which // 10. InnerMap uses KeyForTree<Key> when using the Tree representation, which
// is either `Key`, if Key is a scalar, or `reference_wrapper<const Key>` // is either `Key`, if Key is a scalar, or `reference_wrapper<const Key>`
// otherwise. This avoids unncessary copies of string keys, for example. // otherwise. This avoids unnecessary copies of string keys, for example.
class InnerMap : private hasher { class InnerMap : private hasher {
public: public:
explicit InnerMap(size_type n) : InnerMap(nullptr, n) {} explicit InnerMap(size_type n) : InnerMap(nullptr, n) {}

@ -272,7 +272,7 @@ class MapFieldAccessor;
// This class provides access to map field using reflection, which is the same // This class provides access to map field using reflection, which is the same
// as those provided for RepeatedPtrField<Message>. It is used for internal // as those provided for RepeatedPtrField<Message>. It is used for internal
// reflection implentation only. Users should never use this directly. // reflection implementation only. Users should never use this directly.
class PROTOBUF_EXPORT MapFieldBase { class PROTOBUF_EXPORT MapFieldBase {
public: public:
MapFieldBase() MapFieldBase()
@ -421,7 +421,7 @@ class TypeDefinedMapFieldBase : public MapFieldBase {
}; };
// This class provides access to map field using generated api. It is used for // This class provides access to map field using generated api. It is used for
// internal generated message implentation only. Users should never use this // internal generated message implementation only. Users should never use this
// directly. // directly.
template <typename Derived, typename Key, typename T, template <typename Derived, typename Key, typename T,
WireFormatLite::FieldType kKeyFieldType, WireFormatLite::FieldType kKeyFieldType,

@ -50,7 +50,7 @@ namespace protobuf {
namespace internal { namespace internal {
// This class provides access to map field using generated api. It is used for // This class provides access to map field using generated api. It is used for
// internal generated message implentation only. Users should never use this // internal generated message implementation only. Users should never use this
// directly. // directly.
template <typename Derived, typename Key, typename T, template <typename Derived, typename Key, typename T,
WireFormatLite::FieldType key_wire_type, WireFormatLite::FieldType key_wire_type,

@ -3158,7 +3158,7 @@ TEST(WireFormatForMapFieldTest, MapByteSizeDynamicMessage) {
// Protobuf used to have a bug for serialize when map it marked CLEAN. It used // Protobuf used to have a bug for serialize when map it marked CLEAN. It used
// repeated field to calculate ByteSizeLong but use map to serialize the real // repeated field to calculate ByteSizeLong but use map to serialize the real
// data, thus the ByteSizeLong may bigger than real serialized size. A crash // data, thus the ByteSizeLong may bigger than real serialized size. A crash
// might be happen at SerializeToString(). Or an "unexpect end group" warning // might be happen at SerializeToString(). Or an "unexpected end group" warning
// was raised at parse back if user use SerializeWithCachedSizes() which // was raised at parse back if user use SerializeWithCachedSizes() which
// avoids size check at serialize. // avoids size check at serialize.
std::string serialized_data; std::string serialized_data;

@ -752,7 +752,7 @@ class PROTOBUF_EXPORT Reflection final {
Message* message, const FieldDescriptor* field) const; Message* message, const FieldDescriptor* field) const;
// DEPRECATED. Please use Get(Mutable)RepeatedFieldRef() for repeated field // DEPRECATED. Please use Get(Mutable)RepeatedFieldRef() for repeated field
// access. The following repeated field accesors will be removed in the // access. The following repeated field accessors will be removed in the
// future. // future.
// //
// Repeated field accessors ------------------------------------------------- // Repeated field accessors -------------------------------------------------

@ -180,7 +180,7 @@ std::pair<const char*, bool> EpsCopyInputStream::DoneFallback(const char* ptr,
if (PROTOBUF_PREDICT_FALSE(overrun != 0)) return {nullptr, true}; if (PROTOBUF_PREDICT_FALSE(overrun != 0)) return {nullptr, true};
GOOGLE_DCHECK(limit_ > 0); GOOGLE_DCHECK(limit_ > 0);
limit_end_ = buffer_end_; limit_end_ = buffer_end_;
// Distinquish ending on a pushed limit or ending on end-of-stream. // Distinguish ending on a pushed limit or ending on end-of-stream.
SetEndOfStream(); SetEndOfStream();
return {ptr, true}; return {ptr, true};
} }

@ -47,7 +47,7 @@ namespace internal {
// When you use implicit_cast, the compiler checks that the cast is safe. // When you use implicit_cast, the compiler checks that the cast is safe.
// Such explicit implicit_casts are necessary in surprisingly many // Such explicit implicit_casts are necessary in surprisingly many
// situations where C++ demands an exact type match instead of an // situations where C++ demands an exact type match instead of an
// argument type convertable to a target type. // argument type convertible to a target type.
// //
// The From type can be inferred, so the preferred syntax for using // The From type can be inferred, so the preferred syntax for using
// implicit_cast is the same as for static_cast etc.: // implicit_cast is the same as for static_cast etc.:

@ -304,7 +304,7 @@ void DoNothing() {}
// //
// TODO(xiaofeng): PROTOBUF_LITTLE_ENDIAN is unfortunately defined in // TODO(xiaofeng): PROTOBUF_LITTLE_ENDIAN is unfortunately defined in
// google/protobuf/io/coded_stream.h and therefore can not be used here. // google/protobuf/io/coded_stream.h and therefore can not be used here.
// Maybe move that macro definition here in the furture. // Maybe move that macro definition here in the future.
uint32 ghtonl(uint32 x) { uint32 ghtonl(uint32 x) {
union { union {
uint32 result; uint32 result;

@ -38,7 +38,7 @@ namespace internal {
namespace { namespace {
static const int64 kSecondsPerDay = 3600 * 24; static const int64 kSecondsPerDay = 3600 * 24;
// For DateTime, tests will mostly focuse on the date part because that's // For DateTime, tests will mostly focus on the date part because that's
// the tricky one. // the tricky one.
int64 CreateTimestamp(int year, int month, int day) { int64 CreateTimestamp(int year, int month, int day) {
DateTime time; DateTime time;

@ -718,7 +718,7 @@ TEST_F(TextFormatTest, CompactRepeatedFieldPrinter) {
text); text);
} }
// Print strings into multiple line, with indention. Use this to test // Print strings into multiple line, with indentation. Use this to test
// BaseTextGenerator::Indent and BaseTextGenerator::Outdent. // BaseTextGenerator::Indent and BaseTextGenerator::Outdent.
class MultilineStringPrinter : public TextFormat::FastFieldValuePrinter { class MultilineStringPrinter : public TextFormat::FastFieldValuePrinter {
public: public:
@ -2031,7 +2031,7 @@ TEST(TextFormatUnknownFieldTest, TestUnknownField) {
" }\n" " }\n"
">", ">",
&proto)); &proto));
// Unmatched delimeters for message body // Unmatched delimiters for message body
EXPECT_FALSE(parser.ParseFromString("unknown_message: {>", &proto)); EXPECT_FALSE(parser.ParseFromString("unknown_message: {>", &proto));
// Unknown extension // Unknown extension
EXPECT_TRUE( EXPECT_TRUE(

@ -199,7 +199,7 @@ class FieldMaskTree {
// Remove a path from the tree. // Remove a path from the tree.
// If the path is a sub-path of an existing field path in the tree, it means // If the path is a sub-path of an existing field path in the tree, it means
// we need remove the existing fied path and add all sub-paths except // we need remove the existing field path and add all sub-paths except
// specified path. If the path matches an existing node in the tree, this node // specified path. If the path matches an existing node in the tree, this node
// will be moved. // will be moved.
void RemovePath(const std::string& path, const Descriptor* descriptor); void RemovePath(const std::string& path, const Descriptor* descriptor);
@ -332,7 +332,7 @@ void FieldMaskTree::AddPath(const std::string& path) {
for (int i = 0; i < parts.size(); ++i) { for (int i = 0; i < parts.size(); ++i) {
if (!new_branch && node != &root_ && node->children.empty()) { if (!new_branch && node != &root_ && node->children.empty()) {
// Path matches an existing leaf node. This means the path is already // Path matches an existing leaf node. This means the path is already
// coverred by this tree (for example, adding "foo.bar.baz" to a tree // covered by this tree (for example, adding "foo.bar.baz" to a tree
// which already contains "foo.bar"). // which already contains "foo.bar").
return; return;
} }
@ -707,7 +707,7 @@ bool FieldMaskUtil::TrimMessage(const FieldMask& mask, Message* message,
// fields. // fields.
FieldMaskTree tree; FieldMaskTree tree;
tree.MergeFromFieldMask(mask); tree.MergeFromFieldMask(mask);
// If keep_required_fields is true, implicitely add required fields of // If keep_required_fields is true, implicitly add required fields of
// a message present in the tree to prevent from trimming. // a message present in the tree to prevent from trimming.
if (options.keep_required_fields()) { if (options.keep_required_fields()) {
tree.AddRequiredFieldPath(GOOGLE_CHECK_NOTNULL(message->GetDescriptor())); tree.AddRequiredFieldPath(GOOGLE_CHECK_NOTNULL(message->GetDescriptor()));

@ -49,7 +49,7 @@ const char kRfc3339TimeFormat[] = "%E4Y-%m-%dT%H:%M:%S";
// timestamps like "1-01-0001T23:59:59Z" instead of "0001-01-0001T23:59:59Z". // timestamps like "1-01-0001T23:59:59Z" instead of "0001-01-0001T23:59:59Z".
const char kRfc3339TimeFormatNoPadding[] = "%Y-%m-%dT%H:%M:%S"; const char kRfc3339TimeFormatNoPadding[] = "%Y-%m-%dT%H:%M:%S";
// Minimun seconds allowed in a google.protobuf.Timestamp value. // Minimum seconds allowed in a google.protobuf.Timestamp value.
const int64 kTimestampMinSeconds = -62135596800LL; const int64 kTimestampMinSeconds = -62135596800LL;
// Maximum seconds allowed in a google.protobuf.Timestamp value. // Maximum seconds allowed in a google.protobuf.Timestamp value.

@ -152,7 +152,7 @@ class PROTOBUF_EXPORT JsonObjectWriter : public StructuredObjectWriter {
return false; return false;
} }
// Whether we are currently renderring inside a JSON object (i.e., between // Whether we are currently rendering inside a JSON object (i.e., between
// StartObject() and EndObject()). // StartObject() and EndObject()).
bool is_json_object() const { return is_json_object_; } bool is_json_object() const { return is_json_object_; }

@ -146,7 +146,7 @@ class JsonStreamParserTest : public ::testing::Test {
#ifndef _MSC_VER #ifndef _MSC_VER
// TODO(xiaofeng): We have to disable InSequence check for MSVC because it // TODO(xiaofeng): We have to disable InSequence check for MSVC because it
// causes stack overflow due to its use of a linked list that is desctructed // causes stack overflow due to its use of a linked list that is destructed
// recursively. // recursively.
::testing::InSequence in_sequence_; ::testing::InSequence in_sequence_;
#endif // !_MSC_VER #endif // !_MSC_VER

@ -63,7 +63,7 @@ class TypeInfoTestHelper {
// Creates a TypeInfo object for the given set of descriptors. // Creates a TypeInfo object for the given set of descriptors.
void ResetTypeInfo(const std::vector<const Descriptor*>& descriptors); void ResetTypeInfo(const std::vector<const Descriptor*>& descriptors);
// Convinent overloads. // Convenient overloads.
void ResetTypeInfo(const Descriptor* descriptor); void ResetTypeInfo(const Descriptor* descriptor);
void ResetTypeInfo(const Descriptor* descriptor1, void ResetTypeInfo(const Descriptor* descriptor1,
const Descriptor* descriptor2); const Descriptor* descriptor2);

@ -82,7 +82,7 @@ PROTOBUF_EXPORT std::string GetStringOptionOrDefault(
// Returns a boolean value contained in Any type. // Returns a boolean value contained in Any type.
// TODO(skarvaje): Make these utilities dealing with Any types more generic, // TODO(skarvaje): Make these utilities dealing with Any types more generic,
// add more error checking and move to a more public/sharable location so others // add more error checking and move to a more public/shareable location so others
// can use. // can use.
PROTOBUF_EXPORT bool GetBoolFromAny(const google::protobuf::Any& any); PROTOBUF_EXPORT bool GetBoolFromAny(const google::protobuf::Any& any);

@ -1526,7 +1526,7 @@ int MaximumMatcher::FindMaximumMatch(bool early_return) {
} }
} }
// Backfill match_list1_ as we only filled match_list2_ when finding // Backfill match_list1_ as we only filled match_list2_ when finding
// argumenting pathes. // argumenting paths.
for (int i = 0; i < count2_; ++i) { for (int i = 0; i < count2_; ++i) {
if ((*match_list2_)[i] != -1) { if ((*match_list2_)[i] != -1) {
(*match_list1_)[(*match_list2_)[i]] = i; (*match_list1_)[(*match_list2_)[i]] = i;

@ -328,7 +328,7 @@ class PROTOBUF_EXPORT MessageDifferencer {
// Abstract base class from which all IgnoreCriteria derive. // Abstract base class from which all IgnoreCriteria derive.
// By adding IgnoreCriteria more complex ignore logic can be implemented. // By adding IgnoreCriteria more complex ignore logic can be implemented.
// IgnoreCriteria are registed with AddIgnoreCriteria. For each compared // IgnoreCriteria are registered with AddIgnoreCriteria. For each compared
// field IsIgnored is called on each added IgnoreCriteria until one returns // field IsIgnored is called on each added IgnoreCriteria until one returns
// true or all return false. // true or all return false.
// IsIgnored is called for fields where at least one side has a value. // IsIgnored is called for fields where at least one side has a value.

Loading…
Cancel
Save