CVS update: samba/source/lib

Luke Kenneth Casson Leighton lkcl at samba.org
Thu Jul 20 06:53:55 EST 2000


On Wed, 19 Jul 2000, Gerald Carter wrote:

> Luke Kenneth Casson Leighton wrote:
> > 
> > i object.  if you want a list-associating "thing", use 
> > a list.  in the cases where you want an 
> > array-associating "thing" use an array.
> 
> Arrays, lists, .... I understand the difference, Luke.
> 
> > please do not just randomly replace occurrences of 
> > code where an array is used because an array is 
> > the optiml data structure to use.
> 
> Luke,  I'm am going to affense at this statement.
> I do not randomly replace code.  That's all I'm 
> going to say.
> 
> > the whole point of the array code is that you can 
> > do this:
> > 
> > array[index]->structmember
> > 
> > and then you can free the entire array 
> > _and_ the dynamically allocated pointers-to-array-items 
> > with a single function call.
> 
> Fine.  Point taken.  I'm not arguing about lists vs. 
> arrays.  I'm saying that the use of abusive use void 
> pointers to functions in util_array, IMO, makes it 
> nearly unreadable

it's not supposed to be readable it's supposed to be 20 lines of code that
just.... works!

i found that the compiler would not accept anything other than what is
specified in there [the typecast of a function that takes a void* and
returns a void* to a function that takes some_type and returns  some_type,
or whatever].

c++ would be _so_ much better for this than c...

>.  So if I can provide a better 
> implementation of the same thing, why complain?

ah, ok - you're not going to replace arrays with lists: that's ok.  i
misunderstood.

... last week i thought about macro-ising that code.





More information about the samba-cvs mailing list