mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Fix warnings
This change fixes Cosmopolitan so it has fewer opinions about compiler warnings. The whole repository had to be cleaned up to be buildable in -Werror -Wall mode. This lets us benefit from things like strict const checking. Some actual bugs might have been caught too.
This commit is contained in:
parent
e2b3c3618e
commit
0d748ad58e
571 changed files with 1306 additions and 1888 deletions
|
@ -136,7 +136,7 @@ static struct Semaphore *sem_open_reopen(const char *path) {
|
|||
|
||||
static struct Semaphore *sem_open_get(const sem_t *sem,
|
||||
struct Semaphore ***out_prev) {
|
||||
struct Semaphore *s, *t, **p;
|
||||
struct Semaphore *s, **p;
|
||||
for (p = &g_semaphores.list, s = *p; s; p = &s->next, s = s->next) {
|
||||
if (s && sem == s->sem) {
|
||||
*out_prev = p;
|
||||
|
@ -176,9 +176,10 @@ static struct Semaphore *sem_open_get(const sem_t *sem,
|
|||
sem_t *sem_open(const char *name, int oflag, ...) {
|
||||
sem_t *sem;
|
||||
va_list va;
|
||||
const char *path;
|
||||
struct Semaphore *s;
|
||||
char pathbuf[PATH_MAX];
|
||||
unsigned mode = 0, value = 0;
|
||||
char *path, pathbuf[PATH_MAX];
|
||||
if (oflag & ~(O_CREAT | O_EXCL)) {
|
||||
einval();
|
||||
return SEM_FAILED;
|
||||
|
@ -300,9 +301,10 @@ int sem_close(sem_t *sem) {
|
|||
* @raise ENAMETOOLONG if too long
|
||||
*/
|
||||
int sem_unlink(const char *name) {
|
||||
const char *path;
|
||||
int rc, e = errno;
|
||||
struct Semaphore *s;
|
||||
char *path, pathbuf[PATH_MAX];
|
||||
char pathbuf[PATH_MAX];
|
||||
if (!(path = sem_path_np(name, pathbuf, sizeof(pathbuf)))) return -1;
|
||||
if ((rc = unlink(path)) == -1 && IsWindows() && errno == EACCES) {
|
||||
sem_open_init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue