diff options
-rw-r--r-- | LibCore/CArgsParser.cpp | 4 | ||||
-rw-r--r-- | LibCore/CArgsParser.h | 4 | ||||
-rw-r--r-- | Servers/SystemServer/main.cpp | 2 | ||||
-rw-r--r-- | Userland/al.cpp | 6 | ||||
-rw-r--r-- | Userland/head.cpp | 2 | ||||
-rw-r--r-- | Userland/ln.cpp | 2 | ||||
-rw-r--r-- | Userland/pape.cpp | 2 | ||||
-rw-r--r-- | Userland/pidof.cpp | 2 | ||||
-rw-r--r-- | Userland/rm.cpp | 2 | ||||
-rw-r--r-- | Userland/shutdown.cpp | 2 | ||||
-rw-r--r-- | Userland/sysctl.cpp | 3 | ||||
-rw-r--r-- | Userland/tail.cpp | 2 | ||||
-rw-r--r-- | Userland/wc.cpp | 8 |
13 files changed, 22 insertions, 19 deletions
diff --git a/LibCore/CArgsParser.cpp b/LibCore/CArgsParser.cpp index 55dc350791..12ce7c90b4 100644 --- a/LibCore/CArgsParser.cpp +++ b/LibCore/CArgsParser.cpp @@ -39,7 +39,7 @@ CArgsParser::CArgsParser(const String& program_name) { } -CArgsParserResult CArgsParser::parse(const int argc, const char** argv) +CArgsParserResult CArgsParser::parse(int argc, char** argv) { CArgsParserResult res; @@ -57,7 +57,7 @@ CArgsParserResult CArgsParser::parse(const int argc, const char** argv) return res; } -int CArgsParser::parse_next_param(const int index, const char** argv, const int params_left, CArgsParserResult& res) +int CArgsParser::parse_next_param(int index, char** argv, const int params_left, CArgsParserResult& res) { if (params_left == 0) return 0; diff --git a/LibCore/CArgsParser.h b/LibCore/CArgsParser.h index 4c50aa23a9..6a696054e2 100644 --- a/LibCore/CArgsParser.h +++ b/LibCore/CArgsParser.h @@ -30,7 +30,7 @@ class CArgsParser { public: CArgsParser(const String& program_name); - CArgsParserResult parse(const int argc, const char** argv); + CArgsParserResult parse(int argc, char** argv); void add_required_arg(const String& name, const String& description); void add_required_arg(const String& name, const String& value_name, const String& description); @@ -53,7 +53,7 @@ private: bool required; }; - int parse_next_param(const int index, const char** argv, const int params_left, CArgsParserResult& res); + int parse_next_param(int index, char** argv, const int params_left, CArgsParserResult& res); bool is_param_valid(const String& param_name); bool check_required_args(const CArgsParserResult& res); diff --git a/Servers/SystemServer/main.cpp b/Servers/SystemServer/main.cpp index 51b971412f..c413ec5cc0 100644 --- a/Servers/SystemServer/main.cpp +++ b/Servers/SystemServer/main.cpp @@ -34,7 +34,7 @@ void start_process(const char* prog, int prio) ASSERT(ret == 0); char* progv[256]; - progv[0] = (char*)prog; + progv[0] = const_cast<char*>(prog); progv[1] = nullptr; ret = execv(prog, progv); if (ret < 0) { diff --git a/Userland/al.cpp b/Userland/al.cpp index 96094d5d6c..3882e56e4d 100644 --- a/Userland/al.cpp +++ b/Userland/al.cpp @@ -1,11 +1,15 @@ +#include <AK/StdLibExtras.h> #include <signal.h> #include <stdio.h> #include <unistd.h> static volatile bool got_alarm = false; -int main(int c, char** v) +int main(int argc, char** argv) { + UNUSED_PARAM(argc); + UNUSED_PARAM(argv); + unsigned ret = alarm(5); printf("alarm() with no alarm set: %u\n", ret); ret = alarm(2); diff --git a/Userland/head.cpp b/Userland/head.cpp index 5a59603f48..fe41ce3a6e 100644 --- a/Userland/head.cpp +++ b/Userland/head.cpp @@ -16,7 +16,7 @@ int main(int argc, char** argv) args_parser.add_arg("q", "Never print filenames"); args_parser.add_arg("v", "Always print filenames"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); int line_count = 0; if (args.is_present("n")) { diff --git a/Userland/ln.cpp b/Userland/ln.cpp index 54cf0d40d5..f15d2aae2f 100644 --- a/Userland/ln.cpp +++ b/Userland/ln.cpp @@ -12,7 +12,7 @@ int main(int argc, char** argv) args_parser.add_required_single_value("target"); args_parser.add_required_single_value("link-path"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); Vector<String> values = args.get_single_values(); if (values.size() == 0) { args_parser.print_usage(); diff --git a/Userland/pape.cpp b/Userland/pape.cpp index b77584165d..817668244c 100644 --- a/Userland/pape.cpp +++ b/Userland/pape.cpp @@ -58,7 +58,7 @@ int main(int argc, char** argv) args_parser.add_arg("c", "show current wallpaper"); args_parser.add_single_value("name"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); if (args.is_present("a")) return handle_show_all(); diff --git a/Userland/pidof.cpp b/Userland/pidof.cpp index ea2cb4c57a..a115d9deb1 100644 --- a/Userland/pidof.cpp +++ b/Userland/pidof.cpp @@ -39,7 +39,7 @@ int main(int argc, char** argv) args_parser.add_arg("s", "Single shot - this instructs the program to only return one pid"); args_parser.add_arg("o", "pid", "Tells pidof to omit processes with that pid. The special pid %PPID can be used to name the parent process of the pidof program."); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); bool s_arg = args.is_present("s"); bool o_arg = args.is_present("o"); diff --git a/Userland/rm.cpp b/Userland/rm.cpp index 2c62f4d628..17ee2ca956 100644 --- a/Userland/rm.cpp +++ b/Userland/rm.cpp @@ -58,7 +58,7 @@ int main(int argc, char** argv) args_parser.add_arg("r", "Delete directory recursively."); args_parser.add_required_single_value("path"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); Vector<String> values = args.get_single_values(); if (values.size() == 0) { args_parser.print_usage(); diff --git a/Userland/shutdown.cpp b/Userland/shutdown.cpp index 7884f12c15..cd2ffe67c1 100644 --- a/Userland/shutdown.cpp +++ b/Userland/shutdown.cpp @@ -5,7 +5,7 @@ int main(int argc, char** argv) { CArgsParser args_parser("shutdown"); args_parser.add_arg("n", "shut down now"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); if (args.is_present("n")) { syscall(SC_halt); diff --git a/Userland/sysctl.cpp b/Userland/sysctl.cpp index 29e8c7f768..86f75119ea 100644 --- a/Userland/sysctl.cpp +++ b/Userland/sysctl.cpp @@ -56,7 +56,6 @@ static int handle_show_all() return 1; } - char pathbuf[PATH_MAX]; while (di.has_next()) { String variable_name = di.next_path(); printf("%s = %s\n", variable_name.characters(), read_var(variable_name).characters()); @@ -89,7 +88,7 @@ int main(int argc, char** argv) args_parser.add_arg("a", "show all variables"); args_parser.add_single_value("variable=[value]"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); if (args.is_present("a")) { return handle_show_all(); diff --git a/Userland/tail.cpp b/Userland/tail.cpp index 0da99fa910..be474837e4 100644 --- a/Userland/tail.cpp +++ b/Userland/tail.cpp @@ -82,7 +82,7 @@ int main(int argc, char* argv[]) args_parser.add_arg("n", "lines", "fetch the specified number of lines"); args_parser.add_required_single_value("file"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, argv); Vector<String> values = args.get_single_values(); if (values.size() != 1) { diff --git a/Userland/wc.cpp b/Userland/wc.cpp index f9f77f5a7e..c518a0936d 100644 --- a/Userland/wc.cpp +++ b/Userland/wc.cpp @@ -5,9 +5,9 @@ #include <ctype.h> #include <stdio.h> -bool output_chars = false; -bool output_words = false; -bool output_lines = false; +static bool output_chars = false; +static bool output_words = false; +static bool output_lines = false; struct Count { String file; @@ -74,7 +74,7 @@ int main(int argc, char** argv) args_parser.add_arg("c", "Include bytes in count"); args_parser.add_arg("m", "Include chars in count"); args_parser.add_arg("w", "Include words in count"); - CArgsParserResult args = args_parser.parse(argc, (const char**)argv); + CArgsParserResult args = args_parser.parse(argc, (char**)argv); if (args.is_present("l")) { output_lines = true; |