summaryrefslogtreecommitdiffstats
path: root/src/port.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-15 18:20:22 +0100
committerDavid Robillard <d@drobilla.net>2020-12-15 19:32:03 +0100
commit7c84fcb0e6bcddc043b7b92dd9d854167844948f (patch)
treeac20067a6ea88d37393e1180456dd877689ab0e9 /src/port.c
parente33f4f6a197eb3cae29dd42ea728f5f782a29897 (diff)
downloadganv-7c84fcb0e6bcddc043b7b92dd9d854167844948f.tar.gz
ganv-7c84fcb0e6bcddc043b7b92dd9d854167844948f.tar.bz2
ganv-7c84fcb0e6bcddc043b7b92dd9d854167844948f.zip
Initialize all variables
Diffstat (limited to 'src/port.c')
-rw-r--r--src/port.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/port.c b/src/port.c
index dcd3ac3..212b787 100644
--- a/src/port.c
+++ b/src/port.c
@@ -699,7 +699,7 @@ ganv_port_get_natural_width(const GanvPort* port)
if (ganv_canvas_get_direction(canvas) == GANV_DIRECTION_DOWN) {
w = ganv_module_get_empty_port_breadth(ganv_port_get_module(port));
} else if (label && (GANV_ITEM(label)->object.flags & GANV_ITEM_VISIBLE)) {
- double label_w;
+ double label_w = 0.0;
g_object_get(port->box.node.impl->label, "width", &label_w, NULL);
w = label_w + (PORT_LABEL_HPAD * 2.0);
} else {
@@ -708,7 +708,7 @@ ganv_port_get_natural_width(const GanvPort* port)
if (port->impl->value_label &&
(GANV_ITEM(port->impl->value_label)->object.flags
& GANV_ITEM_VISIBLE)) {
- double label_w;
+ double label_w = 0.0;
g_object_get(port->impl->value_label, "width", &label_w, NULL);
w += label_w + PORT_LABEL_HPAD;
}