CMA-ES / c-cmaes

CMA-ES written in ANSI C (yet fairly object-oriented)
Other
56 stars 26 forks source link

Prefix exported symbols with "cmaes" #12

Closed chrisdembia closed 9 years ago

chrisdembia commented 9 years ago

This is a redo of #9.

In #9, @sherm1 mentioned:

I think there were a couple more externs at the end of cmaes.c that didn't get fixed: ERRORMESSAGE() and szCat(). Maybe Niko can check whether these or some other routines were intended to be static in which case they wouldn't need the cmaes prefix.

It does seem that these symbols were meant to be static, since they are declared as static. I have marked them as static at their definition now too.

To make these changes, I effectively ran the following shell script:

perl -p -i -e 's/boundary_transformation(?!\.)/cmaes_boundary_transformation/g' c-cma-es/* c-cma-es/src/*
perl -p -i -e 's/readpara(?!\.)/cmaes_readpara/g' c-cma-es/* c-cma-es/src/*                                                                                                      
perl -p -i -e 's/timings(?!\.)/cmaes_timings/g' c-cma-es/* c-cma-es/src/*                                                                                                        
perl -p -i -e 's/random(?!\.)/cmaes_random/g' c-cma-es/* c-cma-es/src/*

and made some manual tweaks after that to comments, etc.

I tested that the code still compiles (by running the compile script), and that the resulting executables all run. I did not check the results, though.