}
int
-xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name,
- char *busID, int major, int minor, int patchLevel)
+xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
+ const char *busID, int major, int minor, int patchLevel)
{
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
-extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name,
- char *busID, int major, int minor,
+extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
+ const char *busID, int major, int minor,
int patchLevel);
#endif /* _XVMC_H */
}
static int VendorRelease = VENDOR_RELEASE;
-static char *VendorString = VENDOR_NAME;
+static const char *VendorString = VENDOR_NAME;
void
SetVendorRelease(int release)
}
void
-SetVendorString(char *string)
+SetVendorString(const char *string)
{
VendorString = string;
}
* adding RT_FONT prevents conflict with default cursor font
*/
Bool
-SetDefaultFont(char *defaultfontname)
+SetDefaultFont(const char *defaultfontname)
{
int err;
FontPtr pf;
fpe->refcount--;
if (fpe->refcount == 0) {
(*fpe_functions[fpe->type].free_fpe) (fpe);
- free(fpe->name);
+ free((void *) fpe->name);
free(fpe);
}
}
if (err == FontNameAlias && alias) {
newlen = strlen(alias);
- newname = (char *) realloc(c->fontname, newlen);
+ newname = (char *) realloc((char *) c->fontname, newlen);
if (!newname) {
err = AllocError;
break;
FreeFPE(c->fpe_list[i]);
}
free(c->fpe_list);
- free(c->fontname);
+ free((void *) c->fontname);
free(c);
return TRUE;
}
int
OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname,
- char *pfontname)
+ const char *pfontname)
{
OFclosurePtr c;
int i;
*/
c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
- free(c->fontname);
+ free((void *) c->fontname);
free(c);
return BadAlloc;
}
/* does the necessary magic to figure out the fpe type */
static int
-DetermineFPEType(char *pathname)
+DetermineFPEType(const char *pathname)
{
int i;
}
/* if error or can't do it, act like it's a new one */
if (!fpe) {
+ char *name;
fpe = malloc(sizeof(FontPathElementRec));
if (!fpe) {
err = BadAlloc;
goto bail;
}
- fpe->name = malloc(len + 1);
- if (!fpe->name) {
+ name = malloc(len + 1);
+ if (!name) {
free(fpe);
err = BadAlloc;
goto bail;
}
fpe->refcount = 1;
- strncpy(fpe->name, (char *) cp, (int) len);
- fpe->name[len] = '\0';
+ strncpy(name, (char *) cp, (int) len);
+ name[len] = '\0';
+ fpe->name = name;
fpe->name_length = len;
fpe->type = DetermineFPEType(fpe->name);
if (fpe->type == -1)
("[dix] Could not init font path element %s, removing from list!\n",
fpe->name);
}
- free(fpe->name);
+ free((void *) fpe->name);
free(fpe);
}
}
}
int
-SetDefaultFontPath(char *path)
+SetDefaultFontPath(const char *path)
{
- char *temp_path, *start, *end;
+ const char *start, *end;
+ char *temp_path;
unsigned char *cp, *pp, *nump, *newpath;
int num = 1, len, err, size = 0, bad;
case CORE:
rc = EventToCore(event, &xE, &count);
break;
+ default:
+ rc = BadImplementation;
+ break;
}
if (rc == Success) {
match = CORE_MATCH;
ignore_device = TRUE;
break;
+ default:
+ return NO_MATCH;
}
tmp->grabtype = grabtype;
}
ext->name = strdup(name);
ext->num_aliases = 0;
- ext->aliases = (char **) NULL;
+ ext->aliases = (const char **) NULL;
if (!ext->name) {
dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
free(ext);
newexts = (ExtensionEntry **) realloc(extensions,
(i + 1) * sizeof(ExtensionEntry *));
if (!newexts) {
- free(ext->name);
+ free((void *) ext->name);
dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
free(ext);
return ((ExtensionEntry *) NULL);
AddExtensionAlias(const char *alias, ExtensionEntry * ext)
{
char *name;
- char **aliases;
+ const char **aliases;
if (!ext)
return FALSE;
- aliases = (char **) realloc(ext->aliases,
- (ext->num_aliases + 1) * sizeof(char *));
+ aliases = realloc(ext->aliases,
+ (ext->num_aliases + 1) * sizeof(char *));
if (!aliases)
return FALSE;
ext->aliases = aliases;
if (extensions[i]->CloseDown)
extensions[i]->CloseDown(extensions[i]);
NumExtensions = i;
- free(extensions[i]->name);
+ free((void *) extensions[i]->name);
for (j = extensions[i]->num_aliases; --j >= 0;)
- free(extensions[i]->aliases[j]);
+ free((void *) extensions[i]->aliases[j]);
free(extensions[i]->aliases);
dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION);
free(extensions[i]);
{
int num_events = 1;
DeviceEvent *event;
- RawDeviceEvent *raw;
+ RawDeviceEvent *raw = NULL;
double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */
double devx = 0.0, devy = 0.0; /* desktop-wide in device coords */
- int sx, sy; /* for POINTER_SCREEN */
+ int sx = 0, sy = 0; /* for POINTER_SCREEN */
ValuatorMask mask;
ScreenPtr scr;
int num_barrier_events = 0;
transformAbsolute(pDev, &mask);
clipAbsolute(pDev, &mask);
- if ((flags & POINTER_NORAW) == 0)
+ if ((flags & POINTER_NORAW) == 0 && raw)
set_raw_valuators(raw, &mask, raw->valuators.data);
}
else {
if (flags & POINTER_ACCELERATE)
accelPointer(pDev, &mask, ms);
- if ((flags & POINTER_NORAW) == 0)
+ if ((flags & POINTER_NORAW) == 0 && raw)
set_raw_valuators(raw, &mask, raw->valuators.data);
moveRelative(pDev, flags, &mask);
event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y);
if (flags & POINTER_EMULATED) {
- raw->flags = XIPointerEmulated;
+ if (raw)
+ raw->flags = XIPointerEmulated;
event->flags = XIPointerEmulated;
}
Bool screenSaverSuspended = FALSE;
#endif
-char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
-char *defaultTextFont = COMPILEDDEFAULTFONT;
-char *defaultCursorFont = COMPILEDCURSORFONT;
+const char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
+const char *defaultTextFont = COMPILEDDEFAULTFONT;
+const char *defaultCursorFont = COMPILEDCURSORFONT;
FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
every compilation of dix code */
CursorPtr rootCursor;
int defaultColorVisualClass = -1;
int monitorResolution = 0;
-char *display;
+const char *display;
int displayfd;
char *ConnectionInfo;
win_name = get_window_name(pWin);
ErrorF("win 0x%.8x (%s), [%d, %d] to [%d, %d]",
- pWin->drawable.id,
+ (unsigned) pWin->drawable.id,
win_name ? win_name : "no name",
pWin->drawable.x, pWin->drawable.y,
pWin->drawable.x + pWin->drawable.width,
ErrorF(" (%s compositing: pixmap %x)",
(pWin->redirectDraw == RedirectDrawAutomatic) ?
"automatic" : "manual",
- pScreen->GetWindowPixmap(pWin)->drawable.id);
+ (unsigned) pScreen->GetWindowPixmap(pWin)->drawable.id);
#endif
switch (pWin->visibility) {
for (scrnum = 0; scrnum < screenInfo.numScreens; scrnum++) {
pScreen = screenInfo.screens[scrnum];
ErrorF("[dix] Dumping windows for screen %d (pixmap %x):\n", scrnum,
- pScreen->GetScreenPixmap(pScreen)->drawable.id);
+ (unsigned) pScreen->GetScreenPixmap(pScreen)->drawable.id);
pWin = pScreen->root;
depth = 1;
while (pWin) {
Mask flags;
/* XXX -- get these from request buffer instead? */
- char *origFontName;
+ const char *origFontName;
int origFontNameLen;
XID fontid;
char *fontname;
SetVendorRelease(int release);
extern _X_EXPORT void
-SetVendorString(char *string);
+SetVendorString(const char *string);
+
+int
+dix_main(int argc, char *argv[], char *envp[]);
/* events.c */
typedef struct _DIXFontProp *DIXFontPropPtr;
-extern _X_EXPORT Bool SetDefaultFont(char * /*defaultfontname */ );
+extern _X_EXPORT Bool SetDefaultFont(const char * /*defaultfontname */ );
extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe */ );
XID /*fid */ ,
Mask /*flags */ ,
unsigned /*lenfname */ ,
- char * /*pfontname */ );
+ const char * /*pfontname */ );
extern _X_EXPORT int CloseFont(pointer /*pfont */ ,
XID /*fid */ );
int /*npaths */ ,
unsigned char * /*paths */ );
-extern _X_EXPORT int SetDefaultFontPath(char * /*path */ );
+extern _X_EXPORT int SetDefaultFontPath(const char * /*path */ );
extern _X_EXPORT int GetFontPath(ClientPtr client,
int *count,
int index;
void (*CloseDown) ( /* called at server shutdown */
struct _ExtensionEntry * /* extension */ );
- char *name; /* extension name */
+ const char *name; /* extension name */
int base; /* base request number */
int eventBase;
int eventLast;
int errorBase;
int errorLast;
int num_aliases;
- char **aliases;
+ const char **aliases;
pointer extPrivate;
unsigned short (*MinorOpcode) ( /* called for errors */
ClientPtr /* client */ );
pointer clientClip;
unsigned long stateChanges; /* masked with GC_<kind> */
unsigned long serialNumber;
- GCFuncs *funcs;
- GCOps *ops;
+ const GCFuncs *funcs;
+ const GCOps *ops;
PrivateRec *devPrivates;
/*
* The following were moved here from private storage to allow device-
extern _X_EXPORT Bool screenSaverSuspended;
#endif
-extern _X_EXPORT char *defaultFontPath;
+extern _X_EXPORT const char *defaultFontPath;
extern _X_EXPORT int monitorResolution;
extern _X_EXPORT int defaultColorVisualClass;
#include "globals.h"
-extern _X_EXPORT char *defaultTextFont;
-extern _X_EXPORT char *defaultCursorFont;
+extern _X_EXPORT const char *defaultTextFont;
+extern _X_EXPORT const char *defaultCursorFont;
extern _X_EXPORT int MaxClients;
extern _X_EXPORT volatile char isItTimeToYield;
extern _X_EXPORT volatile char dispatchException;
extern _X_EXPORT int ScreenSaverAllowExposures;
extern _X_EXPORT int defaultScreenSaverBlanking;
extern _X_EXPORT int defaultScreenSaverAllowExposures;
-extern _X_EXPORT char *display;
+extern _X_EXPORT const char *display;
extern _X_EXPORT int displayfd;
extern _X_EXPORT int defaultBackingStore;