From c87e3e53eaa704fd2cf40476c39821f2d255455f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 7 Oct 2025 20:58:04 +0200 Subject: [PATCH] Fix typos discovered by codespell --- README.md | 2 +- containers/haiku/container_haiku.cpp | 2 +- containers/haiku/container_haiku.h | 2 +- containers/test/canvas_ity.hpp | 4 ++-- containers/test/lodepng.cpp | 4 ++-- containers/test/lodepng.h | 6 +++--- src/css_parser.cpp | 2 +- src/encodings.cpp | 2 +- src/gumbo/tokenizer.c | 4 ++-- src/line_box.cpp | 4 ++-- src/style.cpp | 2 +- support/README.md | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 47c0d9959..113a9a82f 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The litebrowser source codes are available on GitHub: ## License **litehtml** is distributed under [New BSD License](https://opensource.org/licenses/BSD-3-Clause). -The **gumbo-parser** is disributed under [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) +The **gumbo-parser** is distributed under [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) ## Links diff --git a/containers/haiku/container_haiku.cpp b/containers/haiku/container_haiku.cpp index 13eba2d02..1f118cadd 100644 --- a/containers/haiku/container_haiku.cpp +++ b/containers/haiku/container_haiku.cpp @@ -1,7 +1,7 @@ /* * Copyright 2019-2020 Haiku Inc. * All rights reserved. Distributed under the terms of the BSD 3-clause license. - * Constributors + * Contributors * 2019-2020 Adam Fowler */ #include "container_haiku.h" diff --git a/containers/haiku/container_haiku.h b/containers/haiku/container_haiku.h index cfaf98145..2daf9b20d 100644 --- a/containers/haiku/container_haiku.h +++ b/containers/haiku/container_haiku.h @@ -1,7 +1,7 @@ /* * Copyright 2019-2020 Haiku Inc. * All rights reserved. Distributed under the terms of the BSD 3-clause license. - * Constributors + * Contributors * 2019-2020 Adam Fowler */ #ifndef LITEHTMLVIEW_H diff --git a/containers/test/canvas_ity.hpp b/containers/test/canvas_ity.hpp index 7241ff080..5fb432096 100644 --- a/containers/test/canvas_ity.hpp +++ b/containers/test/canvas_ity.hpp @@ -260,7 +260,7 @@ class canvas /// @brief Add an arbitrary transform to the current transform. /// - /// This takes six values for the upper two rows of a homogenous 3x3 + /// This takes six values for the upper two rows of a homogeneous 3x3 /// matrix (i.e., {{a, c, e}, {b, d, f}, {0.0, 0.0, 1.0}}) describing an /// arbitrary affine transform and appends it to the current transform. /// The values can represent any affine transform such as scaling, @@ -285,7 +285,7 @@ class canvas /// @brief Replace the current transform. /// - /// This takes six values for the upper two rows of a homogenous 3x3 + /// This takes six values for the upper two rows of a homogeneous 3x3 /// matrix (i.e., {{a, c, e}, {b, d, f}, {0.0, 0.0, 1.0}}) describing /// an arbitrary affine transform and replaces the current transform /// with it. The values can represent any affine transform such as diff --git a/containers/test/lodepng.cpp b/containers/test/lodepng.cpp index abf4ed4d8..3a7f10e42 100644 --- a/containers/test/lodepng.cpp +++ b/containers/test/lodepng.cpp @@ -1371,7 +1371,7 @@ static unsigned inflateNoCompression(ucvector* out, LodePNGBitReader* reader, /*read the literal data: LEN bytes are now stored in the out buffer*/ if(bytepos + LEN > size) return 23; /*error: reading outside of in buffer*/ - /*out->data can be NULL (when LEN is zero), and arithmetics on NULL ptr is undefined*/ + /*out->data can be NULL (when LEN is zero), and arithmetic on NULL ptr is undefined*/ if (LEN) { lodepng_memcpy(out->data + out->size - LEN, reader->data + bytepos, LEN); bytepos += LEN; @@ -6060,7 +6060,7 @@ unsigned lodepng_encode(unsigned char** out, size_t* outsize, if(state->encoder.force_palette) { if(info.color.colortype != LCT_GREY && info.color.colortype != LCT_GREY_ALPHA && (auto_color.colortype == LCT_GREY || auto_color.colortype == LCT_GREY_ALPHA)) { - /*user speficially forced a PLTE palette, so cannot convert to grayscale types because + /*user specifically forced a PLTE palette, so cannot convert to grayscale types because the PNG specification only allows writing a suggested palette in PLTE for truecolor types*/ allow_convert = 0; } diff --git a/containers/test/lodepng.h b/containers/test/lodepng.h index 7f0190d8d..7d4dc1370 100644 --- a/containers/test/lodepng.h +++ b/containers/test/lodepng.h @@ -832,7 +832,7 @@ typedef struct LodePNGEncoderSettings { const unsigned char* predefined_filters; /*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). - If colortype is 3, PLTE is always created. If color type is explicitely set + If colortype is 3, PLTE is always created. If color type is explicitly set to a grayscale type (1 or 4), this is not done and is ignored. If enabling this, a palette must be present in the info_png. NOTE: enabling this may worsen compression if auto_convert is used to choose @@ -996,7 +996,7 @@ unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsign Appends new chunk to out. The chunk to append is given by giving its length, type and data separately. The type is a 4-letter string. The out variable and outsize are updated to reflect the new reallocated buffer. -Returne error code (0 if it went ok) +Return error code (0 if it went ok) */ unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, unsigned length, const char* type, const unsigned char* data); @@ -1871,7 +1871,7 @@ state.decoder.remember_unknown_chunks: whether to read in unknown chunks state.info_raw.colortype: desired color type for decoded image state.info_raw.bitdepth: desired bit depth for decoded image state.info_raw....: more color settings, see struct LodePNGColorMode -state.info_png....: no settings for decoder but ouput, see struct LodePNGInfo +state.info_png....: no settings for decoder but output, see struct LodePNGInfo For encoding: diff --git a/src/css_parser.cpp b/src/css_parser.cpp index 3a78b0064..fb5952166 100644 --- a/src/css_parser.cpp +++ b/src/css_parser.cpp @@ -141,7 +141,7 @@ css_token_vector normalize(string input, int options, keep_whitespace_fn keep_wh } // https://www.w3.org/TR/css-syntax-3/#parse-stylesheet -// I don't create a stylesheet because its only perpose is to pass a list of rules to +// I don't create a stylesheet because its only purpose is to pass a list of rules to // parse_css_stylesheet. I just return the list of rules directly instead. raw_rule::vector css_parser::parse_stylesheet(const string& input, bool top_level) { diff --git a/src/encodings.cpp b/src/encodings.cpp index f56c0f10f..3159eaf9d 100644 --- a/src/encodings.cpp +++ b/src/encodings.cpp @@ -2031,7 +2031,7 @@ void encoding_sniffing_algorithm(estring& str) if (str.encoding == encoding::null) { str.encoding = encoding::utf_8; - str.confidence = confidence::tentative; // tentative means it will be overriden by encoding if present + str.confidence = confidence::tentative; // tentative means it will be overridden by encoding if present } // otherwise use str.encoding (tentative) } diff --git a/src/gumbo/tokenizer.c b/src/gumbo/tokenizer.c index 71b5d32ad..a4e72d57b 100644 --- a/src/gumbo/tokenizer.c +++ b/src/gumbo/tokenizer.c @@ -83,7 +83,7 @@ typedef struct GumboInternalTagState { const char* _original_text; // The current tag enum, computed once the tag name state has finished so that - // the buffer can be re-used for building up attributes. + // the buffer can be reused for building up attributes. GumboTag _tag; // The starting location of the text in the buffer. @@ -409,7 +409,7 @@ static void reset_token_start_point(GumboTokenizerState* tokenizer) { // Sets the tag buffer original text and start point to the current iterator // position. This is necessary because attribute names & values may have -// whitespace preceeding them, and so we can't assume that the actual token +// whitespace preceding them, and so we can't assume that the actual token // starting point was the end of the last tag buffer usage. static void reset_tag_buffer_start_point(GumboParser* parser) { GumboTokenizerState* tokenizer = parser->_tokenizer_state; diff --git a/src/line_box.cpp b/src/line_box.cpp index 675607a72..f29bf4cad 100644 --- a/src/line_box.cpp +++ b/src/line_box.cpp @@ -435,7 +435,7 @@ std::list< std::unique_ptr > litehtml::line_box::finish { case va_bottom: case va_top: - // Align by base line 0 all inline boxes with top and bottom vertical aling + // Align by base line 0 all inline boxes with top and bottom vertical align bl = 0; is_top_bottom_box = true; break; @@ -584,7 +584,7 @@ std::list< std::unique_ptr > litehtml::line_box::finish } } else { - // Add inline boxes dimentions + // Add inline boxes dimensions line_max_height.top = std::min(line_max_height.top, inline_boxes_dims.top); line_max_height.bottom = std::max(line_max_height.bottom, inline_boxes_dims.bottom); diff --git a/src/style.cpp b/src/style.cpp index 65aefdaf8..f93745fb2 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -1663,7 +1663,7 @@ void style::subst_vars(const html_tag* el) auto& value = prop.second.get(); subst_vars_(prop.first, value, el); // re-adding the same property - // if it is a custom property it will be readded as a css_token_vector + // if it is a custom property it will be re-added as a css_token_vector // if it is a standard css property it will be parsed and properly added as typed property add_property(prop.first, value, "", prop.second.m_important, el->get_document()->container()); } diff --git a/support/README.md b/support/README.md index 58f35ac06..0b2fa9220 100644 --- a/support/README.md +++ b/support/README.md @@ -251,7 +251,7 @@ Returns ```true``` if something is downloading. ### litebrowser::draw_buffer -A helper class to perform the draw operations into the cairo surface. The application draws everything to the buffer, then buffer are drawn on widged or window. +A helper class to perform the draw operations into the cairo surface. The application draws everything to the buffer, then buffer are drawn on widget or window. Some notes about scaling support: * All functions accept scale independent coordinates and sizes. So don't apply scale to the coordinates and sizes.