mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
Userland: Fix more compiler warnings.
This commit is contained in:
parent
4118aaaa32
commit
3b01d7fdff
5 changed files with 8 additions and 10 deletions
|
@ -13,7 +13,7 @@ enum Unit { Bytes, KiloBytes, MegaBytes };
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
unsigned count = 50;
|
||||
int count = 50;
|
||||
Unit unit = MegaBytes;
|
||||
|
||||
if (argc >= 2) {
|
||||
|
|
|
@ -55,6 +55,7 @@ int main(int argc, char** argv)
|
|||
volatile int lala = 10;
|
||||
volatile int zero = 0;
|
||||
volatile int test = lala / zero;
|
||||
(void)test;
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
@ -71,6 +72,7 @@ int main(int argc, char** argv)
|
|||
if (mode == ReadFromUninitializedMallocMemory) {
|
||||
auto* uninitialized_memory = (volatile dword**)malloc(1024);
|
||||
volatile auto x = uninitialized_memory[0][0];
|
||||
(void)x;
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
@ -78,6 +80,7 @@ int main(int argc, char** argv)
|
|||
auto* uninitialized_memory = (volatile dword**)malloc(1024);
|
||||
free(uninitialized_memory);
|
||||
volatile auto x = uninitialized_memory[4][0];
|
||||
(void)x;
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ int main(int argc, char** argv)
|
|||
return do_file_system_object_short(path);
|
||||
};
|
||||
|
||||
int status;
|
||||
int status = 0;
|
||||
if (optind >= argc) {
|
||||
status = do_file_system_object(".");
|
||||
} else if (optind + 1 >= argc) {
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
UNUSED_PARAM(argc);
|
||||
UNUSED_PARAM(argv);
|
||||
|
||||
Vector<String> lines;
|
||||
|
||||
for (;;) {
|
||||
|
|
|
@ -68,12 +68,6 @@ off_t find_seek_pos(CFile& file, int wanted_lines)
|
|||
return pos;
|
||||
}
|
||||
|
||||
static void exit_because_we_wanted_lines()
|
||||
{
|
||||
fprintf(stderr, "Expected a line count after -n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
CArgsParser args_parser("tail");
|
||||
|
@ -108,8 +102,6 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
bool flag_follow = args.is_present("f");
|
||||
bool o_arg = args.is_present("o");
|
||||
|
||||
auto pos = find_seek_pos(f, line_count);
|
||||
return tail_from_pos(f, pos, flag_follow);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue