Commit d0ff9a53 authored by Andris Mednis's avatar Andris Mednis

Fix typos in libcaf_core

parent ef2e2fb2
......@@ -81,7 +81,7 @@ public:
virtual void attach(attachable_ptr ptr) = 0;
/// Convenience function that attaches the functor `f` to this actor. The
/// actor executes `f()` on exit or immediatley if it is not running.
/// actor executes `f()` on exit or immediately if it is not running.
template <class F>
void attach_functor(F f) {
attach(attachable_ptr{new detail::functor_attachable<F>(std::move(f))});
......@@ -222,7 +222,7 @@ protected:
mutable std::mutex mtx_;
private:
// prohibit copies, assigments, and heap allocations
// prohibit copies, assignments, and heap allocations
void* operator new(size_t);
void* operator new[](size_t);
abstract_actor(const abstract_actor&) = delete;
......
......@@ -121,7 +121,7 @@ public:
friend class net::middleman;
friend class abstract_actor;
/// The number of actors implictly spawned by the actor system on startup.
/// The number of actors implicitly spawned by the actor system on startup.
static constexpr size_t num_internal_actors = 2;
/// Returns the ID of an internal actor by its name.
......@@ -594,7 +594,7 @@ private:
template <class T>
void check_invariants() {
static_assert(!std::is_base_of<prohibit_top_level_spawn_marker, T>::value,
"This actor type cannot be spawned throught an actor system. "
"This actor type cannot be spawned through an actor system. "
"Probably you have tried to spawn a broker or opencl actor.");
}
......
......@@ -91,7 +91,7 @@ public:
/// @pre `num_bytes <= remaining()`
void skip(size_t num_bytes);
/// Assings a new input.
/// Assigns a new input.
void reset(span<const byte> bytes);
protected:
......
......@@ -409,7 +409,7 @@ public:
apply(std::chrono::duration<Rep, Period>& x) {
using duration_type = std::chrono::duration<Rep, Period>;
// always save/store durations as int64_t to work around possibly
// different integer types on different plattforms for standard typedefs
// different integer types on different platforms for standard typedefs
struct {
void operator()(duration_type& lhs, Rep& rhs) const {
duration_type tmp{rhs};
......
......@@ -17,7 +17,7 @@
******************************************************************************/
// The rationale of this header is to provide a serialization API
// that is compatbile to boost.serialization. In particular, the
// that is compatible to boost.serialization. In particular, the
// design goals are:
// - allow users to integrate existing boost.serialization-based code easily
// - allow to switch out this header with the actual boost header in boost.actor
......
......@@ -120,7 +120,7 @@ public:
(*this)(const_cast<const unit_t&>(x));
}
// -- special-purpose handlers that don't procude results --------------------
// -- special-purpose handlers that don't produce results --------------------
/// Calls `(*this)()`.
inline void operator()(response_promise&) {
......
......@@ -20,7 +20,7 @@
namespace caf::detail {
/// Sets the name thread shown by the OS. Not supported on all plattforms
/// Sets the name thread shown by the OS. Not supported on all platforms
/// (no-op on Windows).
void set_thread_name(const char* name);
......
......@@ -414,7 +414,7 @@ struct tl_reverse_impl<empty_type_list, E...> {
using type = type_list<E...>;
};
/// Creates a new list wih elements in reversed order.
/// Creates a new list with elements in reversed order.
template <class List>
struct tl_reverse {
using type = typename tl_reverse_impl<List>::type;
......@@ -704,7 +704,7 @@ struct tl_map_conditional<empty_type_list, Trait, TraitResult, Funs...> {
// list pop_back()
/// Creates a new list wih all but the last element of `List`.
/// Creates a new list with all but the last element of `List`.
template <class List>
struct tl_pop_back {
using type = typename tl_slice<List, 0, tl_size<List>::value - 1>::type;
......
......@@ -112,7 +112,7 @@ public:
/// Unique pointer to an outbound path.
using typename super::unique_path_ptr;
// Lists all tempate parameters `[T, Ts...]`;
// Lists all template parameters `[T, Ts...]`;
using param_list = detail::type_list<T, Ts...>;
/// State held for each slot.
......
......@@ -151,7 +151,7 @@ public:
timestamp tstamp;
};
/// Internal representation of format string entites.
/// Internal representation of format string entities.
enum field_type {
invalid_field,
category_field,
......@@ -406,11 +406,11 @@ bool operator==(const logger::field& x, const logger::field& y);
// -- utility macros -----------------------------------------------------------
#ifdef CAF_MSVC
/// Expands to a string representation of the current funciton name that
/// Expands to a string representation of the current function name that
/// includes the full function name and its signature.
# define CAF_PRETTY_FUN __FUNCSIG__
#else // CAF_MSVC
/// Expands to a string representation of the current funciton name that
/// Expands to a string representation of the current function name that
/// includes the full function name and its signature.
# define CAF_PRETTY_FUN __PRETTY_FUNCTION__
#endif // CAF_MSVC
......
......@@ -99,7 +99,7 @@ config_option make_config_option(T& storage, string_view category,
std::addressof(storage)};
}
// -- backward compatbility, do not use for new code ! -------------------------
// -- backward compatibility, do not use for new code ! ------------------------
// Inverts the value when writing to `storage`.
config_option make_negated_config_option(bool& storage, string_view category,
......
......@@ -26,7 +26,7 @@ namespace caf {
class memory_managed {
public:
/// Default implementations calls `delete this, but can
/// be overriden in case deletion depends on some condition or
/// be overridden in case deletion depends on some condition or
/// the class doesn't use default new/delete.
/// @param decremented_rc Indicates whether the caller did reduce the
/// reference of this object before calling this member
......
......@@ -322,7 +322,7 @@ struct message::cli_arg {
/// Full name of this CLI argument using format "<long name>[,<short name>]"
std::string name;
/// Desciption of this CLI argument for the auto-generated help text.
/// Description of this CLI argument for the auto-generated help text.
std::string text;
/// Auto-generated helptext for this item.
......
......@@ -27,7 +27,7 @@
namespace caf {
/// Provides a convenient interface for createing `message` objects
/// Provides a convenient interface for creating `message` objects
/// from a series of values using the member function `append`.
class message_builder {
public:
......
......@@ -102,7 +102,7 @@ public:
protected:
/// Allows subclasses to add additional cleanup code to the
/// critical secion in `cleanup`. This member function is
/// critical section in `cleanup`. This member function is
/// called inside of a critical section.
virtual void on_cleanup(const error& reason);
......
......@@ -59,7 +59,7 @@ enum class pec : uint8_t {
type_mismatch,
/// Stopped at an unrecognized option name.
not_an_option,
/// Stopped at an unparseable argument.
/// Stopped at an unparsable argument.
illegal_argument = 15,
/// Stopped because an argument was omitted.
missing_argument,
......
......@@ -134,7 +134,7 @@ public:
template <class Worker>
resumable* dequeue(Worker* self) {
// we wait for new jobs by polling our external queue: first, we
// assume an active work load on the machine and perform aggresive
// assume an active work load on the machine and perform aggressive
// polling, then we relax our polling a bit and wait 50 us between
// dequeue attempts
auto& strategies = d(self).strategies;
......@@ -153,8 +153,8 @@ public:
}
if (strategies[k].sleep_duration.count() > 0) {
#ifdef CAF_MSVC
// Windows cannot sleep less than 1000 us, so timeout is conveted to 0
// inside sleep_for(), but Sleep(0) is dangerous so replace it with
// Windows cannot sleep less than 1000 us, so timeout is converted to
// 0 inside sleep_for(), but Sleep(0) is dangerous so replace it with
// yield()
if (strategies[k].sleep_duration.count() < 1000)
std::this_thread::yield();
......
......@@ -33,7 +33,7 @@ namespace caf {
/// An event-based actor with managed state. The state is constructed
/// before `make_behavior` will get called and destroyed after the
/// actor called `quit`. This state management brakes cycles and
/// allows actors to automatically release ressources as soon
/// allows actors to automatically release resources as soon
/// as possible.
template <class State, class Base /* = event_based_actor (see fwd.hpp) */>
class stateful_actor : public Base {
......
......@@ -31,7 +31,7 @@ namespace caf {
namespace detail {
// Catches `std::string`, `std::string_view` and all classes mimicing those,
// Catches `std::string`, `std::string_view` and all classes mimicking those,
// but not `std::vector<char>` or other buffers.
template <class T>
struct is_string_like {
......@@ -212,7 +212,7 @@ public:
void assign(const_pointer data, size_type len);
// -- algortihms -------------------------------------------------------------
// -- algorithms -------------------------------------------------------------
size_type copy(pointer dest, size_type n, size_type pos = 0) const;
......
......@@ -106,10 +106,10 @@ actor_system_config::actor_system_config()
opt_group{custom_options_, "logger"}
.add<atom_value>("verbosity", "default verbosity for file and console")
.add<string>("file-name", "filesystem path of the log file")
.add<string>("file-format", "line format for individual log file entires")
.add<string>("file-format", "line format for individual log file entries")
.add<atom_value>("file-verbosity", "file output verbosity")
.add<atom_value>("console", "std::clog output: none, colored, or uncolored")
.add<string>("console-format", "line format for printed log entires")
.add<string>("console-format", "line format for printed log entries")
.add<atom_value>("console-verbosity", "console output verbosity")
.add<std::vector<atom_value>>("component-blacklist",
"excluded components for logging")
......@@ -223,7 +223,7 @@ actor_system_config::make_help_text(const std::vector<message::cli_arg>& xs) {
auto op = [](size_t tmp, const message::cli_arg& arg) {
return std::max(tmp, arg.helptext.size());
};
// maximum string lenght of all options
// maximum string length of all options
auto name_width = std::accumulate(xs.begin(), xs.end(), size_t{0}, op);
// iterators to the vector with respect to partition point
auto first = xs.begin();
......
......@@ -58,7 +58,7 @@ config_option_set& config_option_set::add(config_option opt) {
}
std::string config_option_set::help_text(bool global_only) const {
//<--- argument --------> <---- desciption ---->
//<--- argument --------> <---- description --->
// (-w|--write) <string> : output file
auto build_argument = [](const config_option& x) {
string_builder sb;
......
......@@ -409,7 +409,7 @@ void logger::render_fun_prefix(std::ostream& out, const event& x) {
// ^~~~~~~~~~~~~
// Here, we output Java-style "my.namespace" to `out`.
auto reduced = x.pretty_fun;
// Skip all prefixes that can preceed the return type.
// Skip all prefixes that can precede the return type.
auto skip = [&](string_view str) {
if (starts_with(reduced, str)) {
reduced.remove_prefix(str.size());
......
......@@ -363,7 +363,7 @@ message::cli_res message::extract_opts(std::vector<cli_arg> xs,
return skip();
if (arg == "--") {
skip_remainder = true;
// drop frist remainder indicator
// drop first remainder indicator
return none;
}
if (arg.empty() || arg.front() != '-') {
......
......@@ -29,7 +29,7 @@ std::string replies_to_type_name(size_t input_size,
std::string result;
// 'void' is not an announced type, hence we check whether uniform_typeid
// did return a valid pointer to identify 'void' (this has the
// possibility of false positives, but those will be catched anyways)
// possibility of false positives, but those will be caught anyways)
result = "caf::replies_to<";
result += join(input, input + input_size, glue);
result += ">::with<";
......
......@@ -460,7 +460,7 @@ void scheduled_actor::quit(error x) {
for (auto i = managers.begin(); i != e; ++i) {
auto& mgr = *i;
mgr->shutdown();
// Managers can become done after calling quit if they were continous.
// Managers can become done after calling quit if they were continuous.
if (mgr->done()) {
mgr->stop();
erase_stream_manager(mgr);
......@@ -1076,7 +1076,7 @@ void scheduled_actor::erase_stream_manager(const stream_manager_ptr& mgr) {
invoke_message_result
scheduled_actor::handle_open_stream_msg(mailbox_element& x) {
CAF_LOG_TRACE(CAF_ARG(x));
// Fetches a stream manger from a behavior.
// Fetches a stream manager from a behavior.
struct visitor : detail::invoke_result_visitor {
void operator()() override {
// nop
......
......@@ -83,7 +83,7 @@ void string_view::assign(const_pointer data, size_type len) {
size_ = len;
}
// -- algortihms ---------------------------------------------------------------
// -- algorithms ---------------------------------------------------------------
string_view::size_type string_view::copy(pointer dest, size_type n,
size_type pos) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment