summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2020-12-24 08:41:54 -0700
committerAndreas Kling <kling@serenityos.org>2020-12-26 10:10:27 +0100
commitb2316701a82561cf4bcd617fe69ea7aa9b80a80a (patch)
treea8dd7a858892c8cd81328b472d2fbb1dbf0b49dc /Libraries/LibC
parentb990fc5d3af2d48138aa2d6b6ed00a8cc78fe7a3 (diff)
downloadserenity-b2316701a82561cf4bcd617fe69ea7aa9b80a80a.zip
Everywhere: void arguments to C functions
Problem: - C functions with no arguments require a single `void` in the argument list. Solution: - Put the `void` in the argument list of functions in C header files.
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/stdlib.cpp2
-rw-r--r--Libraries/LibC/stdlib.h6
-rw-r--r--Libraries/LibC/syslog.cpp2
-rw-r--r--Libraries/LibC/syslog.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp
index edaa1e5ee5..07f7199bcf 100644
--- a/Libraries/LibC/stdlib.cpp
+++ b/Libraries/LibC/stdlib.cpp
@@ -1021,7 +1021,7 @@ unsigned long long strtoull(const char* str, char** endptr, int base)
// Serenity's PRNG is not cryptographically secure. Do not rely on this for
// any real crypto! These functions (for now) are for compatibility.
// TODO: In the future, rand can be made deterministic and this not.
-uint32_t arc4random()
+uint32_t arc4random(void)
{
char buf[4];
syscall(SC_getrandom, buf, 4, 0);
diff --git a/Libraries/LibC/stdlib.h b/Libraries/LibC/stdlib.h
index 2c225809d2..735e62e36a 100644
--- a/Libraries/LibC/stdlib.h
+++ b/Libraries/LibC/stdlib.h
@@ -41,13 +41,13 @@ __BEGIN_DECLS
__attribute__((malloc)) __attribute__((alloc_size(1))) void* malloc(size_t);
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nmemb, size_t);
size_t malloc_size(void*);
-void serenity_dump_malloc_stats();
+void serenity_dump_malloc_stats(void);
void free(void*);
__attribute__((alloc_size(2))) void* realloc(void* ptr, size_t);
char* getenv(const char* name);
int putenv(char*);
int unsetenv(const char*);
-int clearenv();
+int clearenv(void);
int setenv(const char* name, const char* value, int overwrite);
int atoi(const char*);
long atol(const char*);
@@ -87,7 +87,7 @@ void srand(unsigned seed);
long int random();
void srandom(unsigned seed);
-uint32_t arc4random();
+uint32_t arc4random(void);
void arc4random_buf(void*, size_t);
uint32_t arc4random_uniform(uint32_t);
diff --git a/Libraries/LibC/syslog.cpp b/Libraries/LibC/syslog.cpp
index 8dca066f2e..650347da96 100644
--- a/Libraries/LibC/syslog.cpp
+++ b/Libraries/LibC/syslog.cpp
@@ -94,7 +94,7 @@ void closelog_r(struct syslog_data* data)
data->maskpri = LOG_UPTO(LOG_DEBUG);
}
-void closelog()
+void closelog(void)
{
closelog_r(&global_log_data);
}
diff --git a/Libraries/LibC/syslog.h b/Libraries/LibC/syslog.h
index 2eeb4b569d..9066590faa 100644
--- a/Libraries/LibC/syslog.h
+++ b/Libraries/LibC/syslog.h
@@ -169,7 +169,7 @@ void vsyslog(int, const char* message, va_list);
void vsyslog_r(int, struct syslog_data* data, const char* message, va_list);
void openlog(const char*, int, int);
void openlog_r(const char*, int, int, struct syslog_data*);
-void closelog();
+void closelog(void);
void closelog_r(struct syslog_data*);
int setlogmask(int);
int setlogmask_r(int, struct syslog_data*);