geany/geany — comment on commit efcce8808e92ba56684605790959cb014a11c9c8
File:  line 0
By ntrel:

> Having the fallback to an unsafe version defeats most of the advantages,
> maybe even making the code worse since

Agree, it's always best to avoid using different code on different platforms.

NVL comes from tagmanager. I added NZV but had no idea people would do things like NZV(++foo), I don't think that makes sense because why would you increment a possibly-null pointer? That is a bad idea surely.

I think NZV is a bit ugly name-wise but is quite nice to shorten code a bit. It's in the API so would need deprecating before removing this.

setptr is really useful for simplifying code as Colomban explained and is used a lot. We should definitely keep something like this, but we could rename it to SET_AND_FREE (maybe better than FREE_AND_SET as that implies a different order).

If we're going to rename it, perhaps it should be replaced with a proper function:
utils_rebind(&ptr, g_strdup(ptr));

The & makes it obvious the function changes ptr.

setptr could then be deprecated (it's in the API so we would need to do this anyway).