lnvis

nanovg lightning network visualizer
git clone git://jb55.com/lnvis
Log | Files | Refs | README | LICENSE

commit e7b688dc1a55382cda36b5563bd07b72e179abc9
parent 273718ea1fae845129c51b61747dc1e6626471d7
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 17 Aug 2018 00:38:34 -0700

fix warnings

Diffstat:
MMakefile | 2+-
Mmain.c | 18------------------
Mrender.c | 10++--------
3 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,7 +3,7 @@ BIN = lnvis PREFIX ?= /usr/local CFLAGS = -Ideps -ggdb -O2 -Wall -Wextra -std=c99 -DJSMN_PARENT_LINKS -LDFLAGS = -lglfw -lGL +LDFLAGS = -lglfw -lGL -lm SRCS = main.c diff --git a/main.c b/main.c @@ -110,23 +110,6 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod } } -static void print_channel(struct channel *chan) -{ - printf("chan shortid=%u:%u:%hu public=%d sats=%"PRIu64" active=%d " - "last_update=%u base_fee_msat=%u fee_per_millionth=%u " - "delay=%u\n", - chan->short_channel_id.blocknum, - chan->short_channel_id.txnum, - chan->short_channel_id.outnum, - chan->public, - chan->satoshis, - chan->active, - chan->last_update_timestamp, - chan->base_fee_msat, - chan->fee_per_millionth, - chan->delay); -} - static struct node *find_node(const char *pubkey, struct node *nodes, int node_count) { // TODO: hash table @@ -163,7 +146,6 @@ void test_read_json(struct ln *ln) int channel_count = 0; int node_count = 0; - int i; struct channel *channels; struct node *nodes; diff --git a/render.c b/render.c @@ -43,12 +43,6 @@ void draw_channel(NVGcontext *vg, struct ln *ln, struct channel *channel) const float stroke = max(1.0, channel->satoshis * 0.000001f); /* const float stroke = (logf(channel->satoshis) / logf(10)) * 0.0f; */ - const float sx = n1->x; - const float sy = n1->y; - - const float ex = n2->x; - const float ey = n2->y; - union color n1t, n2t; n1t.nvg_color = n1->color.nvg_color; @@ -179,7 +173,7 @@ void draw_node(NVGcontext *vg, struct ln *ln, struct node *node) float bounds[4]; static const float pad = 2.0f; - nvgTextBounds(vg, 0, 0, node->alias, NULL, &bounds); + nvgTextBounds(vg, 0, 0, node->alias, NULL, &bounds[0]); NVGpaint bg; @@ -279,7 +273,7 @@ void render_ln(struct ln *ln) u32 i; NVGcontext *vg = ln->vg; - struct channel *draw_last = NULL, *c = NULL; + struct channel *c = NULL; if (ln->display_flags & DISP_GRID) draw_grid(vg, ln);