Closed andre-hartmann closed 7 years ago
Hi, pycrc is a very nice product.
I only have one small adoption to the header generation. Please see e.g. https://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier for more information.
...if you return 'PYCRC_' + out_str, then the line filename = 'pycrc_stdout' should be changed to filename = 'stdout'
Sorry for the feature creep. :)
Hi Thomas, you have a good point here.
But instead of adding something to the front, the pure filename should be used IMHO. E.g. /path/to/file.h should result in FILE_H, not in _PATH_TO_FILE_H
I have to admit, that my Python knowlegde is rather limited, but I'll have a second look later.
That's my mistake, apologies... _pretty_hdrprotection() uses os.path.basename(), which returns the name of the file, not the whole path.
So your change is absolutely fine, but I would still like having the comment updated, i.e. change
(e.g. __CRC_IMPLEMENTATION_H__)
to (e.g. CRC_IMPLEMENTATION_H)
Thanks for using and contributing to pycrc!
I've amended my master branch... Anything else I need to do to update the merge request?
Nope, GitHub has updated the pull request automatically. I's all merged and submitted. Thanks!
All symbols that start with one underscore followed by uppercase letter, or all symbols that contain two underscores are reserved for the compiler and the standard library. They should not be used in user code.