From a7c2076e2dca44b0220e5b85753c24477ecf51d6 Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 19 Apr 2012 03:35:29 +0000 Subject: [PATCH] small improvement - allow part names of "-" to mean "remove part name itd and reset back to -1 - ie none". useful for to/to_x/to_y etc. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@70315 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/edje_cc_out.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/bin/edje_cc_out.c b/src/bin/edje_cc_out.c index b4c541c..3fc148f 100644 --- a/src/bin/edje_cc_out.c +++ b/src/bin/edje_cc_out.c @@ -1707,24 +1707,31 @@ data_process_lookups(void) Edje_Part *ep; unsigned int i; - for (i = 0; i < part->pc->parts_count; ++i) - { - ep = part->pc->parts[i]; - - if ((ep->name) && (!strcmp(ep->name, part->name))) - { - handle_slave_lookup(part_slave_lookups, part->dest, ep->id); - *(part->dest) = ep->id; - break; - } - } + if (!strcmp(part->name, "-")) + { + *(part->dest) = -1; + } + else + { + for (i = 0; i < part->pc->parts_count; ++i) + { + ep = part->pc->parts[i]; + + if ((ep->name) && (!strcmp(ep->name, part->name))) + { + handle_slave_lookup(part_slave_lookups, part->dest, ep->id); + *(part->dest) = ep->id; + break; + } + } - if (i == part->pc->parts_count) - { - ERR("%s: Error. Unable to find part name \"%s\".", - progname, part->name); - exit(-1); - } + if (i == part->pc->parts_count) + { + ERR("%s: Error. Unable to find part name \"%s\".", + progname, part->name); + exit(-1); + } + } free(part->name); free(part); -- 2.7.4