move back to c99

This commit is contained in:
Murphy 2023-05-01 00:38:33 -04:00
parent 317f7bf357
commit 5a0ec4ed37
15 changed files with 8 additions and 40 deletions

View file

@ -2,7 +2,7 @@ CC = gcc
INCFLAGS = -Isrc INCFLAGS = -Isrc
CCFLAGS = -std=gnu99 -Wall -Wextra -pedantic -O2 CCFLAGS = -std=c99 -Wall -Wextra -pedantic -O2 -D_DEFAULT_SOURCE
CCFLAGS += $(INCFLAGS) CCFLAGS += $(INCFLAGS)
LDFLAGS += $(INCFLAGS) LDFLAGS += $(INCFLAGS)

View file

@ -3,6 +3,13 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#define ARGUMENTS int argc, char** argv #define ARGUMENTS int argc, char** argv
#define NEXT_ARGS argc - 1, &argv[1] #define NEXT_ARGS argc - 1, &argv[1]

View file

@ -1,10 +1,6 @@
#include "../command.h" #include "../command.h"
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
struct Flags { struct Flags {
bool number_lines; bool number_lines;

View file

@ -1,5 +1,4 @@
#include "../command.h" #include "../command.h"
#include <stdio.h>
static void help() { static void help() {
printf("Usage: dd [if=FILE] [of=FILE] [bs=N] [count=N]\n\n"); printf("Usage: dd [if=FILE] [of=FILE] [bs=N] [count=N]\n\n");

View file

@ -1,8 +1,5 @@
#include "../command.h" #include "../command.h"
#include <stdio.h>
#include <string.h>
static void print_with_escape_codes(const char* str) { static void print_with_escape_codes(const char* str) {
size_t index = 0; size_t index = 0;

View file

@ -1,11 +1,6 @@
#include "../command.h" #include "../command.h"
#include "../util//regex.h" #include "../util//regex.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define INPUT_LEN 1024 #define INPUT_LEN 1024
static char** lines = NULL; static char** lines = NULL;

View file

@ -2,7 +2,6 @@
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <unistd.h>
COMMAND_EMPTY(groups) { COMMAND_EMPTY(groups) {

View file

@ -1,8 +1,5 @@
#include "../command.h" #include "../command.h"
#include <stdio.h>
#include <string.h>
struct Flags { struct Flags {
int count; int count;
bool lines; bool lines;

View file

@ -2,8 +2,6 @@
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <unistd.h>
#include <sys/types.h>
COMMAND_EMPTY(user_id) { COMMAND_EMPTY(user_id) {

View file

@ -1,13 +1,7 @@
#include "../command.h" #include "../command.h"
#include <errno.h>
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <dirent.h> #include <dirent.h>
#include <ftw.h> #include <ftw.h>
#include <limits.h> #include <limits.h>

View file

@ -1,5 +1,4 @@
#include "../command.h" #include "../command.h"
#include <stdlib.h>
static long cast_long(const char* arg) { static long cast_long(const char* arg) {
char* end; char* end;

View file

@ -1,11 +1,5 @@
#include "../command.h" #include "../command.h"
#include <stdio.h>
#include <string.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <unistd.h>
struct Flags { struct Flags {
bool lines; bool lines;
int count; int count;

View file

@ -1,9 +1,6 @@
#include "../command.h" #include "../command.h"
#include <signal.h> #include <signal.h>
#include <stdio.h>
#include <string.h>
static void help() { static void help() {
printf("Usage: tee [-ai] [FILE]...\n\n"); printf("Usage: tee [-ai] [FILE]...\n\n");

View file

@ -1,8 +1,6 @@
#include "../command.h" #include "../command.h"
#include <ctype.h> #include <ctype.h>
#include <stdio.h>
#include <string.h>
struct Flags { struct Flags {
bool newlines; bool newlines;

View file

@ -1,8 +1,6 @@
#include "../command.h" #include "../command.h"
#include <pwd.h> #include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
static void help() { static void help() {
printf("Usage: whoami\n\n"); printf("Usage: whoami\n\n");