shithub: orca

Download patch

ref: dd160f7bd779b68f0954bb8c7e93be1eb445c1d9
parent: 3c8d89929683d07dbee7b310171f12a0e49c58a1
author: cancel <cancel@cancel.fm>
date: Sun Nov 25 06:15:21 EST 2018

Change to only link ncurses in tui

--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,11 @@
 sanitize_flags := -fsanitize=address -fsanitize=undefined
 # note: -fsanitize=leak not available on at least Mac 10.12
 release_flags := -DNDEBUG -O2 -s -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fpie -Wl,-pie
+cli_library_flags :=
 ifeq ($(shell uname -s), Darwin)
-library_flags := -lncurses
+tui_library_flags := -lncurses
 else
-library_flags := -lncursesw
+tui_library_flags := -lncursesw
 endif
 common_source_files := field.c sim.c
 tui_source_files := $(common_source_files) tui_main.c
@@ -22,11 +23,11 @@
 
 .PHONY: debug_cli
 debug_cli: | build/debug
-	@cc $(basic_flags) $(debug_flags) $(sanitize_flags) $(cli_source_files) -o build/debug/orca $(library_flags)
+	@cc $(basic_flags) $(debug_flags) $(sanitize_flags) $(cli_source_files) -o build/debug/orca $(cli_library_flags)
 
 .PHONY: debug_tui
 debug_tui: | build/debug
-	@cc $(basic_flags) $(debug_flags) $(sanitize_flags) $(tui_source_files) -o build/debug/orca_tui $(library_flags)
+	@cc $(basic_flags) $(debug_flags) $(sanitize_flags) $(tui_source_files) -o build/debug/orca_tui $(tui_library_flags)
 
 .PHONY: debug
 debug: debug_cli
@@ -33,11 +34,11 @@
 
 .PHONY: release_cli
 release_cli: | build/release
-	@cc $(basic_flags) $(release_flags) $(cli_source_files) -o build/release/orca $(library_flags)
+	@cc $(basic_flags) $(release_flags) $(cli_source_files) -o build/release/orca $(cli_library_flags)
 
 .PHONY: release_tui
 release_tui: | build/release
-	@cc $(basic_flags) $(release_flags) $(tui_source_files) -o build/release/orca_tui $(library_flags)
+	@cc $(basic_flags) $(release_flags) $(tui_source_files) -o build/release/orca_tui $(tui_library_flags)
 
 .PHONY: release
 release: release_cli
--- a/tui_main.c
+++ b/tui_main.c
@@ -32,7 +32,7 @@
   // nodelay(stdscr, TRUE);
 
   Field field;
-  field_init_zeros(&field, 16, 16);
+  field_init_fill(&field, 16, 16, '.');
 
   printw("Type any character to fill it in an alternating grid, or\ntype '");
   attron(A_BOLD);