Jacek Caban : crypt32: Get rid of no longer needed BASE_CONTEXT.
Alexandre Julliard
julliard at winehq.org
Thu Oct 17 13:51:50 CDT 2013
Module: wine
Branch: master
Commit: 619bbe5d29efe925ce39307a94c32ec9a022d989
URL: http://source.winehq.org/git/wine.git/?a=commit;h=619bbe5d29efe925ce39307a94c32ec9a022d989
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Oct 17 11:08:25 2013 +0200
crypt32: Get rid of no longer needed BASE_CONTEXT.
---
dlls/crypt32/context.c | 9 +++------
dlls/crypt32/crypt32_private.h | 4 ++--
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/crypt32/context.c b/dlls/crypt32/context.c
index 9108ada..65a906b 100644
--- a/dlls/crypt32/context.c
+++ b/dlls/crypt32/context.c
@@ -25,14 +25,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(context);
-#define CONTEXT_FROM_BASE_CONTEXT(p) (void*)(p+1)
-#define BASE_CONTEXT_FROM_CONTEXT(p) ((BASE_CONTEXT*)(p)-1)
-
void *Context_CreateDataContext(size_t contextSize, const context_vtbl_t *vtbl)
{
- BASE_CONTEXT *context;
+ context_t *context;
- context = CryptMemAlloc(contextSize + sizeof(BASE_CONTEXT));
+ context = CryptMemAlloc(sizeof(context_t) + contextSize);
if (!context)
return NULL;
@@ -47,7 +44,7 @@ void *Context_CreateDataContext(size_t contextSize, const context_vtbl_t *vtbl)
}
TRACE("returning %p\n", context);
- return CONTEXT_FROM_BASE_CONTEXT(context);
+ return context_ptr(context);
}
context_t *Context_CreateLinkContext(unsigned int contextSize, context_t *linked)
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index 3ccd279..f02a333 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -171,7 +171,7 @@ typedef struct {
struct _context_t *(*clone)(context_t*,struct WINE_CRYPTCERTSTORE*,BOOL);
} context_vtbl_t;
-typedef struct _context_t {
+struct _context_t {
const context_vtbl_t *vtbl;
LONG ref;
struct _context_t *linked;
@@ -180,7 +180,7 @@ typedef struct _context_t {
struct list entry;
void *ptr;
} u;
-} BASE_CONTEXT;
+};
static inline context_t *context_from_ptr(const void *ptr)
{
More information about the wine-cvs
mailing list