From: Christopher Faylor Date: Thu, 2 Oct 2003 14:13:10 +0000 (+0000) Subject: * resrc.c (define_icon): Fix storage of color attributes 'planes' and 'bit X-Git-Tag: cagney_bigcore-20040122-branchpoint~1353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b95f6b0c7ee0e107c6ff836573716187a73ffd8b;p=external%2Fbinutils.git * resrc.c (define_icon): Fix storage of color attributes 'planes' and 'bit count' in icon groups. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f7c8337..10c2b30 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2003-10-01 Martin Fuchs + + * resrc.c (define_icon): Fix storage of color attributes 'planes' and + 'bit count' in icon groups. + 2003-09-30 Chris Demetriou * NEWS: Add an indication of the cutoff for 2.14. diff --git a/binutils/resrc.c b/binutils/resrc.c index 2613b39..b8b69e6 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -1040,10 +1040,20 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, cg->height = icondirs[i].height; cg->colors = icondirs[i].colorcount; - cg->planes = 1; - cg->bits = 0; - while ((1 << cg->bits) < cg->colors) - ++cg->bits; + if (icondirs[i].u.icon.planes) + cg->planes = icondirs[i].u.icon.planes; + else + cg->planes = 1; + + if (icondirs[i].u.icon.bits) + cg->bits = icondirs[i].u.icon.bits; + else + { + cg->bits = 0; + + while ((1L << cg->bits) < cg->colors) + ++cg->bits; + } cg->bytes = icondirs[i].bytes; cg->index = first_icon + i + 1;