r5382 - trunk/eda/fped
werner at docs.openmoko.org
werner at docs.openmoko.org
Tue Aug 4 09:04:37 CEST 2009
Author: werner
Date: 2009-08-04 09:04:36 +0200 (Tue, 04 Aug 2009)
New Revision: 5382
Modified:
trunk/eda/fped/expr.c
trunk/eda/fped/gui.c
trunk/eda/fped/inst.c
trunk/eda/fped/util.c
Log:
Valgrind and gcc -O:
- stralloc_vprintf: used snprintf instead of vsnprintf. Oops !
- build_frames: didn't initialize "n"
- added a few initializations to stop gcc from complaining
Modified: trunk/eda/fped/expr.c
===================================================================
--- trunk/eda/fped/expr.c 2009-08-04 00:23:10 UTC (rev 5381)
+++ trunk/eda/fped/expr.c 2009-08-04 07:04:36 UTC (rev 5382)
@@ -182,6 +182,7 @@
}
res.type = a->type;
res.exponent = a->exponent;
+ res.n = 0; /* keep gcc happy */
return res;
}
@@ -203,6 +204,7 @@
}
res.type = a->type;
res.exponent = exponent;
+ res.n = 0; /* keep gcc happy */
return res;
}
Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c 2009-08-04 00:23:10 UTC (rev 5381)
+++ trunk/eda/fped/gui.c 2009-08-04 07:04:36 UTC (rev 5382)
@@ -576,7 +576,7 @@
{
struct frame *frame;
GtkWidget *tab, *label, *refs, *vars;
- int n;
+ int n = 0;
destroy_all_children(GTK_CONTAINER(vbox));
for (frame = frames; frame; frame = frame->next)
Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c 2009-08-04 00:23:10 UTC (rev 5381)
+++ trunk/eda/fped/inst.c 2009-08-04 07:04:36 UTC (rev 5382)
@@ -126,7 +126,8 @@
{
enum inst_prio prio;
struct inst *inst;
- int best_dist, dist;
+ int best_dist = 0; /* keep gcc happy */
+ int dist;
deselect_outside();
edit_nothing();
Modified: trunk/eda/fped/util.c
===================================================================
--- trunk/eda/fped/util.c 2009-08-04 00:23:10 UTC (rev 5381)
+++ trunk/eda/fped/util.c 2009-08-04 07:04:36 UTC (rev 5382)
@@ -29,7 +29,7 @@
int n;
va_copy(aq, ap);
- n = snprintf(NULL, 0, fmt, aq);
+ n = vsnprintf(NULL, 0, fmt, aq);
va_end(aq);
buf = alloc_size(n+1);
vsnprintf(buf, n+1, fmt, ap);
More information about the commitlog
mailing list