summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--solver.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1e63a53..fd5de3e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -Wall -W -Wextra -std=c99 -g
+CFLAGS = -Wall -W -Wextra -std=c99 -O3
NAME = solver
$(NAME): .solver.o .main.o
diff --git a/solver.c b/solver.c
index c0da05f..334848e 100644
--- a/solver.c
+++ b/solver.c
@@ -3,6 +3,7 @@
#include <malloc.h>
#include <limits.h>
#include <stdint.h>
+#include <assert.h>
#include "solver.h"
#define _log(...) fprintf(stderr, __VA_ARGS__)
@@ -39,6 +40,7 @@ static void display_solution(void)
{
puts("--------------------------");
puts("found a (better) solution:");
+
for (int i = 5; i >= solution_g.level; i--) {
char op;
int _result;
@@ -60,6 +62,9 @@ static void display_solution(void)
op = '/';
_result = solution_g.computation[i].v1 / solution_g.computation[i].v2;
break;
+ default:
+ assert (0);
+ break;
}
printf("%d %c %d = %d\n", solution_g.computation[i].v1