mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Everywhere: Fix more typos
This commit is contained in:
parent
4e86c34ef0
commit
bcfc6f0c57
Notes:
sideshowbarker
2024-07-19 02:05:28 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/bcfc6f0c57f Pull-request: https://github.com/SerenityOS/serenity/pull/3668 Reviewed-by: https://github.com/bugaevc Reviewed-by: https://github.com/xTibor
@ -332,7 +332,7 @@ public:
|
||||
|
||||
// The function will return the next range of unset bits starting from the
|
||||
// @from value.
|
||||
// @from: the postition from which the search starts. The var will be
|
||||
// @from: the position from which the search starts. The var will be
|
||||
// changed and new value is the offset of the found block.
|
||||
// @min_length: minimum size of the range which will be returned.
|
||||
// @max_length: maximum size of the range which will be returned.
|
||||
|
@ -75,7 +75,7 @@ namespace AK {
|
||||
|
||||
class InputStream : public virtual AK::Detail::Stream {
|
||||
public:
|
||||
// Reads at least one byte unless none are requested or none are avaliable. Does nothing
|
||||
// Reads at least one byte unless none are requested or none are available. Does nothing
|
||||
// and returns zero if there is already an error.
|
||||
virtual size_t read(Bytes) = 0;
|
||||
|
||||
|
@ -302,7 +302,7 @@ bool String::equals_ignoring_case(const StringView& other) const
|
||||
return StringUtils::equals_ignoring_case(view(), other);
|
||||
}
|
||||
|
||||
int String::replace(const String& needle, const String& replacement, bool all_occurences)
|
||||
int String::replace(const String& needle, const String& replacement, bool all_occurrences)
|
||||
{
|
||||
if (is_empty())
|
||||
return 0;
|
||||
@ -316,7 +316,7 @@ int String::replace(const String& needle, const String& replacement, bool all_oc
|
||||
|
||||
pos = ptr - characters();
|
||||
positions.append(pos);
|
||||
if (!all_occurences)
|
||||
if (!all_occurrences)
|
||||
break;
|
||||
|
||||
start = pos + 1;
|
||||
|
@ -252,7 +252,7 @@ public:
|
||||
|
||||
StringView view() const;
|
||||
|
||||
int replace(const String& needle, const String& replacement, bool all_occurences = false);
|
||||
int replace(const String& needle, const String& replacement, bool all_occurrences = false);
|
||||
|
||||
template<typename T, typename... Rest>
|
||||
bool is_one_of(const T& string, Rest... rest) const
|
||||
|
@ -152,14 +152,14 @@ void TestSuite::main(const String& suite_name, int argc, char** argv)
|
||||
|
||||
args_parser.add_option(do_tests_only, "Only run tests.", "tests", 0);
|
||||
args_parser.add_option(do_benchmarks_only, "Only run benchmarks.", "bench", 0);
|
||||
args_parser.add_option(do_list_cases, "List avaliable test cases.", "list", 0);
|
||||
args_parser.add_option(do_list_cases, "List available test cases.", "list", 0);
|
||||
args_parser.add_positional_argument(search_string, "Only run matching cases.", "pattern", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
const auto& matching_tests = find_cases(search_string, !do_benchmarks_only, !do_tests_only);
|
||||
|
||||
if (do_list_cases) {
|
||||
out() << "Avaliable cases for " << suite_name << ":";
|
||||
out() << "Available cases for " << suite_name << ":";
|
||||
for (const auto& test : matching_tests) {
|
||||
out() << " " << test.name();
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ TEST_CASE(set_range)
|
||||
bitmap.set_range(48, 32, true);
|
||||
bitmap.set_range(94, 39, true);
|
||||
bitmap.set_range(190, 71, true);
|
||||
bitmap.set_range(190 + 71 - 7, 21, false); // slighly overlapping clear
|
||||
bitmap.set_range(190 + 71 - 7, 21, false); // slightly overlapping clear
|
||||
for (size_t i = 0; i < bitmap.size(); i++) {
|
||||
bool should_be_set = (i >= 48 && i < 48 + 32)
|
||||
|| (i >= 94 && i < 94 + 39)
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
// Internal representation ofthe current decimal value.
|
||||
// Internal representation of the current decimal value.
|
||||
bool m_negative { false };
|
||||
long m_int_value { 0 };
|
||||
long m_frac_value { 0 };
|
||||
|
@ -151,10 +151,10 @@ static bool handle_breakpoint_command(const String& command)
|
||||
|
||||
bool success = g_debug_session->insert_breakpoint(reinterpret_cast<void*>(breakpoint_address));
|
||||
if (!success) {
|
||||
fprintf(stderr, "coult not insert breakpoint at: %08x\n", breakpoint_address);
|
||||
fprintf(stderr, "could not insert breakpoint at: %08x\n", breakpoint_address);
|
||||
return false;
|
||||
}
|
||||
printf("breakpoint insterted at: %08x\n", breakpoint_address);
|
||||
printf("breakpoint inserted at: %08x\n", breakpoint_address);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -184,8 +184,8 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
||||
auto left = config->read_num_entry("Window", "Left", 150);
|
||||
auto top = config->read_num_entry("Window", "Top", 75);
|
||||
auto width = config->read_num_entry("Window", "Width", 640);
|
||||
auto heigth = config->read_num_entry("Window", "Heigth", 480);
|
||||
window->set_rect({ left, top, width, heigth });
|
||||
auto height = config->read_num_entry("Window", "Height", 480);
|
||||
window->set_rect({ left, top, width, height });
|
||||
|
||||
auto& widget = window->set_main_widget<GUI::Widget>();
|
||||
widget.set_layout<GUI::VerticalBoxLayout>();
|
||||
@ -683,7 +683,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
||||
|
||||
window->show();
|
||||
|
||||
// Read direcory read mode from config.
|
||||
// Read directory read mode from config.
|
||||
auto dir_view_mode = config->read_entry("DirectoryView", "ViewMode", "Icon");
|
||||
|
||||
if (dir_view_mode.contains("Table")) {
|
||||
@ -702,7 +702,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
||||
config->write_num_entry("Window", "Left", window->x());
|
||||
config->write_num_entry("Window", "Top", window->y());
|
||||
config->write_num_entry("Window", "Width", window->width());
|
||||
config->write_num_entry("Window", "Heigth", window->height());
|
||||
config->write_num_entry("Window", "Height", window->height());
|
||||
config->sync();
|
||||
|
||||
return GUI::Window::CloseRequestDecision::Close;
|
||||
|
@ -213,7 +213,7 @@ pop3s 995/tcp # POP-3 over SSL
|
||||
#> providing services to unknown callers, a service contact port is
|
||||
#> defined. This list specifies the port used by the server process as its
|
||||
#> contact port. While the IANA can not control uses of these ports it
|
||||
#> does register or list uses of these ports as a convienence to the
|
||||
#> does register or list uses of these ports as a convenience to the
|
||||
#> community.
|
||||
#
|
||||
socks 1080/tcp # socks proxy server
|
||||
@ -392,7 +392,7 @@ afs3-vlserver 7003/tcp # volume location database
|
||||
afs3-vlserver 7003/udp
|
||||
afs3-kaserver 7004/tcp # AFS/Kerberos authentication
|
||||
afs3-kaserver 7004/udp
|
||||
afs3-volser 7005/tcp # volume managment server
|
||||
afs3-volser 7005/tcp # volume management server
|
||||
afs3-volser 7005/udp
|
||||
afs3-errors 7006/tcp # error interpretation service
|
||||
afs3-errors 7006/udp
|
||||
|
@ -5,4 +5,4 @@ ViewMode=Icon
|
||||
Left=150
|
||||
Top=75
|
||||
Width=640
|
||||
Heigth=480
|
||||
Height=480
|
||||
|
@ -19,7 +19,7 @@
|
||||
/* picture setup */
|
||||
#top { margin: 100em 3em 0; padding: 2em 0 0 .5em; text-align: left; font: 2em/24px sans-serif; color: navy; white-space: pre; } /* "Hello World!" text */
|
||||
.picture { position: relative; border: 1em solid transparent; margin: 0 0 100em 3em; } /* containing block for face */
|
||||
.picture { background: red; } /* overriden by preferred stylesheet below */
|
||||
.picture { background: red; } /* overridden by preferred stylesheet below */
|
||||
|
||||
/* top line of face (scalp): fixed positioning and min/max height/width */
|
||||
.picture p { position: fixed; margin: 0; padding: 0; border: 0; top: 9em; left: 11em; width: 140%; max-width: 4em; height: 8px; min-height: 1em; max-height: 2mm; /* min-height overrides max-height, see 10.7 */ background: black; border-bottom: 0.5em yellow solid; }
|
||||
|
@ -51,7 +51,7 @@ div + div {
|
||||
#three-px-solid-blue {
|
||||
border: 3px solid blue;
|
||||
}
|
||||
#foo-but-actually-resetted {
|
||||
#foo-but-actually-reset {
|
||||
border-top-color: red;
|
||||
border-right-color: lime;
|
||||
border-bottom-color: blue;
|
||||
@ -132,7 +132,7 @@ div + div {
|
||||
<div id="resetting">resetting</div>
|
||||
<div id="three-px-solid-blue-separate">three px solid blue separate</div>
|
||||
<div id="three-px-solid-blue">three px solid blue</div>
|
||||
<div id="foo-but-actually-resetted">foo but actually resetted</div>
|
||||
<div id="foo-but-actually-reset">foo but actually reset</div>
|
||||
<div id="double-width">double width</div>
|
||||
<div id="double-style">double style</div>
|
||||
<div id="double-color">double color</div>
|
||||
|
@ -440,7 +440,7 @@ reduce.__documentation = JSON.stringify({
|
||||
"to the `accumulator`\n The `reduction function` should be a function of arity 2, taking " +
|
||||
"first the accumulator, then the current value, and returning the new accumulator value\n\n" +
|
||||
"Please keep in mind that this function respects the cell type, and can yield non-numeric " +
|
||||
"values to the `curent value`.",
|
||||
"values to the `current value`.",
|
||||
examples: {
|
||||
'reduce((acc, x) => acc * x, 1, range("A0", "A5"))':
|
||||
"Calculate the product of all values in the range A0:A5",
|
||||
|
@ -67,9 +67,9 @@ The expression can take any of the following forms:
|
||||
|
||||
### File permission checks
|
||||
|
||||
* `-r <file>` whether the curent user has read access to the file
|
||||
* `-w <file>` whether the curent user has write access to the file
|
||||
* `-x <file>` whether the curent user has execute access to the file
|
||||
* `-r <file>` whether the current user has read access to the file
|
||||
* `-w <file>` whether the current user has write access to the file
|
||||
* `-x <file>` whether the current user has execute access to the file
|
||||
* `-e <file>` whether the file exists
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ $ xargs [options...] [command [initial-arguments...]]
|
||||
|
||||
`xargs` reads items from a stream, delimited by some blank character (`delimiter`), and executes the `command` as many times as there are items, with any processed `initial-arguments`, possibly followed by a number of items read from the input.
|
||||
|
||||
If a `placeholder` is explicitly specified, the `max-lines` limit is set to 1, and each argument in `initial-arguments` is processed by replacing any occurence of the `placeholder` with the input item, and treating the entire resulting value as _one_ argument.
|
||||
If a `placeholder` is explicitly specified, the `max-lines` limit is set to 1, and each argument in `initial-arguments` is processed by replacing any occurrence of the `placeholder` with the input item, and treating the entire resulting value as _one_ argument.
|
||||
|
||||
It is to be noted that `command` is also subject to substitution in this mode.
|
||||
|
||||
|
@ -45,7 +45,7 @@ mounted file system.
|
||||
|
||||
If `MS_BIND` is specified in `flags`, `fs_type` is ignored and a bind mount is
|
||||
performed instead. In this case, the file or directory specified by `source_fd`
|
||||
is overlayed over `target` — the target appears to be replaced by a copy of the
|
||||
is overlaid over `target` — the target appears to be replaced by a copy of the
|
||||
source. This can be used as an alternative to symlinks or hardlinks.
|
||||
|
||||
Each bind mount has its own set of flags, independent of the others or the
|
||||
|
@ -29,7 +29,7 @@ writes some data to the pipe which the parent reads:
|
||||
```c++
|
||||
#include <AK/Assertions.h>
|
||||
#include <stdio.h>
|
||||
#incldue <unistd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ Any sequence of _Double Quoted String Part_ tokens:
|
||||
* Escaped sequences
|
||||
|
||||
##### Variable Reference
|
||||
Any sequence of _Identifier_ characters, or a _Special Variable_ follwing a `$`
|
||||
Any sequence of _Identifier_ characters, or a _Special Variable_ following a `$`
|
||||
|
||||
##### Evaluate expression
|
||||
Any expression following a `$` that is not a variable reference:
|
||||
@ -331,7 +331,7 @@ list_expression :: ' '* expression (' '+ list_expression)?
|
||||
|
||||
expression :: evaluate expression?
|
||||
| string_composite expression?
|
||||
| comment expession?
|
||||
| comment expression?
|
||||
| '(' list_expression ')' expression?
|
||||
|
||||
evaluate :: '$' '(' pipe_sequence ')'
|
||||
|
@ -36,7 +36,7 @@ This program must be run as root.
|
||||
## Files
|
||||
|
||||
* `/etc/passwd` - new user information (such as UID and GID) is appended to this file.
|
||||
* `/home/` - user home directroy is created here if the `-m` flag is specified.
|
||||
* `/home/` - user home directory is created here if the `-m` flag is specified.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -28,7 +28,7 @@ This program must be run as root.
|
||||
## Files
|
||||
|
||||
* `/etc/passwd` - user information (such as UID and GID) in this file is deleted.
|
||||
* `/home/` - user home directroy is deleted if the `-r` flag is specified.
|
||||
* `/home/` - user home directory is deleted if the `-r` flag is specified.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -89,7 +89,7 @@ int main(int argc, char** argv, char** envp)
|
||||
|
||||
printf("I think I called my lib function!\n");
|
||||
|
||||
// Test getting a method that takes and returns arugments now
|
||||
// Test getting a method that takes and returns arguments now
|
||||
const char* (*other_func)(int) = (const char* (*)(int))dlsym(handle, "other_lib_function");
|
||||
|
||||
printf("Found other lib function address %p\n", other_func);
|
||||
|
@ -80,7 +80,7 @@ void Debugger::on_breakpoint_change(const String& file, size_t line, BreakpointC
|
||||
if (!address.has_value()) {
|
||||
dbg() << "Warning: couldn't get instruction address from source";
|
||||
// TODO: Currently, the GUI will indicate that a breakpoint was inserted/removed at this line,
|
||||
// regardless of whether we actually succeeded to insert it. (For example a breakpoint on a comment, or an include statemanet).
|
||||
// regardless of whether we actually succeeded to insert it. (For example a breakpoint on a comment, or an include statement).
|
||||
// We should indicate failure via a return value from this function, and not update the breakpoint GUI if we fail.
|
||||
return;
|
||||
}
|
||||
@ -180,7 +180,7 @@ int Debugger::debugger_loop()
|
||||
do_step_over(regs);
|
||||
return Debug::DebugSession::DebugDecision::Continue;
|
||||
case DebuggerAction::Exit:
|
||||
// NOTE: Is detaching from the debugee the best thing to do here?
|
||||
// NOTE: Is detaching from the debuggee the best thing to do here?
|
||||
// We could display a dialog in the UI, remind the user that there is
|
||||
// a live debugged process, and ask whether they want to terminate/detach.
|
||||
dbg() << "Debugger exiting";
|
||||
|
@ -188,7 +188,7 @@ void DiffViewer::setup_properties()
|
||||
|
||||
Vector<String> DiffViewer::split_to_lines(const String& text)
|
||||
{
|
||||
// NOTE: This is slightly different thatn text.split('\n')
|
||||
// NOTE: This is slightly different than text.split('\n')
|
||||
Vector<String> lines;
|
||||
size_t next_line_start_index = 0;
|
||||
for (size_t i = 0; i < text.length(); ++i) {
|
||||
|
@ -79,7 +79,7 @@ GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, GUI::
|
||||
if (data.is_array())
|
||||
return String::format("<Array with %d element%s", data.as_array().size(), data.as_array().size() == 1 ? ">" : "s>");
|
||||
if (data.is_object())
|
||||
return String::format("<Object with %d entrie%s", data.as_object().size(), data.as_object().size() == 1 ? ">" : "s>");
|
||||
return String::format("<Object with %d entr%s", data.as_object().size(), data.as_object().size() == 1 ? "y>" : "ies>");
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -1255,7 +1255,7 @@ void signal_trampoline_dummy(void)
|
||||
// then calls the signal handler. We do this because, when interrupting a
|
||||
// blocking syscall, that syscall may return some special error code in eax;
|
||||
// This error code would likely be overwritten by the signal handler, so it's
|
||||
// neccessary to preserve it here.
|
||||
// necessary to preserve it here.
|
||||
asm(
|
||||
".intel_syntax noprefix\n"
|
||||
"asm_signal_trampoline:\n"
|
||||
|
@ -493,7 +493,7 @@ UniqueObject& my_unique_object(); // Free function.
|
||||
|
||||
### Comments
|
||||
|
||||
[](#comments-sentences) Make comments look like sentences by starting with a capital letter and ending with a period (punctation). One exception may be end of line comments like this `if (x == y) // false for NaN`.
|
||||
[](#comments-sentences) Make comments look like sentences by starting with a capital letter and ending with a period (punctuation). One exception may be end of line comments like this `if (x == y) // false for NaN`.
|
||||
|
||||
[](#comments-fixme) Use FIXME: (without attribution) to denote items that need to be addressed in the future.
|
||||
|
||||
|
@ -69,7 +69,7 @@ To run SerenityOS in a WHPX-enabled QEMU VM:
|
||||
WSL2 filesystem performance for IO heavy tasks (such as compiling a large C++ project) on the host Windows filesystem is terrible.
|
||||
This is because WSL2 runs as a Hyper-V virtual machine and uses the 9P file system protocol to access host windows files, over Hyper-V sockets.
|
||||
|
||||
For a more in depth explaination of the technical limitations of their approach, see [this issue on the WSL github](https://github.com/microsoft/WSL/issues/4197#issuecomment-604592340)
|
||||
For a more in depth explanation of the technical limitations of their approach, see [this issue on the WSL github](https://github.com/microsoft/WSL/issues/4197#issuecomment-604592340)
|
||||
|
||||
The recommendation from the Microsoft team on that issue is:
|
||||
|
||||
|
@ -161,18 +161,18 @@ void ChessWidget::mouseup_event(GUI::MouseEvent& event)
|
||||
case Chess::Board::Result::SeventyFiveMoveRule:
|
||||
msg = "Draw by 75 move rule.";
|
||||
break;
|
||||
case Chess::Board::Result::ThreeFoldRepitition:
|
||||
case Chess::Board::Result::ThreeFoldRepetition:
|
||||
update();
|
||||
if (GUI::MessageBox::show(window(), "The same board state has repeated three times. Claim Draw?", "Claim Draw?",
|
||||
GUI::MessageBox::Type::Information, GUI::MessageBox::InputType::YesNo)
|
||||
== GUI::Dialog::ExecYes) {
|
||||
msg = "Draw by threefold repitition.";
|
||||
msg = "Draw by threefold repetition.";
|
||||
} else {
|
||||
over = false;
|
||||
}
|
||||
break;
|
||||
case Chess::Board::Result::FiveFoldRepitition:
|
||||
msg = "Draw by fivefold repitition.";
|
||||
case Chess::Board::Result::FiveFoldRepetition:
|
||||
msg = "Draw by fivefold repetition.";
|
||||
break;
|
||||
case Chess::Board::Result::InsufficientMaterial:
|
||||
msg = "Draw by insufficient material.";
|
||||
|
@ -330,7 +330,7 @@ struct SC_setkeymap_params {
|
||||
struct SC_create_thread_params {
|
||||
unsigned int m_detach_state = 0; // JOINABLE or DETACHED
|
||||
int m_schedule_priority = 30; // THREAD_PRIORITY_NORMAL
|
||||
// FIXME: Implment guard pages in create_thread (unreadable pages at "overflow" end of stack)
|
||||
// FIXME: Implement guard pages in create_thread (unreadable pages at "overflow" end of stack)
|
||||
// "If an implementation rounds up the value of guardsize to a multiple of {PAGESIZE},
|
||||
// a call to pthread_attr_getguardsize() specifying attr shall store in the guardsize
|
||||
// parameter the guard size specified by the previous pthread_attr_setguardsize() function call"
|
||||
|
@ -1590,7 +1590,7 @@ void Processor::initialize_context_switching(Thread& initial_thread)
|
||||
m_scheduler_initialized = true;
|
||||
|
||||
asm volatile(
|
||||
"movl %[new_esp], %%esp \n" // swich to new stack
|
||||
"movl %[new_esp], %%esp \n" // switch to new stack
|
||||
"pushl %[from_to_thread] \n" // to_thread
|
||||
"pushl %[from_to_thread] \n" // from_thread
|
||||
"pushl $" __STRINGIFY(GDT_SELECTOR_CODE0) " \n"
|
||||
|
@ -192,7 +192,7 @@ RefPtr<DiskPartition> EBRPartitionTable::partition(unsigned index)
|
||||
|
||||
auto& header = this->header();
|
||||
if (header.mbr_signature != MBR_SIGNATURE) {
|
||||
klog() << "EBRPartitionTable::initialize: bad MBR signature - not initalized? 0x" << String::format("%x", header.mbr_signature);
|
||||
klog() << "EBRPartitionTable::initialize: bad MBR signature - not initialized? 0x" << String::format("%x", header.mbr_signature);
|
||||
return nullptr;
|
||||
}
|
||||
if (index_is_extended_partition(index))
|
||||
|
@ -76,7 +76,7 @@ RefPtr<DiskPartition> GPTPartitionTable::partition(unsigned index)
|
||||
unsigned lba = header.partition_array_start_lba + (((index - 1) * header.partition_entry_size) / BytesPerSector);
|
||||
|
||||
if (header.sig[0] != GPT_SIGNATURE) {
|
||||
klog() << "GPTPartitionTable::initialize: bad gpt signature - not initalized? 0x" << String::format("%x", header.sig);
|
||||
klog() << "GPTPartitionTable::initialize: bad gpt signature - not initialized? 0x" << String::format("%x", header.sig);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ RefPtr<DiskPartition> MBRPartitionTable::partition(unsigned index)
|
||||
auto& entry = header.entry[index - 1];
|
||||
|
||||
if (header.mbr_signature != MBR_SIGNATURE) {
|
||||
klog() << "MBRPartitionTable::initialize: bad mbr signature - not initalized? 0x" << String::format("%x", header.mbr_signature);
|
||||
klog() << "MBRPartitionTable::initialize: bad mbr signature - not initialized? 0x" << String::format("%x", header.mbr_signature);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ ssize_t TmpFSInode::write_bytes(off_t offset, ssize_t size, const UserOrKernelBu
|
||||
if (m_content.has_value() && m_content.value().capacity() >= (size_t)new_size) {
|
||||
m_content.value().set_size(new_size);
|
||||
} else {
|
||||
// Grow the content buffer 2x the new sizeto accomodate repeating write() calls.
|
||||
// Grow the content buffer 2x the new sizeto accommodate repeating write() calls.
|
||||
// Note that we're not actually committing physical memory to the buffer
|
||||
// until it's needed. We only grow VM here.
|
||||
|
||||
|
@ -359,7 +359,7 @@ void RTL8139NetworkAdapter::receive()
|
||||
|
||||
// we never have to worry about the packet wrapping around the buffer,
|
||||
// since we set RXCFG_WRAP_INHIBIT, which allows the rtl8139 to write data
|
||||
// past the end of the alloted space.
|
||||
// past the end of the allotted space.
|
||||
memcpy(m_packet_buffer->vaddr().as_ptr(), (const u8*)(start_of_packet + 4), length - 4);
|
||||
// let the card know that we've read this data
|
||||
m_rx_buffer_offset = ((m_rx_buffer_offset + length + 4 + 3) & ~3) % RX_BUFFER_SIZE;
|
||||
|
@ -397,7 +397,7 @@ void signal_trampoline_dummy(void)
|
||||
// then calls the signal handler. We do this because, when interrupting a
|
||||
// blocking syscall, that syscall may return some special error code in eax;
|
||||
// This error code would likely be overwritten by the signal handler, so it's
|
||||
// neccessary to preserve it here.
|
||||
// necessary to preserve it here.
|
||||
asm(
|
||||
".intel_syntax noprefix\n"
|
||||
"asm_signal_trampoline:\n"
|
||||
|
@ -699,7 +699,7 @@ void Scheduler::enter_current(Thread& prev_thread)
|
||||
|
||||
void Scheduler::leave_on_first_switch(u32 flags)
|
||||
{
|
||||
// This is called when a thread is swiched into for the first time.
|
||||
// This is called when a thread is switched into for the first time.
|
||||
// At this point, enter_current has already be called, but because
|
||||
// Scheduler::context_switch is not in the call stack we need to
|
||||
// clean up and release locks manually here
|
||||
|
@ -104,8 +104,8 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
||||
InodeMetadata loader_metadata;
|
||||
|
||||
// FIXME: Hoooo boy this is a hack if I ever saw one.
|
||||
// This is the 'random' offset we're giving to our ET_DYN exectuables to start as.
|
||||
// It also happens to be the static Virtual Addresss offset every static exectuable gets :)
|
||||
// This is the 'random' offset we're giving to our ET_DYN executables to start as.
|
||||
// It also happens to be the static Virtual Address offset every static executable gets :)
|
||||
// Without this, some assumptions by the ELF loading hooks below are severely broken.
|
||||
// 0x08000000 is a verified random number chosen by random dice roll https://xkcd.com/221/
|
||||
m_load_offset = interpreter_description ? 0x08000000 : 0;
|
||||
@ -113,7 +113,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
||||
// FIXME: We should be able to load both the PT_INTERP interpreter and the main program... once the RTLD is smart enough
|
||||
if (interpreter_description) {
|
||||
loader_metadata = interpreter_description->metadata();
|
||||
// we don't need the interpreter file desciption after we've loaded (or not) it into memory
|
||||
// we don't need the interpreter file description after we've loaded (or not) it into memory
|
||||
interpreter_description = nullptr;
|
||||
} else {
|
||||
loader_metadata = main_program_description->metadata();
|
||||
@ -176,10 +176,10 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
||||
|
||||
// FIXME: Move TLS region allocation to userspace: LibC and the dynamic loader.
|
||||
// LibC if we end up with a statically linked executable, and the
|
||||
// dynamic loader so that it can create new TLS blocks for each shared libarary
|
||||
// dynamic loader so that it can create new TLS blocks for each shared library
|
||||
// that gets loaded as part of DT_NEEDED processing, and via dlopen()
|
||||
// If that doesn't happen quickly, at least pass the location of the TLS region
|
||||
// some ELF Auxilliary Vector so the loader can use it/create new ones as necessary.
|
||||
// some ELF Auxiliary Vector so the loader can use it/create new ones as necessary.
|
||||
loader->tls_section_hook = [&](size_t size, size_t alignment) {
|
||||
ASSERT(size);
|
||||
master_tls_region = allocate_region({}, size, String(), PROT_READ | PROT_WRITE);
|
||||
@ -195,7 +195,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
||||
}
|
||||
// FIXME: Validate that this virtual address is within executable region,
|
||||
// instead of just non-null. You could totally have a DSO with entry point of
|
||||
// the beginning of the text segement.
|
||||
// the beginning of the text segment.
|
||||
if (!loader->entry().offset(m_load_offset).get()) {
|
||||
klog() << "do_exec: Failure loading " << path.characters() << ", entry pointer is invalid! (" << loader->entry().offset(m_load_offset) << ")";
|
||||
return -ENOEXEC;
|
||||
|
@ -55,7 +55,7 @@ void TTY::set_default_termios()
|
||||
KResultOr<size_t> TTY::read(FileDescription&, size_t, UserOrKernelBuffer& buffer, size_t size)
|
||||
{
|
||||
if (Process::current()->pgid() != pgid()) {
|
||||
// FIXME: Should we propigate this error path somehow?
|
||||
// FIXME: Should we propagate this error path somehow?
|
||||
(void)Process::current()->send_signal(SIGTTIN, nullptr);
|
||||
return KResult(-EINTR);
|
||||
}
|
||||
@ -203,8 +203,8 @@ void TTY::emit(u8 ch)
|
||||
|
||||
bool TTY::can_do_backspace() const
|
||||
{
|
||||
//can't do back space if we're empty. Plus, we don't want to
|
||||
//removing any lines "commited" by newlines or ^D.
|
||||
// can't do back space if we're empty. Plus, we don't want to
|
||||
// remove any lines "committed" by newlines or ^D.
|
||||
if (!m_input_buffer.is_empty() && !is_eol(m_input_buffer.last()) && m_input_buffer.last() != '\0') {
|
||||
return true;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ void Thread::relock_process(bool did_unlock)
|
||||
process().big_lock().lock();
|
||||
}
|
||||
|
||||
// NOTE: We may be on a differenct CPU now!
|
||||
// NOTE: We may be on a different CPU now!
|
||||
Processor::current().restore_critical(prev_crit, prev_flags);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ void RealTimeClock::reset_to_default_ticks_per_second()
|
||||
ASSERT(success);
|
||||
}
|
||||
|
||||
// FIXME: This is a quick & dirty log base 2 with a paramater. Please provide something better in the future.
|
||||
// FIXME: This is a quick & dirty log base 2 with a parameter. Please provide something better in the future.
|
||||
static int quick_log2(size_t number)
|
||||
{
|
||||
int count = 0;
|
||||
|
@ -536,9 +536,9 @@ Board::Result Board::game_result() const
|
||||
auto repeats = m_previous_states.get(*this);
|
||||
if (repeats.has_value()) {
|
||||
if (repeats.value() == 3)
|
||||
return Result::ThreeFoldRepitition;
|
||||
return Result::ThreeFoldRepetition;
|
||||
if (repeats.value() >= 5)
|
||||
return Result::FiveFoldRepitition;
|
||||
return Result::FiveFoldRepetition;
|
||||
}
|
||||
|
||||
return Result::NotFinished;
|
||||
|
@ -137,8 +137,8 @@ public:
|
||||
StaleMate,
|
||||
FiftyMoveRule,
|
||||
SeventyFiveMoveRule,
|
||||
ThreeFoldRepitition,
|
||||
FiveFoldRepitition,
|
||||
ThreeFoldRepetition,
|
||||
FiveFoldRepetition,
|
||||
InsufficientMaterial,
|
||||
NotFinished,
|
||||
};
|
||||
|
@ -31,7 +31,7 @@
|
||||
namespace Debug {
|
||||
|
||||
DebugSession::DebugSession(int pid)
|
||||
: m_debugee_pid(pid)
|
||||
: m_debuggee_pid(pid)
|
||||
, m_executable(initialize_executable_mapped_file(pid))
|
||||
, m_elf(ELF::Loader::create(reinterpret_cast<const u8*>(m_executable->data()), m_executable->size()))
|
||||
, m_debug_info(m_elf)
|
||||
@ -47,7 +47,7 @@ NonnullOwnPtr<const MappedFile> DebugSession::initialize_executable_mapped_file(
|
||||
|
||||
DebugSession::~DebugSession()
|
||||
{
|
||||
if (m_is_debugee_dead)
|
||||
if (m_is_debuggee_dead)
|
||||
return;
|
||||
|
||||
for (const auto& bp : m_breakpoints) {
|
||||
@ -55,7 +55,7 @@ DebugSession::~DebugSession()
|
||||
}
|
||||
m_breakpoints.clear();
|
||||
|
||||
if (ptrace(PT_DETACH, m_debugee_pid, 0, 0) < 0) {
|
||||
if (ptrace(PT_DETACH, m_debuggee_pid, 0, 0) < 0) {
|
||||
perror("PT_DETACH");
|
||||
}
|
||||
}
|
||||
@ -118,7 +118,7 @@ OwnPtr<DebugSession> DebugSession::exec_and_attach(const String& command)
|
||||
|
||||
bool DebugSession::poke(u32* address, u32 data)
|
||||
{
|
||||
if (ptrace(PT_POKE, m_debugee_pid, (void*)address, data) < 0) {
|
||||
if (ptrace(PT_POKE, m_debuggee_pid, (void*)address, data) < 0) {
|
||||
perror("PT_POKE");
|
||||
return false;
|
||||
}
|
||||
@ -128,7 +128,7 @@ bool DebugSession::poke(u32* address, u32 data)
|
||||
Optional<u32> DebugSession::peek(u32* address) const
|
||||
{
|
||||
Optional<u32> result;
|
||||
int rc = ptrace(PT_PEEK, m_debugee_pid, (void*)address, 0);
|
||||
int rc = ptrace(PT_PEEK, m_debuggee_pid, (void*)address, 0);
|
||||
if (errno == 0)
|
||||
result = static_cast<u32>(rc);
|
||||
return result;
|
||||
@ -205,7 +205,7 @@ bool DebugSession::breakpoint_exists(void* address) const
|
||||
PtraceRegisters DebugSession::get_registers() const
|
||||
{
|
||||
PtraceRegisters regs;
|
||||
if (ptrace(PT_GETREGS, m_debugee_pid, ®s, 0) < 0) {
|
||||
if (ptrace(PT_GETREGS, m_debuggee_pid, ®s, 0) < 0) {
|
||||
perror("PT_GETREGS");
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
@ -214,26 +214,26 @@ PtraceRegisters DebugSession::get_registers() const
|
||||
|
||||
void DebugSession::set_registers(const PtraceRegisters& regs)
|
||||
{
|
||||
if (ptrace(PT_SETREGS, m_debugee_pid, reinterpret_cast<void*>(&const_cast<PtraceRegisters&>(regs)), 0) < 0) {
|
||||
if (ptrace(PT_SETREGS, m_debuggee_pid, reinterpret_cast<void*>(&const_cast<PtraceRegisters&>(regs)), 0) < 0) {
|
||||
perror("PT_SETREGS");
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
void DebugSession::continue_debugee(ContinueType type)
|
||||
void DebugSession::continue_debuggee(ContinueType type)
|
||||
{
|
||||
int command = (type == ContinueType::FreeRun) ? PT_CONTINUE : PT_SYSCALL;
|
||||
if (ptrace(command, m_debugee_pid, 0, 0) < 0) {
|
||||
if (ptrace(command, m_debuggee_pid, 0, 0) < 0) {
|
||||
perror("continue");
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
int DebugSession::continue_debugee_and_wait(ContinueType type)
|
||||
int DebugSession::continue_debuggee_and_wait(ContinueType type)
|
||||
{
|
||||
continue_debugee(type);
|
||||
continue_debuggee(type);
|
||||
int wstatus = 0;
|
||||
if (waitpid(m_debugee_pid, &wstatus, WSTOPPED | WEXITED) != m_debugee_pid) {
|
||||
if (waitpid(m_debuggee_pid, &wstatus, WSTOPPED | WEXITED) != m_debuggee_pid) {
|
||||
perror("waitpid");
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
@ -245,17 +245,17 @@ void* DebugSession::single_step()
|
||||
// Single stepping works by setting the x86 TRAP flag bit in the eflags register.
|
||||
// This flag causes the cpu to enter single-stepping mode, which causes
|
||||
// Interrupt 1 (debug interrupt) to be emitted after every instruction.
|
||||
// To single step the program, we set the TRAP flag and continue the debugee.
|
||||
// After the debugee has stopped, we clear the TRAP flag.
|
||||
// To single step the program, we set the TRAP flag and continue the debuggee.
|
||||
// After the debuggee has stopped, we clear the TRAP flag.
|
||||
|
||||
auto regs = get_registers();
|
||||
constexpr u32 TRAP_FLAG = 0x100;
|
||||
regs.eflags |= TRAP_FLAG;
|
||||
set_registers(regs);
|
||||
|
||||
continue_debugee();
|
||||
continue_debuggee();
|
||||
|
||||
if (waitpid(m_debugee_pid, 0, WSTOPPED) != m_debugee_pid) {
|
||||
if (waitpid(m_debuggee_pid, 0, WSTOPPED) != m_debuggee_pid) {
|
||||
perror("waitpid");
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
@ -271,7 +271,7 @@ void DebugSession::detach()
|
||||
for (auto& breakpoint : m_breakpoints.keys()) {
|
||||
remove_breakpoint(breakpoint);
|
||||
}
|
||||
continue_debugee();
|
||||
continue_debuggee();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
DebugSession(int pid);
|
||||
~DebugSession();
|
||||
|
||||
int pid() const { return m_debugee_pid; }
|
||||
int pid() const { return m_debuggee_pid; }
|
||||
|
||||
bool poke(u32* address, u32 data);
|
||||
Optional<u32> peek(u32* address) const;
|
||||
@ -88,10 +88,10 @@ public:
|
||||
FreeRun,
|
||||
Syscall,
|
||||
};
|
||||
void continue_debugee(ContinueType type = ContinueType::FreeRun);
|
||||
void continue_debuggee(ContinueType type = ContinueType::FreeRun);
|
||||
|
||||
// Returns the wstatus result of waitpid()
|
||||
int continue_debugee_and_wait(ContinueType type = ContinueType::FreeRun);
|
||||
int continue_debuggee_and_wait(ContinueType type = ContinueType::FreeRun);
|
||||
|
||||
// Returns the new eip
|
||||
void* single_step();
|
||||
@ -126,8 +126,8 @@ private:
|
||||
|
||||
static NonnullOwnPtr<const MappedFile> initialize_executable_mapped_file(int pid);
|
||||
|
||||
int m_debugee_pid { -1 };
|
||||
bool m_is_debugee_dead { false };
|
||||
int m_debuggee_pid { -1 };
|
||||
bool m_is_debuggee_dead { false };
|
||||
|
||||
NonnullOwnPtr<const MappedFile> m_executable;
|
||||
NonnullRefPtr<const ELF::Loader> m_elf;
|
||||
@ -150,13 +150,13 @@ void DebugSession::run(Callback callback)
|
||||
State state { State::FreeRun };
|
||||
|
||||
auto do_continue_and_wait = [&]() {
|
||||
int wstatus = continue_debugee_and_wait((state == State::FreeRun) ? ContinueType::FreeRun : ContinueType::Syscall);
|
||||
int wstatus = continue_debuggee_and_wait((state == State::FreeRun) ? ContinueType::FreeRun : ContinueType::Syscall);
|
||||
|
||||
// FIXME: This check actually only checks whether the debugee
|
||||
// FIXME: This check actually only checks whether the debuggee
|
||||
// stopped because it hit a breakpoint/syscall/is in single stepping mode or not
|
||||
if (WSTOPSIG(wstatus) != SIGTRAP) {
|
||||
callback(DebugBreakReason::Exited, Optional<PtraceRegisters>());
|
||||
m_is_debugee_dead = true;
|
||||
m_is_debuggee_dead = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -618,7 +618,7 @@ typedef struct {
|
||||
* NT_OPENBSD_PROCINFO
|
||||
* Note is a "elfcore_procinfo" structure.
|
||||
* NT_OPENBSD_AUXV
|
||||
* Note is a a bunch of Auxilliary Vectors, terminated by
|
||||
* Note is a a bunch of Auxiliary Vectors, terminated by
|
||||
* an AT_NULL entry.
|
||||
* NT_OPENBSD_REGS
|
||||
* Note is a "reg" structure.
|
||||
|
@ -3,7 +3,7 @@
|
||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$script_path/.." || exit 1
|
||||
|
||||
# The __cxa_guard_* calls are generated for (non trivial) initialzation of local static objects.
|
||||
# The __cxa_guard_* calls are generated for (non trivial) initialization of local static objects.
|
||||
# These symbols are OK to use within serenity code, but they are problematic in LibC because their
|
||||
# existence breaks ports (the implementation of these symbols resides in libstdc++.a which we do not link against in ports).
|
||||
# To eliminate the need for these symbols, avoid doing non-trivial construction of local statics in LibC.
|
||||
|
@ -9,7 +9,7 @@ ERRORS=()
|
||||
while IFS= read -r f; do
|
||||
if file "$f" | grep --quiet shell; then
|
||||
{
|
||||
shellcheck "$f" && echo -e "[\033[0;32mOK\033[0m]: sucessfully linted $f"
|
||||
shellcheck "$f" && echo -e "[\033[0;32mOK\033[0m]: successfully linted $f"
|
||||
} || {
|
||||
ERRORS+=("$f")
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ GeminiDownload::GeminiDownload(ClientConnection& client, NonnullRefPtr<Gemini::G
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> headers;
|
||||
headers.set("meta", response->meta());
|
||||
// Note: We're setting content-type to meta only on status==SUCCESS
|
||||
// we should prehaps have a better mechanism for this, since we
|
||||
// we should perhaps have a better mechanism for this, since we
|
||||
// are already shoehorning the concept of "headers" here
|
||||
if (response->status() >= 20 && response->status() < 30) {
|
||||
headers.set("content-type", response->meta());
|
||||
|
@ -99,7 +99,7 @@ void Client::handle_command(const Command& command)
|
||||
// them can be disabled (or re-enabled) after connecting.
|
||||
break;
|
||||
case CMD_DONT:
|
||||
// no response - we only "support" two options (echo and suppres
|
||||
// no response - we only "support" two options (echo and suppress
|
||||
// go-ahead), and both of them are always enabled.
|
||||
break;
|
||||
case CMD_WILL:
|
||||
|
@ -207,7 +207,7 @@ OwnPtr<Messages::WindowServer::AddMenuItemResponse> ClientConnection::handle(con
|
||||
auto icon_buffer = SharedBuffer::create_from_shbuf_id(message.icon_buffer_id());
|
||||
if (!icon_buffer)
|
||||
return nullptr;
|
||||
// FIXME: Verify that the icon buffer can accomodate a 16x16 bitmap view.
|
||||
// FIXME: Verify that the icon buffer can accommodate a 16x16 bitmap view.
|
||||
auto shared_icon = Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, icon_buffer.release_nonnull(), { 16, 16 });
|
||||
menu_item->set_icon(shared_icon);
|
||||
}
|
||||
|
@ -476,10 +476,10 @@ bool Menu::activate_default()
|
||||
return false;
|
||||
}
|
||||
|
||||
MenuItem* Menu::item_with_identifier(unsigned identifer)
|
||||
MenuItem* Menu::item_with_identifier(unsigned identifier)
|
||||
{
|
||||
for (auto& item : m_items) {
|
||||
if (item.identifier() == identifer)
|
||||
if (item.identifier() == identifier)
|
||||
return &item;
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -1282,7 +1282,7 @@ RefPtr<AST::Node> Parser::parse_bareword()
|
||||
text = create<AST::BarewordLiteral>(move(string));
|
||||
}
|
||||
|
||||
return create<AST::Juxtaposition>(tilde.release_nonnull(), text.release_nonnull()); // Juxtaposition Varible Bareword
|
||||
return create<AST::Juxtaposition>(tilde.release_nonnull(), text.release_nonnull()); // Juxtaposition Variable Bareword
|
||||
}
|
||||
|
||||
if (string.starts_with("\\~")) {
|
||||
|
@ -194,7 +194,7 @@ list_expression :: ' '* expression (' '+ list_expression)?
|
||||
|
||||
expression :: evaluate expression?
|
||||
| string_composite expression?
|
||||
| comment expession?
|
||||
| comment expression?
|
||||
| '(' list_expression ')' expression?
|
||||
|
||||
evaluate :: '$' '(' pipe_sequence ')'
|
||||
|
@ -62,7 +62,7 @@
|
||||
* - Time 6: PB1 forks into PB2
|
||||
* - Time 7: PB1 dies (PGB now has no leader)
|
||||
* - Time 8: PB2 calls pgrp(0, PGA)
|
||||
* Note: PB2 writes "1" (exploit successfull) or "0" (bug is fixed) to a pipe
|
||||
* Note: PB2 writes "1" (exploit successful) or "0" (bug is fixed) to a pipe
|
||||
* - Time 9: If PX hasn't received any message yet through the pipe, it declares the test as failed (for lack of knowledge). Otherwise, it outputs accordingly.
|
||||
*/
|
||||
|
||||
@ -246,7 +246,7 @@ static void run_pb2(void* pipe_fd_ptr)
|
||||
sleep_steps(2);
|
||||
|
||||
// Time 8: PB2 calls pgrp(0, PGA)
|
||||
// Note: PB2 writes "1" (exploit successfull) or "0" (bug is fixed) to a pipe
|
||||
// Note: PB2 writes "1" (exploit successful) or "0" (bug is fixed) to a pipe
|
||||
dbg() << "PB2 starts with SID=" << getsid(0) << ", PGID=" << getpgid(0) << ", PID=" << getpid() << ".";
|
||||
dbg() << "PB2 calls pgrp(0, PGA)";
|
||||
int pga = getpid() - 3;
|
||||
|
@ -47,8 +47,8 @@
|
||||
|
||||
class Mask {
|
||||
private:
|
||||
mode_t removal_mask; //the bits that will be removed
|
||||
mode_t applying_mask; //the bits that will be setted
|
||||
mode_t removal_mask; // the bits that will be removed
|
||||
mode_t applying_mask; // the bits that will be set
|
||||
|
||||
public:
|
||||
Mask()
|
||||
@ -129,7 +129,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* set the mask for each files' permissions */
|
||||
/* set the mask for each file's permissions */
|
||||
struct stat current_access;
|
||||
int i = 2;
|
||||
while (i < argc) {
|
||||
|
Loading…
Reference in New Issue
Block a user