xserver: Branch 'XACE-SELINUX'
Eamon Walsh
ewalsh at kemper.freedesktop.org
Thu Aug 16 17:43:01 PDT 2007
Xext/security.c | 10 +++++-----
dix/privates.c | 12 ++++++------
include/privates.h | 22 +++++++++++-----------
3 files changed, 22 insertions(+), 22 deletions(-)
New commits:
diff-tree b2b7817497dd5da73d23ec9cc637c563041fc490 (from 0a994d4f859a4e48d41a90ed9d2a282bb528c555)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date: Thu Aug 16 15:30:25 2007 -0400
devPrivates rework: use camelcase standard for name of key type.
diff --git a/Xext/security.c b/Xext/security.c
index bf414a5..fe1e48a 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -54,7 +54,7 @@ in this Software without prior written a
static int SecurityErrorBase; /* first Security error number */
static int SecurityEventBase; /* first Security event number */
-static devprivate_key_t stateKey;
+static const DevPrivateKey stateKey = &stateKey;
/* this is what we store as client security state */
typedef struct {
@@ -64,11 +64,11 @@ typedef struct {
} SecurityClientStateRec;
#define HAVESTATE(client) (((SecurityClientStateRec *) \
- dixLookupPrivate(DEVPRIV_PTR(client), &stateKey))->haveState)
+ dixLookupPrivate(DEVPRIV_PTR(client), stateKey))->haveState)
#define TRUSTLEVEL(client) (((SecurityClientStateRec *) \
- dixLookupPrivate(DEVPRIV_PTR(client), &stateKey))->trustLevel)
+ dixLookupPrivate(DEVPRIV_PTR(client), stateKey))->trustLevel)
#define AUTHID(client)(((SecurityClientStateRec *) \
- dixLookupPrivate(DEVPRIV_PTR(client), &stateKey))->authId)
+ dixLookupPrivate(DEVPRIV_PTR(client), stateKey))->authId)
static CallbackListPtr SecurityValidateGroupCallback = NULL;
@@ -1812,7 +1812,7 @@ SecurityExtensionInit(INITARGS)
RTEventClient |= RC_NEVERRETAIN;
/* Allocate the private storage */
- if (!dixRequestPrivate(&stateKey, sizeof(SecurityClientStateRec)))
+ if (!dixRequestPrivate(stateKey, sizeof(SecurityClientStateRec)))
FatalError("SecurityExtensionSetup: Can't allocate client private.\n");
if (!AddCallback(&ClientStateCallback, SecurityClientStateCallback, NULL))
diff --git a/dix/privates.c b/dix/privates.c
index f2f1c49..4dbba43 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -47,7 +47,7 @@ from The Open Group.
#include "extnsionst.h"
typedef struct _PrivateDesc {
- devprivate_key_t *key;
+ DevPrivateKey key;
unsigned size;
CallbackListPtr initfuncs;
CallbackListPtr deletefuncs;
@@ -58,7 +58,7 @@ typedef struct _PrivateDesc {
static PrivateDescRec *items = NULL;
static _X_INLINE PrivateDescRec *
-findItem(devprivate_key_t *const key)
+findItem(const DevPrivateKey key)
{
PrivateDescRec *item = items;
while (item) {
@@ -73,7 +73,7 @@ findItem(devprivate_key_t *const key)
* Request pre-allocated space.
*/
_X_EXPORT int
-dixRequestPrivate(devprivate_key_t *const key, unsigned size)
+dixRequestPrivate(const DevPrivateKey key, unsigned size)
{
PrivateDescRec *item = findItem(key);
if (item) {
@@ -98,7 +98,7 @@ dixRequestPrivate(devprivate_key_t *cons
* Allocate a private and attach it to an existing object.
*/
_X_EXPORT pointer *
-dixAllocatePrivate(PrivateRec **privates, devprivate_key_t *const key)
+dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
{
PrivateDescRec *item = findItem(key);
PrivateRec *ptr;
@@ -156,7 +156,7 @@ dixFreePrivates(PrivateRec *privates)
* Callback registration
*/
_X_EXPORT int
-dixRegisterPrivateInitFunc(devprivate_key_t *const key,
+dixRegisterPrivateInitFunc(const DevPrivateKey key,
CallbackProcPtr callback, pointer data)
{
PrivateDescRec *item = findItem(key);
@@ -169,7 +169,7 @@ dixRegisterPrivateInitFunc(devprivate_ke
}
_X_EXPORT int
-dixRegisterPrivateDeleteFunc(devprivate_key_t *const key,
+dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
CallbackProcPtr callback, pointer data)
{
PrivateDescRec *item = findItem(key);
diff --git a/include/privates.h b/include/privates.h
index e57f167..e377b30 100644
--- a/include/privates.h
+++ b/include/privates.h
@@ -19,10 +19,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE
* STUFF FOR PRIVATES
*****************************************************************/
-typedef char devprivate_key_t;
+typedef void *DevPrivateKey;
typedef struct _Private {
- devprivate_key_t *key;
+ DevPrivateKey key;
pointer value;
struct _Private *next;
} PrivateRec;
@@ -39,19 +39,19 @@ typedef struct _Private {
* Calling this is not necessary if only a pointer by itself is needed.
*/
extern int
-dixRequestPrivate(devprivate_key_t *const key, unsigned size);
+dixRequestPrivate(const DevPrivateKey key, unsigned size);
/*
* Allocates a new private and attaches it to an existing object.
*/
extern pointer *
-dixAllocatePrivate(PrivateRec **privates, devprivate_key_t *const key);
+dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key);
/*
* Look up a private pointer.
*/
static _X_INLINE pointer
-dixLookupPrivate(PrivateRec **privates, devprivate_key_t *const key)
+dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key)
{
PrivateRec *rec = *privates;
pointer *ptr;
@@ -70,7 +70,7 @@ dixLookupPrivate(PrivateRec **privates,
* Look up the address of a private pointer.
*/
static _X_INLINE pointer *
-dixLookupPrivateAddr(PrivateRec **privates, devprivate_key_t *const key)
+dixLookupPrivateAddr(PrivateRec **privates, const DevPrivateKey key)
{
PrivateRec *rec = *privates;
@@ -87,7 +87,7 @@ dixLookupPrivateAddr(PrivateRec **privat
* Set a private pointer.
*/
static _X_INLINE int
-dixSetPrivate(PrivateRec **privates, devprivate_key_t *const key, pointer val)
+dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val)
{
PrivateRec *rec;
@@ -111,16 +111,16 @@ dixSetPrivate(PrivateRec **privates, dev
* The calldata argument to the callbacks is a PrivateCallbackPtr.
*/
typedef struct _PrivateCallback {
- devprivate_key_t *key; /* private registration key */
- pointer *value; /* address of private pointer */
+ DevPrivateKey key; /* private registration key */
+ pointer *value; /* address of private pointer */
} PrivateCallbackRec;
extern int
-dixRegisterPrivateInitFunc(devprivate_key_t *const key,
+dixRegisterPrivateInitFunc(const DevPrivateKey key,
CallbackProcPtr callback, pointer userdata);
extern int
-dixRegisterPrivateDeleteFunc(devprivate_key_t *const key,
+dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
CallbackProcPtr callback, pointer userdata);
/*
More information about the xorg-commit
mailing list