summaryrefslogtreecommitdiffstats
path: root/src/sss_client
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-04-15 16:00:46 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-05-14 18:29:52 +0200
commit2fa8d6655ac37f9bdeb34420000052d921f4a543 (patch)
tree9aa9a3cc5b196c8043afc893f124f9b3acccbae9 /src/sss_client
parent105c7a324c3ee2930b23513ae73aeddce0d8c347 (diff)
downloadsssd-2fa8d6655ac37f9bdeb34420000052d921f4a543.tar.gz
sssd-2fa8d6655ac37f9bdeb34420000052d921f4a543.tar.xz
sssd-2fa8d6655ac37f9bdeb34420000052d921f4a543.zip
Rename SAFEALIGN macros.
https://fedorahosted.org/sssd/ticket/1772 SAFEALIGN macros have been renamed in this patch to make it easy to pick the right macro when data is copied from byte buffer to a variable or vice versa. The renamed macros are placed in new header file to avoid code duplication (the old ones were defined in two files, one for the client code and one for the rest of sssd).
Diffstat (limited to 'src/sss_client')
-rw-r--r--src/sss_client/sss_cli.h36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/sss_client/sss_cli.h b/src/sss_client/sss_cli.h
index a7d99b43f..285a2979a 100644
--- a/src/sss_client/sss_cli.h
+++ b/src/sss_client/sss_cli.h
@@ -32,6 +32,8 @@
#include <stdint.h>
#include <limits.h>
+#include "util/util_safealign.h"
+
#ifndef HAVE_ERRNO_T
#define HAVE_ERRNO_T
typedef int errno_t;
@@ -526,40 +528,6 @@ int sss_ssh_make_request(enum sss_cli_command cmd,
uint8_t **repbuf, size_t *replen,
int *errnop);
-#ifndef SAFEALIGN_COPY_UINT32
-static inline void
-safealign_memcpy(void *dest, const void *src, size_t n, size_t *counter)
-{
- memcpy(dest, src, n);
- if (counter) {
- *counter += n;
- }
-}
-
-#define SAFEALIGN_SET_VALUE(dest, value, type, pctr) do { \
- type CV_MACRO_val = (type)(value); \
- safealign_memcpy(dest, &CV_MACRO_val, sizeof(type), pctr); \
-} while(0)
-
-#ifndef SAFEALIGN_SET_UINT32
-#define SAFEALIGN_SET_UINT32(dest, value, pctr) \
- SAFEALIGN_SET_VALUE(dest, value, uint32_t, pctr)
-#endif
-
-#define SAFEALIGN_COPY_UINT32(dest, src, pctr) \
- safealign_memcpy(dest, src, sizeof(uint32_t), pctr)
-#endif
-
-#ifndef SAFEALIGN_SET_UINT16
-#define SAFEALIGN_SET_UINT16(dest, value, pctr) \
- SAFEALIGN_SET_VALUE(dest, value, uint16_t, pctr)
-#endif
-
-#ifndef SAFEALIGN_COPY_UINT16
-#define SAFEALIGN_COPY_UINT16(dest, src, pctr) \
- safealign_memcpy(dest, src, sizeof(uint16_t), pctr)
-#endif
-
#if 0
/* GETSPNAM Request: