Re: [PATCH 1/9] Define a structure for object IDs.
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- May 4, 2014, 06:07 UTC
- Message-ID
- <5365D91E.70207@alum.mit.edu>
- In-Reply-To
- <1399147942-165308-2-git-send-email-sandals@crustytoothpaste.net>
On 05/03/2014 10:12 PM, brian m. carlson wrote:
Show 8 quoted lines
> Many places throughout the code use "unsigned char [20]" to store object IDs > (SHA-1 values). This leads to lots of hardcoded numbers throughout the > codebase. It also leads to confusion about the purposes of a buffer. > > Introduce a structure for object IDs. This allows us to obtain the benefits > of compile-time checking for misuse. The structure is expected to remain > the same size and have the same alignment requirements on all known > platforms, compared to the array of unsigned char.
Please clarify whether you plan to rely on all platforms having "the same size and alignment constraints" for correctness, or whether that observation of the status quo is only meant to reassure us that this change won't cause memory to be wasted on padding.
If the former then I would feel very uncomfortable about the change. Otherwise I think it will be a nice improvement in code clarity (and I admire your ambition in taking on this project!)
Michael
-- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/