~ctwm/ctwm/trunk

« back to all changes in this revision

Viewing changes to parse_m4.c

  • Committer: Matthew Fuller
  • Date: 2016-01-25 06:22:19 UTC
  • mto: This revision was merged to the branch mainline in revision 430.
  • Revision ID: fullermd@over-yonder.net-20160125062219-n72ngne8j42t095t
Build up color in the switch() that determines vc, rather than in a
separate condition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
        Visual *visual;
114
114
        char client[MAXHOSTNAME], server[MAXHOSTNAME], *colon;
115
115
        struct hostent *hostname;
116
 
        char *vc;               /* Visual Class */
 
116
        char *vc, *color;
117
117
        static char tmp_name[] = "/tmp/twmrcXXXXXX";
118
118
        int fd;
119
119
        FILE *tmpf;
205
205
#undef Resolution
206
206
        WR_NUM("PLANES", DisplayPlanes(display, Scr->screen));
207
207
        WR_NUM("BITS_PER_RGB", visual->bits_per_rgb);
 
208
        color = "Yes";
208
209
        switch(visual->class) {
209
210
                case(StaticGray):
210
211
                        vc = "StaticGray";
 
212
                        color = "No";
211
213
                        break;
212
214
                case(GrayScale):
213
215
                        vc = "GrayScale";
 
216
                        color = "No";
214
217
                        break;
215
218
                case(StaticColor):
216
219
                        vc = "StaticColor";
229
232
                        break;
230
233
        }
231
234
        WR_DEF("CLASS", vc);
232
 
        if(visual->class != StaticGray && visual->class != GrayScale) {
233
 
                WR_DEF("COLOR", "Yes");
234
 
        }
235
 
        else {
236
 
                WR_DEF("COLOR", "No");
237
 
        }
 
235
        WR_DEF("COLOR", color);
238
236
 
239
237
        /*
240
238
         * Bits of "how this ctwm invocation is being run" data