From 8dddf961b6b071eacc6758349264da6ba761d718 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 31 Jul 2016 14:07:29 -0300 Subject: [PATCH] sch2fig/: compile with -Wmissing-prototypes -Wmissing-declarations --- sch2fig/Makefile | 1 + sch2fig/cairo.c | 14 +++++++------- sch2fig/fig.c | 16 ++++++++-------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sch2fig/Makefile b/sch2fig/Makefile index 0101b08..f70a278 100644 --- a/sch2fig/Makefile +++ b/sch2fig/Makefile @@ -14,6 +14,7 @@ NAME = sch2fig OBJS = main.o sch.o lib.o style.o fig.o cairo.o gfx.o dwg.o text.o misc.o CFLAGS = -g -O -Wall -Wextra -Wno-unused-parameter -Wshadow \ + -Wmissing-prototypes -Wmissing-declarations \ `pkg-config --cflags cairo` LIBS = -lm `pkg-config --libs cairo` diff --git a/sch2fig/cairo.c b/sch2fig/cairo.c index d3d9227..898f5b8 100644 --- a/sch2fig/cairo.c +++ b/sch2fig/cairo.c @@ -102,7 +102,7 @@ static void paint(cairo_t *cr, int color, int fill_color) /* ----- General items ----------------------------------------------------- */ -void cr_poly(void *ctx, int points, int x[points], int y[points], +static void cr_poly(void *ctx, int points, int x[points], int y[points], int color, int fill_color, unsigned layer) { struct cairo_ctx *cc = ctx; @@ -125,7 +125,7 @@ void cr_poly(void *ctx, int points, int x[points], int y[points], } -void cr_circ(void *ctx, int x, int y, int r, +static void cr_circ(void *ctx, int x, int y, int r, int color, int fill_color, unsigned layer) { struct cairo_ctx *cc = ctx; @@ -136,7 +136,7 @@ void cr_circ(void *ctx, int x, int y, int r, } -void cr_arc(void *ctx, int x, int y, int r, int sa, int ea, +static void cr_arc(void *ctx, int x, int y, int r, int sa, int ea, int color, int fill_color, unsigned layer) { struct cairo_ctx *cc = ctx; @@ -151,7 +151,7 @@ void cr_arc(void *ctx, int x, int y, int r, int sa, int ea, #define TEXT_STRETCH 1.3 -void cr_text(void *ctx, int x, int y, const char *s, unsigned size, +static void cr_text(void *ctx, int x, int y, const char *s, unsigned size, enum text_align align, int rot, unsigned color, unsigned layer) { struct cairo_ctx *cc = ctx; @@ -186,7 +186,7 @@ void cr_text(void *ctx, int x, int y, const char *s, unsigned size, } -unsigned cr_text_width(void *ctx, const char *s, unsigned size) +static unsigned cr_text_width(void *ctx, const char *s, unsigned size) { struct cairo_ctx *cc = ctx; cairo_text_extents_t ext; @@ -200,7 +200,7 @@ unsigned cr_text_width(void *ctx, const char *s, unsigned size) /* ----- Initializatio and termination ------------------------------------- */ -void *cr_init(const char *template, int n_vars, const char **vars) +static void *cr_init(const char *template, int n_vars, const char **vars) { struct cairo_ctx *cc; @@ -219,7 +219,7 @@ void *cr_init(const char *template, int n_vars, const char **vars) } -void cr_end(void *ctx) +static void cr_end(void *ctx) { struct cairo_ctx *cc = ctx; diff --git a/sch2fig/fig.c b/sch2fig/fig.c index 30ef309..9a73891 100644 --- a/sch2fig/fig.c +++ b/sch2fig/fig.c @@ -52,7 +52,7 @@ static inline float pt(int x) /* ----- Schematics items -------------------------------------------------- */ -void fig_line(void *ctx, int sx, int sy, int ex, int ey, +static void fig_line(void *ctx, int sx, int sy, int ex, int ey, int color, unsigned layer) { // TypeStyle FillCol AreaFil Cap FwdAr @@ -67,7 +67,7 @@ void fig_line(void *ctx, int sx, int sy, int ex, int ey, /* ----- General items ----------------------------------------------------- */ -void fig_rect(void *ctx, int sx, int sy, int ex, int ey, +static void fig_rect(void *ctx, int sx, int sy, int ex, int ey, int color, int fill_color, unsigned layer) { // Type Thick Depth StyleV Rad @@ -82,7 +82,7 @@ void fig_rect(void *ctx, int sx, int sy, int ex, int ey, } -void fig_poly(void *ctx, int points, int x[points], int y[points], +static void fig_poly(void *ctx, int points, int x[points], int y[points], int color, int fill_color, unsigned layer) { int i; @@ -102,7 +102,7 @@ void fig_poly(void *ctx, int points, int x[points], int y[points], } -void fig_circ(void *ctx, int x, int y, int r, +static void fig_circ(void *ctx, int x, int y, int r, int color, int fill_color, unsigned layer) { // Type Thick Depth StyleV Cx Rx Sx Ex @@ -132,7 +132,7 @@ static int ay(int x, int y, int r, int angle) } -void fig_arc(void *ctx, int x, int y, int r, int sa, int ea, +static void fig_arc(void *ctx, int x, int y, int r, int sa, int ea, int color, int fill_color, unsigned layer) { int ma = (sa + ea) / 2; @@ -150,7 +150,7 @@ void fig_arc(void *ctx, int x, int y, int r, int sa, int ea, } -void fig_text(void *ctx, int x, int y, const char *s, unsigned size, +static void fig_text(void *ctx, int x, int y, const char *s, unsigned size, enum text_align align, int rot, unsigned color, unsigned layer) { // Type Depth FontSiz Height @@ -162,7 +162,7 @@ void fig_text(void *ctx, int x, int y, const char *s, unsigned size, } -unsigned fig_text_width(void *ctx, const char *s, unsigned size) +static unsigned fig_text_width(void *ctx, const char *s, unsigned size) { /* * Note that we stretch the text size, so the ratio is larger than @@ -214,7 +214,7 @@ static bool apply_vars(char *buf, int n_vars, const char **vars) } -void *fig_init(const char *template, int n_vars, const char **vars) +static void *fig_init(const char *template, int n_vars, const char **vars) { FILE *file; char buf[1000];