Removes all the warnings

This commit is contained in:
Emil 2023-08-02 09:48:30 -06:00
parent d818dbf3c0
commit 1cbff62e48
5 changed files with 39 additions and 95 deletions

View File

@ -1,46 +0,0 @@
.POSIX: # Just kidding, use GNU Make
# OVERRIDE ME #
PREFIX := .
PROGN := probotic
CC := cc
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
CPPFLAGS := -I/usr/bin/ircclient/ -Iinclude
LDFLAGS := -lircclient
SRC.DIR := src
OBJ.DIR := $(PREFIX)/obj
INC.DIR := include
OBJ := $(addprefix $(OBJ.DIR)/,fetch.o main.o parse.o)
HDR := config.h utils.h parse.h
VPATH := $(INC.DIR) $(SRC.DIR) $(OBJ.DIR)
ifeq ($(DEBUG),1)
CFLAGS += -Og -g3
else
CFLAGS += -O3 -flto=auto -fomit-frame-pointer
endif
ifdef SAN
CFLAGS += -fsanitize=$(SAN)
endif
CPPFLAGS += -DPROGN="\"$(PROGN)\""
$(OBJ.DIR)/%.o: $(SRC.DIR)/%.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(PREFIX)/$(PROGN): $(VPATH) $(PREFIX) $(HDR) | $(OBJ)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $| $(LDFLAGS)
include/config.h: include/config.mk.h
cp -f $< $@
$(VPATH) $(PREFIX):
mkdir -p $@
clean:
$(RM) $(OBJ) $(PROGN)

View File

@ -1,44 +0,0 @@
# OVERRIDE ME #
PROGN := probotic
CC := cc
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
CPPFLAGS := -I/usr/bin/ircclient/ -Iinclude
LDFLAGS := -lircclient
SRC.DIR := src
OBJ.DIR := obj
INC.DIR := include
SRC := fetch.c main.c parse.c
OBJ := fetch.o main.o parse.o
HDR := config.h utils.h parse.h
VPATH := ${INC.DIR}:${SRC.DIR}:${OBJ.DIR}
.if "${DEBUG}" == "1"
CFLAGS := ${CFLAGS} -Og -g3
.else
CFLAGS := ${CFLAGS} -O3 -flto=auto -fomit-frame-pointer
.endif
.ifdef SAN
CFLAGS := ${CFLAGS} -fsanitize=${SAN}
.endif
CPPFLAGS := ${CPPFLAGS} -DPROGN="\"${PROGN}\""
.c.o:
${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
${PROGN}: ${OBJ.DIR} ${HDR} ${OBJ}
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ ${OBJ} ${LDFLAGS}
include/config.h: include/config.mk.h
cp -f $< $@
${OBJ.DIR}:
mkdir -p $@
clean:
${RM} ${OBJ} ${PROGN}

View File

@ -8,8 +8,8 @@ PROGN=${PROGN:-probotic}
PREFIX=${PREFIX:-$DIR}
CC=${CC-cc}
CFLAGS='-std=c99 -Wall -Wextra -Wpedantic'
CPPFLAGS='-I/usr/bin/ircclient/ -Iinclude'
CFLAGS='-std=c99 -Wall -Wextra -Wpedantic -Wno-unused-parameter'
CPPFLAGS="-I/usr/bin/ircclient/ -Iinclude -D_GNU_SOURCE -DPROGN=\"$PROGN\""
LDFLAGS='-lircclient'
mkdir -p $PREFIX && echo "Made directory: $PREFIX"

View File

@ -1,7 +1,5 @@
/* @COMPILECMD ../unity.sh */
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
@ -64,6 +62,8 @@ event_channel(irc_session_t * session,
{
const char * channel = params[0];
const char * message = params[1];
(void) channel;
(void) message;
char * swp = get_username(origin);
msg_wrapper("%s, you are a faggot for this opinion.", swp);

View File

@ -1,12 +1,46 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "creds_parser.h"
#include "parse.h"
#include "utils.h"
/* possibly globalize creds so that we can ensure by using
atexit that it is always cleansed? */
/* these are closer described as 'setters', no? */
int parse_remind(char const * arg)
{
(void) arg;
ERRMSG("not implemented");
return 0;
}
int parse_repo(char const * arg)
{
(void) arg;
ERRMSG("not implemented");
return 0;
}
int
parse_command(char const * command,
const char * arg /* NULLABLE */)
{
/* I know. */
#define COMMAND(cmd,fn) if (strcmp(command,cmd) == 0) { return fn(arg); } else
COMMAND("remind", parse_remind)
COMMAND("repo", parse_repo)
/* COMMAND("raw", sql_execute?) */
/* COMMAND("post", parse_post) */
/* COMMAND("prune", parse_prune) */
/* COMMAND("search", parse_search) */
/* COMMAND("list", parse_list) */
{ ERR(1,"No such command.\n"); }
#undef COMMAND
}
int
parse_creds(creds_t * creds,
char const * creds_file)