x13pixels / remedybg-issues

Public repository for tracking issues (bugs and features) for the RemedyBG debugger
85 stars 0 forks source link

Comment highlighting bug when quotation marks are inside block comments #306

Closed ebeachly closed 6 months ago

ebeachly commented 6 months ago

I noticed that the following code snippet reveals a bug with the comment highlighting feature in RemedyBG.

                {
                    /* Table E-1 - Sub-band gains */
                    /* BUG_WEIRD_TWO_INVK (look for this identifier in dwt.c): */
                    /* the test (!isEncoder && l_tccp->qmfbid == 0) is strongly */
                    /* linked to the use of two_invK instead of invK */
                    const OPJ_INT32 log2_gain = (!isEncoder &&
                                                 l_tccp->qmfbid == 0) ? 0 : (l_band->bandno == 0) ? 0 :
                                                (l_band->bandno == 3) ? 2 : 1;

                    /* Nominal dynamic range. Equation E-4 */
                    const OPJ_INT32 Rb = (OPJ_INT32)l_image_comp->prec + log2_gain;

                    /* Delta_b value of Equation E-3 in "E.1 Inverse quantization
                    * procedure" of the standard */
                    l_band->stepsize = (OPJ_FLOAT32)(((1.0 + l_step_size->mant / 2048.0) * pow(2.0,
                                                      (OPJ_INT32)(Rb - l_step_size->expn))));
                }

                /* Mb value of Equation E-2 in "E.1 Inverse quantization
                 * procedure" of the standard */
                l_band->numbps = l_step_size->expn + (OPJ_INT32)l_tccp->numgbits -
                                 1;

This is what it looks like in RemedyBG 0.4.0.2 with comment highlighting: image

Lines 15,16,17, 21, and 22 are incorrectly shaded as comments. The bug has something to do with the the quotation marks in the comments on lines 14 and 20, as deleting them fixes the issue.

x13pixels commented 6 months ago

Will be fixed in 0.4.0.3. Thanks!