Opened 9 years ago

Closed 9 years ago

#7352 closed enhancement (invalid)

Removing goto from boot loader main.cpp

Reported by: Finder Owned by: axeld
Priority: normal Milestone: R1
Component: System/Boot Loader Version: R1/Development
Keywords: goto Cc:
Blocked By: Blocking:
Platform: All


This is just a little patch to remove a goto from the main.cpp of the boot loader. I made this because:

  1. coding guidelines
  2. goto is evil

Attachments (1)

loadermain-nogoto.patch (800 bytes ) - added by Finder 9 years ago.

Download all attachments as: .zip

Change History (4)

by Finder, 9 years ago

Attachment: loadermain-nogoto.patch added

comment:1 by Finder, 9 years ago

patch: 01

comment:2 by korli, 9 years ago

Finder, you must be kidding, right?

comment:3 by axeld, 9 years ago

Resolution: invalid
Status: newclosed

While goto should be avoided generally, using goto to bail out like this, and do proper cleanup is perfectly fine IMO, and it's actually easier to follow than your code. Thanks for your patch, anyway, though!

Just look at src/system/kernel/fs/vfs.cpp if you want to shudder a bit more :-)

Note: See TracTickets for help on using tickets.