forked from amberisvibin/bbs
standardize on c99
This commit is contained in:
5
Makefile
5
Makefile
@@ -1,11 +1,12 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-lncursesw
|
CFLAGS=-std=c99 -pedantic -Wall -Wextra
|
||||||
|
LIBS=-lncursesw
|
||||||
EXECUTABLE=bbs
|
EXECUTABLE=bbs
|
||||||
|
|
||||||
all: make
|
all: make
|
||||||
|
|
||||||
make:
|
make:
|
||||||
$(CC) $(CFLAGS) bbs.c -o $(EXECUTABLE)
|
$(CC) $(CFLAGS) $(LIBS) bbs.c -o $(EXECUTABLE)
|
||||||
|
|
||||||
run:
|
run:
|
||||||
./$(EXECUTABLE)
|
./$(EXECUTABLE)
|
||||||
|
@@ -6,6 +6,8 @@ This is a simple bbs program written in c. The way it is meant to work is that a
|
|||||||
|
|
||||||
The only dependency is `ncurses`. The makefile asks for `-lncursesw` but unicode is not yet used, so `-lncurses` should be fine. `ncurses` is almost guaranteed preinstalled on your system.
|
The only dependency is `ncurses`. The makefile asks for `-lncursesw` but unicode is not yet used, so `-lncurses` should be fine. `ncurses` is almost guaranteed preinstalled on your system.
|
||||||
|
|
||||||
|
The program is standardized on c99. It should run fine on c89, but there will be warnings. You'll have to edit the makefile to request c89 from `gcc`.
|
||||||
|
|
||||||
To build, run `make`. It will drop an executable named `bbs` in the current folder.
|
To build, run `make`. It will drop an executable named `bbs` in the current folder.
|
||||||
|
|
||||||
The makefile has the additional command `make run`, which just launches the program after compilation.
|
The makefile has the additional command `make run`, which just launches the program after compilation.
|
||||||
|
4
bbs.c
4
bbs.c
@@ -46,7 +46,7 @@ void draw_screen (struct Screen *screen) {
|
|||||||
box(screen->win, 0, 0);
|
box(screen->win, 0, 0);
|
||||||
|
|
||||||
mvwprintw(screen->win, 0, 1, " %s ", screen->name);
|
mvwprintw(screen->win, 0, 1, " %s ", screen->name);
|
||||||
};
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ int main() {
|
|||||||
|
|
||||||
getmaxyx(stdscr, terminal_height, terminal_width);
|
getmaxyx(stdscr, terminal_height, terminal_width);
|
||||||
|
|
||||||
int screen_before_error = HOME;
|
unsigned int screen_before_error = HOME;
|
||||||
|
|
||||||
enum ActiveScreen active_screen = HOME;
|
enum ActiveScreen active_screen = HOME;
|
||||||
struct Screen home = {
|
struct Screen home = {
|
||||||
|
Reference in New Issue
Block a user