[rrd-developers] [rrd] RE: Optional change in graphbehavior:--full-size-mode patch

Matthew Chambers matthew.chambers at vanderbilt.edu
Tue May 29 21:50:20 CEST 2007


OK, I'm just going to do the full-size-mode stuff on the trunk for now until
Steve chimes in.  But some of this auto-indentation stuff is quite ghastly.
Look at these "before and after":

Before:
leg_x += 
                 gfx_get_text_width(im->canvas, leg_x,
                                      im->text_prop[TEXT_PROP_LEGEND].font,
                                      im->text_prop[TEXT_PROP_LEGEND].size,
                                      im->tabwidth,
                                      im->gdes[ii].legend, 0) 
                   + legspace[ii]
                   + glue;

After:
leg_x +=
                        gfx_get_text_width(im->canvas, leg_x,
                                           im->text_prop[TEXT_PROP_LEGEND].
                                           font,
                                           im->text_prop[TEXT_PROP_LEGEND].
                                           size, im->tabwidth,
                                           im->gdes[ii].legend, 0)
                        + legspace[ii]
                        + glue;

Line breaking on a member operator?  Ouch! :)  It also did something quite
weird here:

Before:
        /* only valid control codes */
        if (prt_fctn != 'l' && 
            prt_fctn != 'n' && /* a synonym for l */
            prt_fctn != 'r' &&
            prt_fctn != 'j' &&
            prt_fctn != 'c' &&
            prt_fctn != 's' &&
            prt_fctn != 't' &&
            prt_fctn != '\0' &&
            prt_fctn != 'g' ) {
               free(legspace);
               rrd_set_error("Unknown control code at the end of
'%s\\%c'",im->gdes[i].legend,prt_fctn);
                      return -1;

        }

After:
            /* only valid control codes */
            if (prt_fctn != 'l' && prt_fctn != 'n' &&  /* a synonym for l */
                prt_fctn != 'r' &&
                prt_fctn != 'j' &&
                prt_fctn != 'c' &&
                prt_fctn != 's' &&
                prt_fctn != 't' && prt_fctn != '\0' && prt_fctn != 'g') {
                free(legspace);
                rrd_set_error("Unknown control code at the end of '%s\\%c'",
                              im->gdes[i].legend, prt_fctn);
                return -1;

            }

So there may still be some tweaking to do on the auto-indent script, and I
have no idea how that works.  I'll have the full-size-mode patch ported and
tested a little bit later.  The auto-indent stuff means I don't need to
worry about indentation in my code, right?

Thanks,
Matt



More information about the rrd-developers mailing list