Re: Mac OS 9 (Lamp) port
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- May 31, 2010, 05:49 UTC
- Message-ID
- <20100531054947.GB3328@progeny.tock>
- In-Reply-To
- <2776E3E5-234F-4A94-B06A-F4D83D87A414@gmail.com>
Joshua Juran wrote:
Show 18 quoted lines
> diff --git a/server-info.c b/server-info.c
> index 4098ca2..a9a0188 100644
> --- a/server-info.c
> +++ b/server-info.c
> @@ -132,8 +132,8 @@ static int read_pack_info_file(const char *infofile)
>
> static int compare_info(const void *a_, const void *b_)
> {
> - struct pack_info *const *a = a_;
> - struct pack_info *const *b = b_;
> + const struct pack_info *const *a = a_;
> + const struct pack_info *const *b = b_;
>
> if (0 <= (*a)->old_num && 0 <= (*b)->old_num)
> /* Keep the order in the original */
>
> I certainly won't defend Metrowerks C 2.4.1, but the patch is
> harmless enough.Yes, it is even a good change.
It just emphasized for me that Metrowerks is a little confused about type qualifiers.
> #define alloc_n(type, n) ((type*)xmalloc(sizeof (type) * n)) > > to factor the multiplication out of the calling code.
Maybe, imitating the signature of calloc:
#define malloc_n(n, type) ((type *)xmalloc((n) * sizeof(type)))
For structs with variable-length arrays at the end:
#define malloc_plus(type, extra) ((type *)xmalloc(sizeof(type) + (extra)))
That should cover most of the calls in git.
> I just want git to work on Lamp, and if > there's community interest in C++ compatibility then I can assist > with that.
There probably is not much direct interest. But if in the process we gain a little type-safety and portability, that would be nice. :)
Thanks for your hard work, Jonathan