The Issue: You're creating a programme that will run on many platforms. As a result, there are several #ifdef statements scattered throughout the code. There are so many that the code is difficult to understand and things seem unsightly. As an example: void send_cmd(void) {  send_cmd_start(); #ifdef FE_TEXTURE  send_texture(); #endif /* FE_TEXTURE */ #ifdef FE_COLOR  send_background();  if (foreground != TRANSPARENT)  send_foreground(); #endif /* FE_COLOR */ #ifdef FE_SIZE  if (size != 0)  send_size(); #endif /* FE_SIZE */ #ifdef FE_REPLAY  if (prev_cmd == '\0') {  prev_cmd = cur_cmd;  prev_param = cur_param;  } #endif /* FE_REPLAY */  send_cmd_end(); }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Topic Video
Question

The Issue: You're creating a programme that will run on many platforms. As a result, there are several #ifdef statements scattered throughout the code. There are so many that the code is difficult to understand and things seem unsightly.
As an example:

void send_cmd(void)
{
 send_cmd_start();
#ifdef FE_TEXTURE
 send_texture();
#endif /* FE_TEXTURE */
#ifdef FE_COLOR
 send_background();
 if (foreground != TRANSPARENT)
 send_foreground();
#endif /* FE_COLOR */
#ifdef FE_SIZE
 if (size != 0)
 send_size();
#endif /* FE_SIZE */
#ifdef FE_REPLAY
 if (prev_cmd == '\0') {
 prev_cmd = cur_cmd;
 prev_param = cur_param;
 }
#endif /* FE_REPLAY */
 send_cmd_end();
}

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT