mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
Fix all current build warnings in the userland.
This commit is contained in:
parent
e9cdb6bb9b
commit
3e0a0dd7ed
12 changed files with 42 additions and 25 deletions
|
@ -1,8 +1,10 @@
|
||||||
#include <LibC/time.h>
|
#include <LibC/time.h>
|
||||||
#include <LibC/stdio.h>
|
#include <LibC/stdio.h>
|
||||||
|
|
||||||
int main(int c, char** v)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
time_t now = time(nullptr);
|
time_t now = time(nullptr);
|
||||||
printf("%u\n", now);
|
printf("%u\n", now);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
printf("Testing fork()...\n");
|
printf("Testing fork()...\n");
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
printf("Testing fork()...\n");
|
printf("Testing fork()...\n");
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#include <LibC/unistd.h>
|
#include <unistd.h>
|
||||||
#include <LibC/stdio.h>
|
#include <stdio.h>
|
||||||
#include <LibC/errno.h>
|
#include <errno.h>
|
||||||
#include <LibC/string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int main(int c, char** v)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
char buffer[HOST_NAME_MAX];
|
char buffer[HOST_NAME_MAX];
|
||||||
int rc = gethostname(buffer, sizeof(buffer));
|
int rc = gethostname(buffer, sizeof(buffer));
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
|
|
||||||
int main(int c, char** v)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
uid_t uid = getuid();
|
uid_t uid = getuid();
|
||||||
gid_t gid = getgid();
|
gid_t gid = getgid();
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
#include <LibC/errno.h>
|
#include <LibC/errno.h>
|
||||||
#include <LibC/string.h>
|
#include <LibC/string.h>
|
||||||
|
|
||||||
int main(int c, char** v)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
bool colorize = true;
|
bool colorize = true;
|
||||||
|
|
||||||
DIR* dirp = opendir(".");
|
DIR* dirp = opendir(".");
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#include <LibC/stdio.h>
|
#include <LibC/stdio.h>
|
||||||
#include <LibC/unistd.h>
|
#include <LibC/unistd.h>
|
||||||
|
|
||||||
int main(int c, char** v)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
int fd = open("/proc/mm", O_RDONLY);
|
int fd = open("/proc/mm", O_RDONLY);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
perror("failed to open /proc/mm");
|
perror("failed to open /proc/mm");
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#include <LibC/stdio.h>
|
#include <LibC/stdio.h>
|
||||||
#include <LibC/unistd.h>
|
#include <LibC/unistd.h>
|
||||||
|
|
||||||
int main(int c, char** v)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
int fd = open("/proc/summary", O_RDONLY);
|
int fd = open("/proc/summary", O_RDONLY);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
perror("failed to open /proc/summary");
|
perror("failed to open /proc/summary");
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include <LibC/stdio.h>
|
#include <stdio.h>
|
||||||
#include <LibC/unistd.h>
|
#include <unistd.h>
|
||||||
#include <LibC/process.h>
|
#include <process.h>
|
||||||
#include <LibC/errno.h>
|
#include <errno.h>
|
||||||
#include <LibC/string.h>
|
#include <string.h>
|
||||||
#include <LibC/stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <LibC/utsname.h>
|
#include <utsname.h>
|
||||||
#include <LibC/pwd.h>
|
#include <pwd.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <AK/FileSystemPath.h>
|
#include <AK/FileSystemPath.h>
|
||||||
|
@ -43,7 +43,7 @@ void did_receive_signal(int signum)
|
||||||
g_got_signal = true;
|
g_got_signal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_sigint(int signum)
|
void handle_sigint(int)
|
||||||
{
|
{
|
||||||
printf("Interrupt received by sh\n");
|
printf("Interrupt received by sh\n");
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ static int sh_wt(int, const char**)
|
||||||
{
|
{
|
||||||
const char* rodata_ptr = "foo";
|
const char* rodata_ptr = "foo";
|
||||||
printf("Writing to rodata=%p...\n", rodata_ptr);
|
printf("Writing to rodata=%p...\n", rodata_ptr);
|
||||||
*(char*)rodata_ptr = 0;
|
*const_cast<char*>(rodata_ptr) = 0;
|
||||||
|
|
||||||
char* text_ptr = (char*)sh_fef;
|
char* text_ptr = (char*)sh_fef;
|
||||||
printf("Writing to text=%p...\n", text_ptr);
|
printf("Writing to text=%p...\n", text_ptr);
|
||||||
|
@ -141,7 +141,6 @@ close_it:
|
||||||
|
|
||||||
static int sh_mp(int, const char**)
|
static int sh_mp(int, const char**)
|
||||||
{
|
{
|
||||||
int rc;
|
|
||||||
int fd = open("/kernel.map", O_RDONLY);
|
int fd = open("/kernel.map", O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
perror("open(/kernel.map)");
|
perror("open(/kernel.map)");
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
printf("Counting to 100000: \033[s");
|
printf("Counting to 100000: \033[s");
|
||||||
for (unsigned i = 0; i <= 100000; ++i) {
|
for (unsigned i = 0; i <= 100000; ++i) {
|
||||||
printf("\033[u\033[s%u", i);
|
printf("\033[u\033[s%u", i);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <LibC/stdio.h>
|
#include <stdio.h>
|
||||||
#include <LibC/unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <LibC/utsname.h>
|
#include <utsname.h>
|
||||||
#include <LibC/stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue