This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bad indentation on nested switch case

Hi all,

It might just be a distraction, but I can't seem to find a missing ; or bracket... I searched the forum but found nothing either.

Is there a case of bad indentation on nested switch/case statements on CCS6? Why does the case 0xFF below insists on going to the right when I type CTRL-I (aligned to case 0x96), instead of aligning below the case 0xFE?

Cheers,

void infinity_ACT_NTAN(uint32_t index)
{
	switch (infinity_content[index][0])
	{
	case 0xFE: // Hard codes on page 0xFE, special commands on Aggregator
		switch (infinity_content[index][1])
		{
		case 0x02:  // Simulator mode
			status_struct.sim_stat = infinity_content[index][2];
			infinity_send(BASE_CPU,INFINITY_IDT_NTST,(char *) &status_struct);  // send status
			break;
		case 0x96:  // System shutdown
			break;
		}
		break;
		case 0xFF: // Hard codes on page 0xFF, special commands on PWIO
			switch (infinity_content[index][1])
			{
			case 0x01:  // Carriage control
				infinity_forward(BASE_POWERIO,index);
				break;
			}
			break;
	}
}

(I'm not sure if pasting it using the </> tool will change the mistake, though...)

  • Bruno Saraiva said:
    Why does the case 0xFF below insists on going to the right when I type CTRL-I (aligned to case 0x96), instead of aligning below the case 0xFE?

    I see similar indentation but am not sure why it is happening. I could revert it back to intended level of tabbing by selecting the line in the editor, right-clicking and choosing Source->Shift Left.