From d465acbeb5411397ddd64784b0d980735869a7b2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 1 Nov 2010 16:56:09 -0300 Subject: [PATCH] Enable more compiler warnings. Some cleanup. - cameo/Makefile (CFLAGS): added more warning flags - cameo/path.h (path_direction): removed unused prototype - cameo/path.c (angle): renamed to angle_3 to keep it from getting shadowed by local variable --- cameo/Makefile | 4 +++- cameo/path.c | 4 ++-- cameo/path.h | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cameo/Makefile b/cameo/Makefile index 8c67df6..1fff67f 100644 --- a/cameo/Makefile +++ b/cameo/Makefile @@ -17,7 +17,9 @@ SHELL=/bin/bash MAIN=cameo OBJS=cameo.o gnuplot.o path.o -CFLAGS=-Wall -g +CFLAGS_WARN=-Wall -Wshadow -Wmissing-prototypes \ + -Wmissing-declarations -Wno-format-zero-length +CFLAGS=$(CFLAGS_WARN) -g LDFLAGS=-lm # ----- Verbosity control ----------------------------------------------------- diff --git a/cameo/path.c b/cameo/path.c index 65d5294..e9719f0 100644 --- a/cameo/path.c +++ b/cameo/path.c @@ -162,7 +162,7 @@ static int left_turn(const struct point *a, const struct point *b, * in order to face towards C. */ -static double angle(const struct point *a, const struct point *b, +static double angle_3(const struct point *a, const struct point *b, const struct point *c) { double ax, ay, bx, by; @@ -197,7 +197,7 @@ int path_tool_is_left(const struct path *path) prev = path->first; for (p = path->first->next; p; p = p->next) { next = p->next ? p->next : path->first->next; - a += angle(prev, p, next); + a += angle_3(prev, p, next); prev = p; } return a < 0; diff --git a/cameo/path.h b/cameo/path.h index 6458c37..6853590 100644 --- a/cameo/path.h +++ b/cameo/path.h @@ -30,7 +30,6 @@ struct path { struct path *path_new(double r_tool); void path_add(struct path *path, double x, double y, double z); struct path *path_reverse(const struct path *path); -int path_direction(const struct path *path); int path_tool_is_left(const struct path *path); struct path *path_offset(const struct path *path, int left, int notch); void path_free(struct path *path);