From c74ef795c7282681616decc36a9a81cd1b1b6ec7 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 27 Feb 2013 10:45:05 +0100 Subject: libX11 mesa pixman xkeyboard-config xkeyboard-config commit 9993f996e75232385b19cc5078f7fecde6b399b9 libX11 commit b687440c28c7da6ee0ae44514d20248db5161606 pixman commit 2156fb51b353867d5a18b734690ca551f74d4fb1 mesa commit f987d23b28491bd7b0552bd9daffa53a8e073c71 --- libX11/src/ChProp.c | 6 +++--- libX11/src/ErrDes.c | 9 +++++---- libX11/src/GetDflt.c | 2 +- libX11/src/KeyBind.c | 2 +- libX11/src/KeysymStr.c | 26 +++++++++++--------------- libX11/src/SetHints.c | 4 +++- libX11/src/SetPntMap.c | 2 +- libX11/src/StBytes.c | 2 +- libX11/src/StName.c | 6 +++--- libX11/src/StrKeysym.c | 2 +- libX11/src/XlibInt.c | 20 ++++++++++---------- libX11/src/xcms/cmsColNm.c | 2 +- 12 files changed, 41 insertions(+), 42 deletions(-) (limited to 'libX11/src') diff --git a/libX11/src/ChProp.c b/libX11/src/ChProp.c index b95775128..190a224f8 100644 --- a/libX11/src/ChProp.c +++ b/libX11/src/ChProp.c @@ -62,7 +62,7 @@ XChangeProperty ( len = ((long)nelements + 3)>>2; if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { SetReqLen(req, len, len); - Data (dpy, (char *)data, nelements); + Data (dpy, (_Xconst char *)data, nelements); } /* else force BadLength */ break; @@ -71,7 +71,7 @@ XChangeProperty ( if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { SetReqLen(req, len, len); len = (long)nelements << 1; - Data16 (dpy, (short *) data, len); + Data16 (dpy, (_Xconst short *) data, len); } /* else force BadLength */ break; @@ -80,7 +80,7 @@ XChangeProperty ( if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { SetReqLen(req, len, len); len = (long)nelements << 2; - Data32 (dpy, (long *) data, len); + Data32 (dpy, (_Xconst long *) data, len); } /* else force BadLength */ break; diff --git a/libX11/src/ErrDes.c b/libX11/src/ErrDes.c index 9a5b1805f..ef5edad6c 100644 --- a/libX11/src/ErrDes.c +++ b/libX11/src/ErrDes.c @@ -109,7 +109,7 @@ XGetErrorText( if (nbytes == 0) return 0; if (code <= BadImplementation && code > 0) { - sprintf(buf, "%d", code); + snprintf(buf, sizeof(buf), "%d", code); (void) XGetErrorDatabaseText(dpy, "XProtoError", buf, _XErrorList + _XErrorOffsets[code], buffer, nbytes); @@ -125,11 +125,12 @@ XGetErrorText( bext = ext; } if (!buffer[0] && bext) { - sprintf(buf, "%s.%d", bext->name, code - bext->codes.first_error); + snprintf(buf, sizeof(buf), "%s.%d", + bext->name, code - bext->codes.first_error); (void) XGetErrorDatabaseText(dpy, "XProtoError", buf, "", buffer, nbytes); } if (!buffer[0]) - sprintf(buffer, "%d", code); + snprintf(buffer, nbytes, "%d", code); return 0; } @@ -190,7 +191,7 @@ XGetErrorDatabaseText( else tptr = Xmalloc (tlen); if (tptr) { - sprintf(tptr, "%s.%s", name, type); + snprintf(tptr, tlen, "%s.%s", name, type); XrmGetResource(db, tptr, "ErrorType.ErrorNumber", &type_str, &result); if (tptr != temp) diff --git a/libX11/src/GetDflt.c b/libX11/src/GetDflt.c index dfda1c64d..6f62cd820 100644 --- a/libX11/src/GetDflt.c +++ b/libX11/src/GetDflt.c @@ -110,7 +110,7 @@ GetHomeDir( len2 = strlen (ptr2); } if ((len1 + len2 + 1) < len) - sprintf (dest, "%s%s", ptr1, (ptr2) ? ptr2 : ""); + snprintf (dest, len, "%s%s", ptr1, (ptr2) ? ptr2 : ""); else *dest = '\0'; #else diff --git a/libX11/src/KeyBind.c b/libX11/src/KeyBind.c index 221cedd8c..f22feca59 100644 --- a/libX11/src/KeyBind.c +++ b/libX11/src/KeyBind.c @@ -1014,7 +1014,7 @@ XRebindKeysym ( dpy->key_bindings = p; dpy->free_funcs->key_bindings = _XFreeKeyBindings; p->next = tmp; /* chain onto list */ - memcpy (p->string, (char *) str, nbytes); + memcpy (p->string, str, nbytes); p->len = nbytes; memcpy ((char *) p->modifiers, (char *) mlist, nb); p->key = keysym; diff --git a/libX11/src/KeysymStr.c b/libX11/src/KeysymStr.c index 101f29733..c7c470468 100644 --- a/libX11/src/KeysymStr.c +++ b/libX11/src/KeysymStr.c @@ -70,11 +70,6 @@ SameValue( char *XKeysymToString(KeySym ks) { - register int i, n; - int h; - register int idx; - const unsigned char *entry; - unsigned char val1, val2, val3, val4; XrmDatabase keysymdb; if (!ks || (ks & ((unsigned long) ~0x1fffffff)) != 0) @@ -83,16 +78,17 @@ char *XKeysymToString(KeySym ks) ks = 0; if (ks <= 0x1fffffff) { - val1 = ks >> 24; - val2 = (ks >> 16) & 0xff; - val3 = (ks >> 8) & 0xff; - val4 = ks & 0xff; - i = ks % VTABLESIZE; - h = i + 1; - n = VMAXHASH; + unsigned char val1 = ks >> 24; + unsigned char val2 = (ks >> 16) & 0xff; + unsigned char val3 = (ks >> 8) & 0xff; + unsigned char val4 = ks & 0xff; + int i = ks % VTABLESIZE; + int h = i + 1; + int n = VMAXHASH; + int idx; while ((idx = hashKeysym[i])) { - entry = &_XkeyTable[idx]; + const unsigned char *entry = &_XkeyTable[idx]; if ((entry[0] == val1) && (entry[1] == val2) && (entry[2] == val3) && (entry[3] == val4)) return ((char *)entry + 4); @@ -111,7 +107,7 @@ char *XKeysymToString(KeySym ks) XrmQuark empty = NULLQUARK; GRNData data; - sprintf(buf, "%lX", ks); + snprintf(buf, sizeof(buf), "%lX", ks); resval.addr = (XPointer)buf; resval.size = strlen(buf) + 1; data.name = (char *)NULL; @@ -136,7 +132,7 @@ char *XKeysymToString(KeySym ks) i--; s[i--] = '\0'; for (; i; i--){ - val1 = val & 0xf; + unsigned char val1 = val & 0xf; val >>= 4; if (val1 < 10) s[i] = '0'+ val1; diff --git a/libX11/src/SetHints.c b/libX11/src/SetHints.c index 0c33f5901..1cde48f85 100644 --- a/libX11/src/SetHints.c +++ b/libX11/src/SetHints.c @@ -259,7 +259,9 @@ XSetStandardProperties ( if (icon_string != NULL) { XChangeProperty (dpy, w, XA_WM_ICON_NAME, XA_STRING, 8, - PropModeReplace, (unsigned char *)icon_string, safestrlen(icon_string)); + PropModeReplace, + (_Xconst unsigned char *)icon_string, + safestrlen(icon_string)); } if (icon_pixmap != None) { diff --git a/libX11/src/SetPntMap.c b/libX11/src/SetPntMap.c index 2e292019f..14e104d6d 100644 --- a/libX11/src/SetPntMap.c +++ b/libX11/src/SetPntMap.c @@ -43,7 +43,7 @@ XSetPointerMapping ( GetReq (SetPointerMapping, req); req->nElts = nmaps; req->length += (nmaps + 3)>>2; - Data (dpy, (char *)map, (long) nmaps); + Data (dpy, (_Xconst char *)map, (long) nmaps); if (_XReply (dpy, (xReply *)&rep, 0, xFalse) == 0) rep.success = MappingSuccess; UnlockDisplay(dpy); diff --git a/libX11/src/StBytes.c b/libX11/src/StBytes.c index 13ac879c5..07ee441ab 100644 --- a/libX11/src/StBytes.c +++ b/libX11/src/StBytes.c @@ -94,7 +94,7 @@ XStoreBuffer ( { if ((buffer < 0) || (buffer > 7)) return 0; return XChangeProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], - XA_STRING, 8, PropModeReplace, (unsigned char *) bytes, nbytes); + XA_STRING, 8, PropModeReplace, (_Xconst unsigned char *) bytes, nbytes); } int diff --git a/libX11/src/StName.c b/libX11/src/StName.c index fb1e6f5e1..b4048bff0 100644 --- a/libX11/src/StName.c +++ b/libX11/src/StName.c @@ -37,7 +37,7 @@ XStoreName ( _Xconst char *name) { return XChangeProperty(dpy, w, XA_WM_NAME, XA_STRING, - 8, PropModeReplace, (unsigned char *)name, + 8, PropModeReplace, (_Xconst unsigned char *)name, name ? strlen(name) : 0); } @@ -47,7 +47,7 @@ XSetIconName ( Window w, _Xconst char *icon_name) { - return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING, - 8, PropModeReplace, (unsigned char *)icon_name, + return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING, 8, + PropModeReplace, (_Xconst unsigned char *)icon_name, icon_name ? strlen(icon_name) : 0); } diff --git a/libX11/src/StrKeysym.c b/libX11/src/StrKeysym.c index 4394e0cd2..12fce6872 100644 --- a/libX11/src/StrKeysym.c +++ b/libX11/src/StrKeysym.c @@ -94,7 +94,7 @@ XStringToKeysym(_Xconst char *s) { entry = &_XkeyTable[idx]; if ((entry[0] == sig1) && (entry[1] == sig2) && - !strcmp(s, (char *)entry + 6)) + !strcmp(s, (const char *)entry + 6)) { val = (entry[2] << 24) | (entry[3] << 16) | (entry[4] << 8) | entry[5]; diff --git a/libX11/src/XlibInt.c b/libX11/src/XlibInt.c index 2827c106a..c43684269 100644 --- a/libX11/src/XlibInt.c +++ b/libX11/src/XlibInt.c @@ -1432,7 +1432,7 @@ static int _XPrintDefaultError( mesg, BUFSIZ); (void) fprintf(fp, mesg, event->request_code); if (event->request_code < 128) { - sprintf(number, "%d", event->request_code); + snprintf(number, sizeof(number), "%d", event->request_code); XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ); } else { for (ext = dpy->ext_procs; @@ -1452,7 +1452,7 @@ static int _XPrintDefaultError( fputs(" ", fp); (void) fprintf(fp, mesg, event->minor_code); if (ext) { - sprintf(mesg, "%s.%d", ext->name, event->minor_code); + snprintf(mesg, sizeof(mesg), "%s.%d", ext->name, event->minor_code); XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer, BUFSIZ); (void) fprintf(fp, " (%s)", buffer); } @@ -1475,8 +1475,8 @@ static int _XPrintDefaultError( bext = ext; } if (bext) - sprintf(buffer, "%s.%d", bext->name, - event->error_code - bext->codes.first_error); + snprintf(buffer, sizeof(buffer), "%s.%d", bext->name, + event->error_code - bext->codes.first_error); else strcpy(buffer, "Value"); XGetErrorDatabaseText(dpy, mtype, buffer, "", mesg, BUFSIZ); @@ -1722,7 +1722,7 @@ void _Xbcopy(b1, b2, length) #ifdef DataRoutineIsProcedure void Data( Display *dpy, - char *data, + _Xconst char *data, long len) { if (dpy->bufptr + (len) <= dpy->bufmax) { @@ -1739,7 +1739,7 @@ void Data( int _XData32( Display *dpy, - register long *data, + register _Xconst long *data, unsigned len) { register int *buf; @@ -1781,7 +1781,7 @@ _XData32( static doData16( register Display *dpy, - short *data, + _Xconst short *data, unsigned len, char *packbuffer) { @@ -1814,7 +1814,7 @@ static doData16( _XData16 ( Display *dpy, - short *data, + _Xconst short *data, unsigned len) { char packbuffer[PACKBUFFERSIZE]; @@ -1836,7 +1836,7 @@ _XData16 ( static doData32( register Display *dpy - long *data, + _Xconst long *data, unsigned len, char *packbuffer) { @@ -1867,7 +1867,7 @@ static doData32( void _XData32( Display *dpy, - long *data, + _Xconst long *data, unsigned len) { char packbuffer[PACKBUFFERSIZE]; diff --git a/libX11/src/xcms/cmsColNm.c b/libX11/src/xcms/cmsColNm.c index 73977e5fc..a6749c02e 100644 --- a/libX11/src/xcms/cmsColNm.c +++ b/libX11/src/xcms/cmsColNm.c @@ -254,7 +254,7 @@ FirstCmp(const void *p1, const void *p2) * */ { - return(strcmp(((XcmsPair *)p1)->first, ((XcmsPair *)p2)->first)); + return(strcmp(((const XcmsPair *)p1)->first, ((const XcmsPair *)p2)->first)); } -- cgit v1.2.3