[haiku-bugs] Re: [Haiku] #8434: Building to GPT disks may write the wrong partition offset under Linux

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Fri, 04 May 2012 22:10:43 -0000

#8434: Building to GPT disks may write the wrong partition offset under Linux
----------------------------+----------------------------
   Reporter:  tqh           |      Owner:  bonefish
       Type:  bug           |     Status:  new
   Priority:  normal        |  Milestone:  R1
  Component:  Build System  |    Version:  R1/Development
 Resolution:                |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  1             |   Platform:  All
----------------------------+----------------------------

Comment (by bonefish):

 Thanks for the updated patch. The new patch still has a few style issues:
  - Generally indentation is not used just to align stuff. E.g. the
 `read_pos()` arguments should just flow to the end of line, wrapped there
 (at a convenient point) and continue with an incremented indentation level
 (exactly one additional tab) on the next line. When nested expressions are
 wrapped, an additional indentation level per nesting level can be added.
  - There shouldn't be a space after the cast operator.
  - Besides the space, there's one superfluous set of parentheses in
 `(ssize_t) (toRead)`. When using the cast operator, the parentheses around
 `toRead` are not necessary. Alternative you can use the constructor style
 conversion, if you like that better: `ssize_t(toRead)`.
  - The spacing of the three `if` statements is incorrect. The `{` should
 be separated by a space. For `if` two and three the spacing after the `if`
 keyword is incorrect.
  - `errno` is of type `int`, so the `printf()` format should be `%x` (or
 even nicer `%#x`). The preferred way to print errors is via `strerror()`,
 but I believe that isn't available in the boot loader ATM.
  - The `gptSignature` definition should not hardcode the array size, but
 use the `kGPTSignatureSize` constant.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8434#comment:24>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: