1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

Everywhere: Replace ctype.h to avoid narrowing conversions

This replaces ctype.h with CharacterType.h everywhere I could find
issues with narrowing conversions. While using it will probably make
sense almost everywhere in the future, the most critical places should
have been addressed.
This commit is contained in:
Max Wipfli 2021-06-01 21:18:08 +02:00 committed by Andreas Kling
parent 1c9d87c455
commit bc8d16ad28
16 changed files with 153 additions and 266 deletions

View file

@ -6,6 +6,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/CharacterTypes.h>
#include <AK/StringBuilder.h>
#include <AK/Utf8View.h>
#include <LibCore/Timer.h>
@ -53,7 +54,6 @@
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/SVG/TagNames.h>
#include <LibWeb/UIEvents/MouseEvent.h>
#include <ctype.h>
namespace Web::DOM {
@ -253,7 +253,7 @@ String Document::title() const
StringBuilder builder;
bool last_was_space = false;
for (auto code_point : Utf8View(raw_title)) {
if (isspace(code_point)) {
if (is_ascii_space(code_point)) {
last_was_space = true;
} else {
if (last_was_space && !builder.is_empty())