On 09/10/2012 11:56 PM, Junio C Hamano wrote:
> Michael Haggerty <mhag...@alum.mit.edu> writes:
> 
>> diff --git a/string-list.c b/string-list.c
>> index d9810ab..5594b7d 100644
>> --- a/string-list.c
>> +++ b/string-list.c
>> @@ -148,13 +148,23 @@ void print_string_list(const struct string_list *p, 
>> const char *text)
>>              printf("%s:%p\n", p->items[i].string, p->items[i].util);
>>  }
>>  
>> -struct string_list_item *string_list_append(struct string_list *list, const 
>> char *string)
>> +struct string_list_item *string_list_append_nodup(struct string_list *list,
>> +                                              char *string)
>>  {
>> +    struct string_list_item *retval;
>>      ALLOC_GROW(list->items, list->nr + 1, list->alloc);
>> -    list->items[list->nr].string =
>> -            list->strdup_strings ? xstrdup(string) : (char *)string;
>> -    list->items[list->nr].util = NULL;
>> -    return list->items + list->nr++;
>> +    retval = &list->items[list->nr++];
>> +    retval->string = (char *)string;
> 
> Do you still need this cast, now the function takes non-const "char *string"?

Good catch.  Do you want to fix this in your repo or should I re-roll?

Michael

-- 
Michael Haggerty
mhag...@alum.mit.edu
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to