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

Userland: Allow building SerenityOS with -funsigned-char

Some of the code assumed that chars were always signed while that is
not the case on ARM hosts.

Also, some of the code tried to use EOF (-1) in a way similar to what
fgetc() does, however instead of storing the characters in an int
variable a char was used.

While this seemed to work it also meant that character 0xFF would be
incorrectly seen as an end-of-file.

Careful reading of fgetc() reveals that fgetc() stores character
data in an int where valid characters are in the range of 0-255 and
the EOF value is explicitly outside of that range (usually -1).
This commit is contained in:
Gunnar Beutner 2021-06-13 09:15:00 +02:00 committed by Andreas Kling
parent 6ab48d612a
commit d476144565
9 changed files with 20 additions and 13 deletions

View file

@ -388,7 +388,7 @@ public:
}
private:
char m_name { -1 };
char m_name { 0 };
};
class TildeValue final : public Value {
@ -1290,7 +1290,7 @@ private:
virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, const HitTestResult&) override;
virtual HitTestResult hit_test_position(size_t) const override;
char m_name { -1 };
char m_name { 0 };
};
class Juxtaposition final : public Node {