FLIF icon indicating copy to clipboard operation
FLIF copied to clipboard

use flif namespace

Open k-brac opened this issue 9 years ago • 5 comments

create a flif namespace to avoid name conflicts. For instance Image is a widely used class name.

This should ease the integration of the decoder in another project

k-brac avatar Nov 07 '16 10:11 k-brac

Well, all exported functions and struct of the library are prefixed with flif, so that's done already. And for the internal classes I don't see any conflicts.

fherzog2 avatar Nov 15 '16 21:11 fherzog2

I suppose if you want to integrate the decoder by copying the code (instead of linking to the library), then having a namespace would help. Not sure why you would want to integrate the decoder that way though...

jonsneyers avatar Nov 15 '16 22:11 jonsneyers

The OP gave an example of a class / struct that is not namespaced nor prefixed: Image.

(I haven't checked whether that's true)

hrj avatar Nov 16 '16 02:11 hrj

Well the story is simple: I experimented with the decoder to see if it can be used in our program (we are currently using huge png files). Once all my images were converted to flif I loaded them in our program using the flif_decode function. Our program also uses its own Image class (which fortunately is protected by a namespace) so it was kind of messy. This issue is mostly for convenience and cleanness of the API.

I think the inclusion of the decoder in another project should be as seamless as possible to not scare away potential users. (this also apply to #318 )

k-brac avatar Nov 16 '16 14:11 k-brac

I wholeheartedly agree with k-brac.

I also, some prefix, like "FLIF_*" should be added to the #defines

And last, but not least, you really should look into the bunch of warnings the code generates.

lixo6500 avatar Nov 14 '17 16:11 lixo6500