Skip to content

Commit

Permalink
Fix a few typos
Browse files Browse the repository at this point in the history
I'm trying to set up an autoroller for GN in Chromium. It's currently
stuck in a bad state, and the easiest way to try and get it unstuck
is to have a new upstream GN commit. Apologies.

Change-Id: I6beff0dff7140a88fa5a205961f4dc6a40b7d22a
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/11200
Reviewed-by: Scott Graham <[email protected]>
Commit-Queue: Nico Weber <[email protected]>
  • Loading branch information
nico authored and Commit Bot committed Mar 11, 2021
1 parent dfcbc6f commit e0358b4
Show file tree
Hide file tree
Showing 55 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion src/base/atomic_ref_count.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AtomicRefCount {
}

// Return whether the reference count is one. If the reference count is used
// in the conventional way, a refrerence count of 1 implies that the current
// in the conventional way, a reference count of 1 implies that the current
// thread owns the reference and no other thread shares it. This call
// performs the test for a reference count of one, and performs the memory
// barrier needed for the owning thread to act on the object, knowing that it
Expand Down
2 changes: 1 addition & 1 deletion src/base/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void AppendSwitchesAndArguments(CommandLine* command_line,
}

#if defined(OS_WIN)
// Quote a string as necessary for CommandLineToArgvW compatiblity *on Windows*.
// Quote a string as necessary for CommandLineToArgvW compatibility *on Windows*.
std::u16string QuoteForCommandLineToArgvW(const std::u16string& arg,
bool quote_placeholders) {
// We follow the quoting rules of CommandLineToArgvW.
Expand Down
8 changes: 4 additions & 4 deletions src/base/containers/circular_deque.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ class circular_deque {
void resize(size_type count) {
// SEE BELOW VERSION if you change this. The code is mostly the same.
if (count > size()) {
// This could be slighly more efficient but expanding a queue with
// This could be slightly more efficient but expanding a queue with
// identical elements is unusual and the extra computations of emplacing
// one-by-one will typically be small relative to calling the constructor
// for every item.
Expand Down Expand Up @@ -677,7 +677,7 @@ class circular_deque {
// The implementation of insert isn't optimized as much as it could be. If
// the insertion requires that the buffer be grown, it will first be grown
// and everything moved, and then the items will be inserted, potentially
// moving some items twice. This simplifies the implemntation substantially
// moving some items twice. This simplifies the implementation substantially
// and means less generated templatized code. Since this is an uncommon
// operation for deques, and already relatively slow, it doesn't seem worth
// the benefit to optimize this.
Expand Down Expand Up @@ -1041,7 +1041,7 @@ class circular_deque {
}

#if DCHECK_IS_ON()
// Asserts the given index is dereferencable. The index is an index into the
// Asserts the given index is dereferenceable. The index is an index into the
// buffer, not an index used by operator[] or at() which will be offsets from
// begin.
void CheckValidIndex(size_t i) const {
Expand All @@ -1051,7 +1051,7 @@ class circular_deque {
DCHECK((i >= begin_ && i < buffer_.capacity()) || i < end_);
}

// Asserts the given index is either dereferencable or points to end().
// Asserts the given index is either dereferenceable or points to end().
void CheckValidIndexOrEnd(size_t i) const {
if (i != end_)
CheckValidIndex(i);
Expand Down
2 changes: 1 addition & 1 deletion src/base/files/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class File {
// Same as above but without seek.
int ReadAtCurrentPosNoBestEffort(char* data, int size);

// Writes the given buffer into the file at the given offset, overwritting any
// Writes the given buffer into the file at the given offset, overwriting any
// data that was previously there. Returns the number of bytes written, or -1
// on error. Note that this function makes a best effort to write all data on
// all platforms. |data| can be nullptr when |size| is 0.
Expand Down
2 changes: 1 addition & 1 deletion src/base/files/file_enumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class FileEnumerator {
bool IsDirectory() const;

// The name of the file. This will not include any path information. This
// is in constrast to the value returned by FileEnumerator.Next() which
// is in contrast to the value returned by FileEnumerator.Next() which
// includes the |root_path| passed into the FileEnumerator constructor.
FilePath GetName() const;

Expand Down
2 changes: 1 addition & 1 deletion src/base/files/file_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ bool FilePath::AppendRelativePath(const FilePath& child, FilePath* path) const {

#if defined(FILE_PATH_USES_DRIVE_LETTERS)
// Windows can access case sensitive filesystems, so component
// comparisions must be case sensitive, but drive letters are
// comparisons must be case sensitive, but drive letters are
// never case sensitive.
if ((FindDriveLetter(*parent_comp) != StringType::npos) &&
(FindDriveLetter(*child_comp) != StringType::npos)) {
Expand Down
2 changes: 1 addition & 1 deletion src/base/files/file_util_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
if (real_path_result.empty())
return false;

// To be consistant with windows, fail if |real_path_result| is a
// To be consistent with windows, fail if |real_path_result| is a
// directory.
if (DirectoryExists(real_path_result))
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/base/json/json_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class JSONParser {
// parser is wound to the first character of any of those.
std::optional<Value> ConsumeLiteral();

// Helper function that returns true if the byte squence |match| can be
// Helper function that returns true if the byte sequence |match| can be
// consumed at the current parser position. Returns false if there are fewer
// than |match|-length bytes or if the sequence does not match, and the
// parser state is unchanged.
Expand Down
2 changes: 1 addition & 1 deletion src/base/memory/ref_counted.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ScopedAllowCrossThreadRefCountAccess final {
// };
//
// You should always make your destructor non-public, to avoid any code deleting
// the object accidently while there are references to it.
// the object accidentally while there are references to it.
//
//
// The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs
Expand Down
2 changes: 1 addition & 1 deletion src/base/numerics/checked_math_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class CheckedNumericState {};
template <typename T>
class CheckedNumericState<T, NUMERIC_INTEGER> {
private:
// is_valid_ precedes value_ because member intializers in the constructors
// is_valid_ precedes value_ because member initializers in the constructors
// are evaluated in field order, and is_valid_ must be read when initializing
// value_.
bool is_valid_;
Expand Down
2 changes: 1 addition & 1 deletion src/base/numerics/safe_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct SaturateFastOp<
// saturated_cast<> is analogous to static_cast<> for numeric types, except
// that the specified numeric conversion will saturate by default rather than
// overflow or underflow, and NaN assignment to an integral will return 0.
// All boundary condition behaviors can be overriden with a custom handler.
// All boundary condition behaviors can be overridden with a custom handler.
template <typename Dst,
template <typename> class SaturationHandler = SaturationDefaultLimits,
typename Src>
Expand Down
2 changes: 1 addition & 1 deletion src/base/numerics/safe_math_shared_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct UnsignedOrFloatForSize<Numeric, false, true> {
// Wrap the unary operations to allow SFINAE when instantiating integrals versus
// floating points. These don't perform any overflow checking. Rather, they
// exhibit well-defined overflow semantics and rely on the caller to detect
// if an overflow occured.
// if an overflow occurred.

template <typename T,
typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
Expand Down
2 changes: 1 addition & 1 deletion src/base/scoped_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ScopedGeneric {
}

// Frees the currently owned object, if any. Then takes ownership of a new
// object, if given. Self-resets are not allowd as on unique_ptr. See
// object, if given. Self-resets are not allowed as on unique_ptr. See
// http://crbug.com/162971
void reset(const element_type& value = traits_type::InvalidValue()) {
if (data_.generic != traits_type::InvalidValue() && data_.generic == value)
Expand Down
2 changes: 1 addition & 1 deletion src/base/strings/string_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ STR CollapseWhitespaceT(const STR& text, bool trim_sequences_with_line_breaks) {
--chars_written;
}
} else {
// Non-whitespace chracters are copied straight across.
// Non-whitespace characters are copied straight across.
in_whitespace = false;
already_trimmed = false;
result[chars_written++] = *i;
Expand Down
2 changes: 1 addition & 1 deletion src/base/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Value {
// This overload is necessary to avoid ambiguity for const char* arguments.
Value* SetKey(const char* key, Value value);

// This attemps to remove the value associated with |key|. In case of failure,
// This attempts to remove the value associated with |key|. In case of failure,
// e.g. the key does not exist, |false| is returned and the underlying
// dictionary is not changed. In case of success, |key| is deleted from the
// dictionary and the method returns |true|.
Expand Down
2 changes: 1 addition & 1 deletion src/base/win/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RegKey {
HKEY Take();

// Returns false if this key does not have the specified value, or if an error
// occurrs while attempting to access it.
// occurs while attempting to access it.
bool HasValue(const char16_t* value_name) const;

// Returns the number of values for this key, or 0 if the number cannot be
Expand Down
2 changes: 1 addition & 1 deletion src/gn/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
declared_arguments[variables::kTargetCpu] = empty_string;

// Mark these variables used so the build config file can override them
// without geting a warning about overwriting an unused variable.
// without getting a warning about overwriting an unused variable.
dest->MarkUsed(variables::kHostCpu);
dest->MarkUsed(variables::kCurrentCpu);
dest->MarkUsed(variables::kTargetCpu);
Expand Down
4 changes: 2 additions & 2 deletions src/gn/builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace {
using BuilderRecordSet = BuilderRecord::BuilderRecordSet;

// Recursively looks in the tree for a given node, returning true if it
// was found in the dependecy graph. This is used to see if a given node
// was found in the dependency graph. This is used to see if a given node
// participates in a cycle.
//
// If this returns true, the cycle will be in *path. This should point to an
Expand Down Expand Up @@ -288,7 +288,7 @@ bool Builder::ToolchainDefined(BuilderRecord* record, Err* err) {
record->AddDep(dep_record);
}

// The default toolchain gets generated by default. Also propogate the
// The default toolchain gets generated by default. Also propagate the
// generate flag if it depends on items in a non-default toolchain.
if (record->should_generate() ||
toolchain->settings()->default_toolchain_label() == toolchain->label())
Expand Down
2 changes: 1 addition & 1 deletion src/gn/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Builder {

void ScheduleItemLoadIfNecessary(BuilderRecord* record);

// This takes a BuilderRecord with resolved depdencies, and fills in the
// This takes a BuilderRecord with resolved dependencies, and fills in the
// target's Label*Vectors with the resolved pointers.
bool ResolveItem(BuilderRecord* record, Err* err);

Expand Down
2 changes: 1 addition & 1 deletion src/gn/command_args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void BuildArgJson(base::Value& dict,
// Fetch argument name.
dict.SetKey("name", base::Value(name));

// Fetch overridden value inforrmation (if present).
// Fetch overridden value information (if present).
if (arg.has_override) {
base::DictionaryValue override_dict;
override_dict.SetKey("value",
Expand Down
2 changes: 1 addition & 1 deletion src/gn/command_clean.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bool CleanOneDir(const std::string& dir) {
return false;
}

// Write a .d file for the build which references a nonexistant file.
// Write a .d file for the build which references a nonexistent file.
// This will make Ninja always mark the build as dirty.
std::string dummy_content("build.ninja: nonexistant_file.gn\n");
if (base::WriteFile(build_ninja_d_file, dummy_content.data(),
Expand Down
2 changes: 1 addition & 1 deletion src/gn/command_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void InsertTargetsIntoFoundPaths(const PathVector& path,
// Don't try to insert the 0th item in the list which is the "from" target.
// The search will be run more than once (for the different path types) and
// if the "from" target was in the list, subsequent passes could never run
// the starting point is alredy in the list of targets considered).
// the starting point is already in the list of targets considered).
//
// One might imagine an alternate implementation where all items are counted
// here but the "from" item is erased at the beginning of each search, but
Expand Down
2 changes: 1 addition & 1 deletion src/gn/compile_commands_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CompileCommandsWriter {
const std::set<std::string>& target_filters_set);

private:
// This fuction visits the deps graph of a target in a DFS fashion.
// This function visits the deps graph of a target in a DFS fashion.
static void VisitDeps(const Target* target, std::set<const Target*>* visited);
};

Expand Down
4 changes: 2 additions & 2 deletions src/gn/desc_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "gn/variables.h"

// Example structure of Value for single target
// (not applicable or empty fields will be ommitted depending on target type)
// (not applicable or empty fields will be omitted depending on target type)
//
// target_properties = {
// "type" : "output_type", // matching Target::GetStringForOutputType
Expand All @@ -37,7 +37,7 @@
// "public" : either "*" or [ list of public headers],
// "inputs" : [ list of inputs for target ],
// "configs" : [ list of configs for this target ],
// "public_configs" : [ list of public configs for this taget],
// "public_configs" : [ list of public configs for this target],
// "all_dependent_configs", [ list of all dependent configs for this target],
// "script" : "script for action targets",
// "args" : [ argument list for action targets ],
Expand Down
2 changes: 1 addition & 1 deletion src/gn/exec_process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool ExecProcess(const base::CommandLine& cmdline,
fd_shuffle1.push_back(
base::InjectionArc(err_write.get(), STDERR_FILENO, true));
fd_shuffle1.push_back(base::InjectionArc(dev_null, STDIN_FILENO, true));
// Adding another element here? Remeber to increase the argument to
// Adding another element here? Remember to increase the argument to
// reserve(), above.

// DANGER: Do NOT convert to range-based for loop!
Expand Down
8 changes: 4 additions & 4 deletions src/gn/filesystem_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void NormalizePath(std::string* path, const std::string_view& source_root) {

// |path| is now absolute, so |top_index| is 1. |dest_i| and
// |src_i| should be incremented to keep the same relative
// position. Comsume the leading "//" by decrementing |dest_i|.
// position. Consume the leading "//" by decrementing |dest_i|.
top_index = 1;
pathbuf = &(*path)[0];
dest_i += source_root_len - 2;
Expand All @@ -610,15 +610,15 @@ void NormalizePath(std::string* path, const std::string_view& source_root) {
src_i += consumed_len;
}
} else {
// Dot not preceeded by a slash, copy it literally.
// Dot not preceded by a slash, copy it literally.
pathbuf[dest_i++] = pathbuf[src_i++];
}
} else if (IsSlash(pathbuf[src_i])) {
if (src_i > 0 && IsSlash(pathbuf[src_i - 1])) {
// Two slashes in a row, skip over it.
src_i++;
} else {
// Just one slash, copy it, normalizing to foward slash.
// Just one slash, copy it, normalizing to forward slash.
pathbuf[dest_i] = '/';
dest_i++;
src_i++;
Expand Down Expand Up @@ -838,7 +838,7 @@ std::string ResolveRelative(const StringType& input,

// With no source_root, there's nothing we can do about
// e.g. input=../../../path/to/file and value=//source and we'll
// errornously return //file.
// erroneously return //file.
result.reserve(value.size() + input.size());
result.assign(value);
result.append(input.data(), input.size());
Expand Down
2 changes: 1 addition & 1 deletion src/gn/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class NonNestableBlock {
const char* type_description_;

// Set to true when the key is added to the scope so we don't try to
// delete nonexistant keys which will cause assertions.
// delete nonexistent keys which will cause assertions.
bool key_added_;
};

Expand Down
2 changes: 1 addition & 1 deletion src/gn/generated_file_target_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bool GeneratedFileTargetGenerator::IsMetadataCollectionTarget(
Err(origin, std::string(variable) + " won't be used.",
"\"contents\" is defined on this target, and so setting " +
std::string(variable) +
" will have no effect as no metdata collection will occur.");
" will have no effect as no metadata collection will occur.");
return false;
}
return true;
Expand Down
8 changes: 4 additions & 4 deletions src/gn/hash_table_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
//
// Lookup, insertion and deletion are performed in ways that
// are *very* different from standard containers, and the reason
// is, unsuprisingly, performance.
// is, unsurprisingly, performance.
//
// Use NodeLookup() to look for an existing item in the hash table.
// This takes the item's hash value, and a templated callable to
Expand Down Expand Up @@ -137,7 +137,7 @@
// }
//
// // Try to add |key| to the set. Return true if the insertion
// // was succesful, or false if the item was already in the set.
// // was successful, or false if the item was already in the set.
// bool add(const Foo& key) {
// size_t hash = MakeHash(key);
// Node* node = NodeLookup(
Expand Down Expand Up @@ -433,7 +433,7 @@ class HashTableBase {
}

// Call this method after updating the content of the |node| pointer
// returned by an unsucessful NodeLookup(). Return true to indicate that
// returned by an unsuccessful NodeLookup(). Return true to indicate that
// the table size changed, and that existing iterators were invalidated.
bool UpdateAfterInsert() {
count_ += 1;
Expand All @@ -445,7 +445,7 @@ class HashTableBase {
}

// Call this method after updating the content of the |node| value
// returned a by succesful NodeLookup, to the tombstone value, if any.
// returned a by successful NodeLookup, to the tombstone value, if any.
// Return true to indicate a table size change, ie. that existing
// iterators where invalidated.
bool UpdateAfterRemoval() {
Expand Down
2 changes: 1 addition & 1 deletion src/gn/hash_table_base_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class TestHashTable : public HashTableBase<TestHashNode> {
// IMPORTANT NOTE: Because the table contains bare owning pointers, we
// have to use explicit copy and move constructor/operators for things
// to work as expected. This is yet another reason why HashTableBase<>
// should only be used with care (preferrably with non-owning pointers).
// should only be used with care (preferably with non-owning pointers).
//
TestHashTable(const TestHashTable& other) : BaseType(other) {
// Only node (i.e. pointers) are copied by the base type.
Expand Down
2 changes: 1 addition & 1 deletion src/gn/inherited_libraries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void InheritedLibraries::Append(const Target* target, bool is_public) {
void InheritedLibraries::AppendInherited(const InheritedLibraries& other,
bool is_public) {
// Append all items in order, mark them public only if the're already public
// and we're adding them publically.
// and we're adding them publicly.
for (const auto& cur : other.GetOrderedAndPublicFlag())
Append(cur.first, is_public && cur.second);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gn/inherited_libraries.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InheritedLibraries {
// Appends all items from the "other" list to the current one. The is_public
// parameter indicates how the current target depends on the items in
// "other". If is_public is true, the existing public flags of the appended
// items will be preserved (propogating the public-ness up the dependency
// items will be preserved (propagating the public-ness up the dependency
// chain). If is_public is false, all deps will be added as private since
// the current target isn't forwarding them.
void AppendInherited(const InheritedLibraries& other, bool is_public);
Expand Down
2 changes: 1 addition & 1 deletion src/gn/input_file_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ bool InputFileManager::LoadFile(const LocationRange& origin,
bool success =
DoLoadFile(origin, build_settings, name, load_file_callback_, file, &tokens, &root, err);
// Can't return early. We have to ensure that the completion event is
// signaled in all cases bacause another thread could be blocked on this one.
// signaled in all cases because another thread could be blocked on this one.

// Save this pointer for running the callbacks below, which happens after the
// scoped ptr ownership is taken away inside the lock.
Expand Down
Loading

0 comments on commit e0358b4

Please sign in to comment.