[SSSD] [PATCH] Rename SAFEALIGN macros

Jakub Hrozek jhrozek at redhat.com
Thu Apr 25 22:51:37 UTC 2013


On Thu, Apr 25, 2013 at 03:41:28PM +0200, Michal Židek wrote:
> https://fedorahosted.org/sssd/ticket/1772
> 
> Changes done:
> - definitions of safealign macros have been removed from
> src/sss_client/sss_cli.h and src/util/util.h and put into new header
> (the old headers include this new header). This change was done to
> avoid code duplication.
> 
> - Macros that copy bytes from a variable to byte buffer have been
> renamed from SAFEALIGN_SET_<type> to SAFEALIGN_VAR2BUF_<type>.
> 
> - Macros that copy bytes from a byte buffer to a variable have been
> renamed from SAFEALIGN_COPY_<type> to SAFEALIGN_BUF2VAR_<type>
> 
> - Aliases have been added to allow the old names to be used in the
> code (we can remove the aliases when the old names are replaced with
> the new ones on all places in the code, but for now, it is good to
> allow both alternatives, so that this patch can be smaller)
> 
> Thanks
> Michal

You need to add the new header to dist_noinst_HEADERS in Makefile.am
otherwise you break make distcheck.

Also, I was thinking about how we create the headers for consumption in
both server and the client -- would it be a good idea to differentiate
them on the filesystem level so that it's immediatelly clear that this
header is special?

I see two options:
    a) create a new subdirectory, something like src/shared (better name
    welcome) that would contain the code shared between server and client
    b) use some kind of prefix in the filename such as cs_header.h

It's nice to see the attribution retained to the original author of the
code. Credit where credit is due.



More information about the sssd-devel mailing list