Hi,
On 12/07/2011 07:22 PM, Werner Almesberger wrote:
+++ b/software/libfpvm/fnp.ids
@@ -0,0 +1,193 @@
+#
+# Per-Frame Variables
+#
+
+sx
+sy
+cx
+cy
hmm, I don't like the idea of introducing patch variables into the
libfpvm source.
Does this actually increase the overall compilation performance in a
noticeable way? If no, it should not be implemented. If yes, the
well_known table's content should be moved into FN.
+/* We don't have bsearch, so here's our own version. */
+
+static const char *search(const char *s)
(...)
+/* We don't have strdup either. */
+
+static char *my_strdup(const char *s)
> + /* There's no realloc, so we roll our own. */
> + allocate = allocated ? allocated*2 : INITIAL_ALLOC;
> + new = malloc(allocate*sizeof(*vars));
> + memcpy(new, vars, allocated*sizeof(*vars));
> + vars = new;
This should go into libbase, and be called bsearch/strdup/realloc.
Anyway, I thought this was supposed to run without the demo firmware?
RTEMS does provide strdup and realloc, and certainly bsearch as well.
This would also save you the pain of reinventing realloc :)
Since the rest is OK, maybe I can commit those patches and we address
these two issues with another changeset?
Thanks,
Sébastien
_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode