From 226a889dc7688cbd0c96cce1005adbda69b03ec4 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 5 Mar 2024 17:50:47 +0800 Subject: [PATCH] [DOC] fix some comments Signed-off-by: cui fliter --- coroutine/arm64/Context.S | 2 +- file.c | 2 +- include/ruby/internal/intern/signal.h | 2 +- include/ruby/internal/intern/string.h | 2 +- lib/rubygems/ext/cargo_builder.rb | 2 +- lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb | 2 +- lib/rubygems/vendor/resolv/lib/resolv.rb | 2 +- prism/prism.c | 2 +- prism/util/pm_constant_pool.c | 2 +- prism/util/pm_integer.h | 2 +- prism_compile.c | 2 +- spec/ruby/language/send_spec.rb | 2 +- spec/ruby/library/socket/udpsocket/send_spec.rb | 2 +- thread_pthread_mn.c | 2 +- variable.c | 2 +- yjit/src/codegen.rs | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/coroutine/arm64/Context.S b/coroutine/arm64/Context.S index eeb0f774a37c33..5251ab214df1f0 100644 --- a/coroutine/arm64/Context.S +++ b/coroutine/arm64/Context.S @@ -31,7 +31,7 @@ PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): # paciasp (it also acts as BTI landing pad, so no need to insert BTI also) hint #25 #elif defined(__ARM_FEATURE_BTI_DEFAULT) && (__ARM_FEATURE_BTI_DEFAULT != 0) - # For the the case PAC is not enabled but BTI is. + # For the case PAC is not enabled but BTI is. # bti c hint #34 #endif diff --git a/file.c b/file.c index 38eaa2e47c1a71..835f19e541df97 100644 --- a/file.c +++ b/file.c @@ -7582,7 +7582,7 @@ Init_File(void) * * ==== File::RDONLY * - * Flag File::RDONLY specifies the the stream should be opened for reading only: + * Flag File::RDONLY specifies the stream should be opened for reading only: * * filepath = '/tmp/t.tmp' * f = File.new(filepath, File::RDONLY) diff --git a/include/ruby/internal/intern/signal.h b/include/ruby/internal/intern/signal.h index e5b6d6c3d52869..4773788651be83 100644 --- a/include/ruby/internal/intern/signal.h +++ b/include/ruby/internal/intern/signal.h @@ -97,7 +97,7 @@ RBIMPL_ATTR_NONNULL(()) * - Case #11: When signo and PID are both negative, the behaviour of this * function depends on how `killpg(3)` works. On Linux, it seems such * attempt is strictly prohibited and `Errno::EINVAL` is raised. But on - * macOS, it seems it tries to to send the signal actually to the process + * macOS, it seems it tries to send the signal actually to the process * group. * * @note Above description is in fact different from how `kill(2)` works. diff --git a/include/ruby/internal/intern/string.h b/include/ruby/internal/intern/string.h index 3083125e5606d6..952dc508c24a67 100644 --- a/include/ruby/internal/intern/string.h +++ b/include/ruby/internal/intern/string.h @@ -412,7 +412,7 @@ VALUE rb_utf8_str_new_static(const char *ptr, long len); /** * Identical to rb_interned_str(), except it takes a Ruby's string instead of - * C's. It can also be seen as a routine identical to to rb_str_new_shared(), + * C's. It can also be seen as a routine identical to rb_str_new_shared(), * except it returns an infamous "f"string. * * @param[in] str An object of ::RString. diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb index 43973a975addb3..86a0e73f28d120 100644 --- a/lib/rubygems/ext/cargo_builder.rb +++ b/lib/rubygems/ext/cargo_builder.rb @@ -292,7 +292,7 @@ def maybe_resolve_ldflag_variable(input_arg, dest_dir, crate_name) case var_name # On windows, it is assumed that mkmf has setup an exports file for the - # extension, so we have to to create one ourselves. + # extension, so we have to create one ourselves. when "DEFFILE" write_deffile(dest_dir, crate_name) else diff --git a/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb b/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb index 5cfc6e3a0de944..84ec6cb095977b 100644 --- a/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb +++ b/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb @@ -103,7 +103,7 @@ def reversed_requirement_tree_index # @return [Boolean] where the requirement of the state we're unwinding # to directly caused the conflict. Note: in this case, it is - # impossible for the state we're unwinding to to be a parent of + # impossible for the state we're unwinding to be a parent of # any of the other conflicting requirements (or we would have # circularity) def unwinding_to_primary_requirement? diff --git a/lib/rubygems/vendor/resolv/lib/resolv.rb b/lib/rubygems/vendor/resolv/lib/resolv.rb index 1209d5167a3552..8e31eb1bee97df 100644 --- a/lib/rubygems/vendor/resolv/lib/resolv.rb +++ b/lib/rubygems/vendor/resolv/lib/resolv.rb @@ -2771,7 +2771,7 @@ def initialize(priority, target, params = []) attr_reader :target ## - # The service paramters for the target host. + # The service parameters for the target host. attr_reader :params diff --git a/prism/prism.c b/prism/prism.c index 19b22ba196c67a..6717488882edec 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -17320,7 +17320,7 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding bool accepts_command_call_inner = false; // RHS can accept command call iff the value is a call with arguments - // but without paranthesis. + // but without parenthesis. if (PM_NODE_TYPE_P(value, PM_CALL_NODE)) { pm_call_node_t *call_node = (pm_call_node_t *) value; if ((call_node->arguments != NULL) && (call_node->opening_loc.start == NULL)) { diff --git a/prism/util/pm_constant_pool.c b/prism/util/pm_constant_pool.c index 19c372e6553c43..741a036cf70383 100644 --- a/prism/util/pm_constant_pool.c +++ b/prism/util/pm_constant_pool.c @@ -253,7 +253,7 @@ pm_constant_pool_insert(pm_constant_pool_t *pool, const uint8_t *start, size_t l index = (index + 1) & mask; } - // IDs are allocated starting at 1, since the value 0 denotes a non-existant + // IDs are allocated starting at 1, since the value 0 denotes a non-existent // constant. uint32_t id = ++pool->size; assert(pool->size < ((uint32_t) (1 << 30))); diff --git a/prism/util/pm_integer.h b/prism/util/pm_integer.h index 4e080870ae2cdc..63f560275d47e7 100644 --- a/prism/util/pm_integer.h +++ b/prism/util/pm_integer.h @@ -62,7 +62,7 @@ typedef enum { /** The decimal base, indicated by a 0d, 0D, or empty prefix. */ PM_INTEGER_BASE_DECIMAL, - /** The hexidecimal base, indicated by a 0x or 0X prefix. */ + /** The hexadecimal base, indicated by a 0x or 0X prefix. */ PM_INTEGER_BASE_HEXADECIMAL, /** diff --git a/prism_compile.c b/prism_compile.c index 0558325851f9e8..fff43d6f13e633 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -2292,7 +2292,7 @@ pm_compile_pattern(rb_iseq_t *iseq, pm_scope_node_t *scope_node, const pm_node_t break; } case PM_LOCAL_VARIABLE_TARGET_NODE: { - // Local variables can be targetted by placing identifiers in the place + // Local variables can be targeted by placing identifiers in the place // of a pattern. For example, foo in bar. This results in the value // being matched being written to that local variable. pm_local_variable_target_node_t *cast = (pm_local_variable_target_node_t *) node; diff --git a/spec/ruby/language/send_spec.rb b/spec/ruby/language/send_spec.rb index a1656559fe99c5..aaccdf0998b135 100644 --- a/spec/ruby/language/send_spec.rb +++ b/spec/ruby/language/send_spec.rb @@ -43,7 +43,7 @@ end describe "with optional arguments" do - it "uses the optional argument if none is is passed" do + it "uses the optional argument if none is passed" do specs.fooM0O1.should == [1] end diff --git a/spec/ruby/library/socket/udpsocket/send_spec.rb b/spec/ruby/library/socket/udpsocket/send_spec.rb index 5d5de684afb8c3..6dd5f67bea1fa0 100644 --- a/spec/ruby/library/socket/udpsocket/send_spec.rb +++ b/spec/ruby/library/socket/udpsocket/send_spec.rb @@ -63,7 +63,7 @@ @msg[1][3].should == "127.0.0.1" end - it "raises EMSGSIZE if data is too too big" do + it "raises EMSGSIZE if data is too big" do @socket = UDPSocket.open begin -> do diff --git a/thread_pthread_mn.c b/thread_pthread_mn.c index 0b241b75852e54..b605d6a7511373 100644 --- a/thread_pthread_mn.c +++ b/thread_pthread_mn.c @@ -754,7 +754,7 @@ timer_thread_register_waiting(rb_thread_t *th, int fd, enum thread_sched_waiting case EPERM: // the fd doesn't support epoll case EEXIST: - // the fd is already registerred by another thread + // the fd is already registered by another thread rb_native_mutex_unlock(&timer_th.waiting_lock); return false; default: diff --git a/variable.c b/variable.c index 564fd643fb1e4b..0f9c5f61116eee 100644 --- a/variable.c +++ b/variable.c @@ -1442,7 +1442,7 @@ rb_obj_convert_to_too_complex(VALUE obj, st_table *table) if (old_ivtbl) { /* We need to modify old_ivtbl to have the too complex shape * and hold the table because the xmalloc could trigger a GC - * compaction. We want the table to be updated rather than than + * compaction. We want the table to be updated rather than * the original ivptr. */ #if SHAPE_IN_BASIC_FLAGS rb_shape_set_shape_id(obj, OBJ_TOO_COMPLEX_SHAPE_ID); diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 41a8cdebcae3c3..cc3bf460bb2f21 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -995,7 +995,7 @@ fn jump_to_next_insn( asm: &mut Assembler, ocb: &mut OutlinedCb, ) -> Option<()> { - // Reset the depth since in current usages we only ever jump to to + // Reset the depth since in current usages we only ever jump to // chain_depth > 0 from the same instruction. let mut reset_depth = asm.ctx; reset_depth.reset_chain_depth_and_defer();