Skip to content

Commit

Permalink
Fix lots of spelling errors (protocolbuffers#7751)
Browse files Browse the repository at this point in the history
* 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 534ecf7.

* Revert unparseable->unparsable corrections
  • Loading branch information
peternewman authored Aug 10, 2020
1 parent 8d74659 commit e2cc2de
Show file tree
Hide file tree
Showing 94 changed files with 136 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ build_msvc
# needed to trigger "pod install" to rerun the preinstall commands.
Pods/

# Comformance test output
# Conformance test output
conformance/.libs/
conformance/com/
conformance/conformance-cpp
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $ make go


### 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
```
$ make php
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/js/js_benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ process.argv.forEach(function(filename, index) {
totalBytes += onePayload.length;
});

var senarios = benchmarkSuite.newBenchmark(
var scenarios = benchmarkSuite.newBenchmark(
benchmarkDataset.getMessageName(), filename, "js");
senarios.suite
scenarios.suite
.add("js deserialize", function() {
benchmarkDataset.getPayloadList().forEach(function(onePayload) {
var protoType = getNewPrototype(benchmarkDataset.getMessageName());
Expand All @@ -61,15 +61,15 @@ process.argv.forEach(function(filename, index) {
results.push({
filename: filename,
benchmarks: {
protobufjs_decoding: senarios.benches[0] * totalBytes / 1024 / 1024,
protobufjs_encoding: senarios.benches[1] * totalBytes / 1024 / 1024
protobufjs_decoding: scenarios.benches[0] * totalBytes / 1024 / 1024,
protobufjs_encoding: scenarios.benches[1] * totalBytes / 1024 / 1024
}
})

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: "
+ senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
+ scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
console.log("");
});
console.log("#####################################################");
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/protobuf.js/protobufjs_benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ process.argv.forEach(function(filename, index) {
totalBytes += onePayload.length;
});

var senarios = benchmarkSuite.newBenchmark(
var scenarios = benchmarkSuite.newBenchmark(
benchmarkDataset.messageName, filename, "protobufjs");
senarios.suite
scenarios.suite
.add("protobuf.js static decoding", function() {
benchmarkDataset.payload.forEach(function(onePayload) {
var protoType = getNewPrototype(benchmarkDataset.messageName);
Expand All @@ -51,15 +51,15 @@ process.argv.forEach(function(filename, index) {
results.push({
filename: filename,
benchmarks: {
protobufjs_decoding: senarios.benches[0] * totalBytes,
protobufjs_encoding: senarios.benches[1] * totalBytes
protobufjs_decoding: scenarios.benches[0] * totalBytes,
protobufjs_encoding: scenarios.benches[1] * totalBytes
}
})

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: "
+ senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
+ scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
console.log("");
});
console.log("#####################################################");
Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else()
endif()

# 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"
# This silences that warning.
if (CMAKE_CXX_COMPILER_ID MATCHES Intel)
Expand Down
4 changes: 2 additions & 2 deletions cmake/protobuf-options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
option(protobuf_VERBOSE "Enable for verbose output" OFF)
mark_as_advanced(protobuf_VERBOSE)

# FindProtobuf module compatibel
option(protobuf_MODULE_COMPATIBLE "CMake build-in FindProtobuf.cmake module compatible" OFF)
# FindProtobuf module compatible
option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF)
mark_as_advanced(protobuf_MODULE_COMPATIBLE)
4 changes: 2 additions & 2 deletions conformance/conformance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enum TestCategory {
BINARY_TEST = 1; // Test binary wire format.
JSON_TEST = 2; // Test json wire format.
// 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
// https://developers.google.com/protocol-buffers/docs/proto3#json_options
// for more detail.
Expand Down Expand Up @@ -113,7 +113,7 @@ message ConformanceRequest {
string message_type = 4;

// 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.
TestCategory test_category = 5;

Expand Down
6 changes: 3 additions & 3 deletions conformance/third_party/jsoncpp/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ class JSON_API Reader {
*/
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
* only one error can be returned, but the caller should tolerate
* multiple
Expand Down Expand Up @@ -1867,7 +1867,7 @@ class JSON_API FastWriter : public Writer {
* - 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.
*
* 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.
*
* \sa Reader, Value, Value::setComment()
Expand Down Expand Up @@ -1928,7 +1928,7 @@ class JSON_API StyledWriter : public Writer {
* - 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.
*
* 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.
*
* \param indentation Each level will be indented by this amount extra.
Expand Down
2 changes: 1 addition & 1 deletion conformance/third_party/jsoncpp/jsoncpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ enum {
typedef char UIntToStringBuffer[uintToStringBufferSize];

/** 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.
* Must have at least uintToStringBufferSize chars free.
*/
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/AddressBook/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Google.Protobuf.Examples.AddressBook
/// <summary>
/// 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
/// invidual complete program.
/// individual complete program.
/// </summary>
internal class Program
{
Expand Down
4 changes: 2 additions & 2 deletions csharp/src/Google.Protobuf.Conformance/Conformance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public enum TestCategory {
[pbr::OriginalName("JSON_TEST")] JsonTest = 2,
/// <summary>
/// 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
/// https://developers.google.com/protocol-buffers/docs/proto3#json_options
/// for more detail.
Expand Down Expand Up @@ -414,7 +414,7 @@ public string MessageType {
private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest;
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public ArrayBufferWriter()
}

/// <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.
/// </summary>
public int? MaxGrowBy { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf.Test/IssuesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void CodedInputStream_LimitReachedRightAfterTag()

// 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
// 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
cis.AssertNextTag(WireFormat.MakeTag(11, WireFormat.WireType.Varint));
}
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/ByteString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public static ByteString CopyFromUtf8(string text)
}

/// <summary>
/// Retuns the byte at the given index.
/// Returns the byte at the given index.
/// </summary>
public byte this[int index]
{
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/CodedInputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public bool IsAtEnd

/// <summary>
/// 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
/// or it will throw an exception. If <paramref name="mustSucceed"/> is false,
/// RefillBuffer() returns false if no more bytes were available.
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ internal static OneofAccessor ForRegularOneof(
internal static OneofAccessor ForSyntheticOneof(OneofDescriptor descriptor)
{
// 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.)
return new OneofAccessor(descriptor,
message => descriptor.Fields[0].Accessor.HasValue(message) ? descriptor.Fields[0].FieldNumber : 0,
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ public void MergeFrom(pb::CodedInputStream input) {
/// The mixin construct implies that all methods in `AccessControl` are
/// also declared with same name and request/response types in
/// `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:
///
/// service Storage {
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/proto2.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ foo.GetOrInitializeExtension(RepeatedFooExt).Add(new Baz());

### 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.
Checking message initialization can be done manually via the `IsInitialized` extension method in `MessageExtensions`.

Expand Down
2 changes: 1 addition & 1 deletion docs/field_presence.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The _no presence_ serialization discipline results in visible differences from t

### 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.

Expand Down
2 changes: 1 addition & 1 deletion docs/implementing_proto3_presence.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
cases.
- RPC code generators that create generated APIs for service calls.
Expand Down
2 changes: 1 addition & 1 deletion java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ how to use them.

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
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.

### Build from Source - With Maven
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ message FileDescriptorProto {
optional FileOptions options = 8;

// 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
// development tools.
optional SourceCodeInfo source_code_info = 9;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ message FileDescriptorProto {
optional FileOptions options = 8;

// 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
// development tools.
optional SourceCodeInfo source_code_info = 9;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* 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
* 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
* crossing protobuf public API boundaries.
*/
Expand All @@ -51,7 +51,7 @@ final class ArrayDecoders {
* 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
* is already being passed through all the parsing rountines.
* is already being passed through all the parsing routines.
*/
static final class Registers {
public int int1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ public boolean isRepeated() {

/**
* 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
public boolean isPacked() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public static enum 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
* count.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static <K, V> Map.Entry<K, V> parseEntry(
}

/**
* 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}.
*/
public void parseInto(
Expand Down
2 changes: 1 addition & 1 deletion js/binary/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jspb.utils.splitFloat64 = function(value) {
// Compute the least significant exponent needed to represent the magnitude of
// 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
// bounadaries of precision, the result can be off by one.
// boundaries of precision, the result can be off by one.
var maxDoubleExponent = 1023;
var minDoubleExponent = -1022;
var x = value;
Expand Down
Loading

0 comments on commit e2cc2de

Please sign in to comment.