mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
dix: fix int mismatches related to MakeAtom()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
e006550e29
commit
f03042a2b7
@@ -81,8 +81,8 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
|
|||||||
|
|
||||||
np = &atomRoot;
|
np = &atomRoot;
|
||||||
for (unsigned int i = 0; i < (len + 1) / 2; i++) {
|
for (unsigned int i = 0; i < (len + 1) / 2; i++) {
|
||||||
fp = fp * 27 + string[i];
|
fp = fp * 27 + (unsigned int)string[i];
|
||||||
fp = fp * 27 + string[len - 1 - i];
|
fp = fp * 27 + (unsigned int)string[len - 1 - i];
|
||||||
}
|
}
|
||||||
while (*np != NULL) {
|
while (*np != NULL) {
|
||||||
if (fp < (*np)->fingerPrint)
|
if (fp < (*np)->fingerPrint)
|
||||||
@@ -90,7 +90,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
|
|||||||
else if (fp > (*np)->fingerPrint)
|
else if (fp > (*np)->fingerPrint)
|
||||||
np = &((*np)->right);
|
np = &((*np)->right);
|
||||||
else { /* now start testing the strings */
|
else { /* now start testing the strings */
|
||||||
comp = strncmp(string, (*np)->string, (int) len);
|
comp = strncmp(string, (*np)->string, len);
|
||||||
if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
|
if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
|
||||||
np = &((*np)->left);
|
np = &((*np)->left);
|
||||||
else if (comp > 0)
|
else if (comp > 0)
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ static inline int WriteRpcbufToClient(ClientPtr pClient,
|
|||||||
* @return atom ID
|
* @return atom ID
|
||||||
*/
|
*/
|
||||||
static inline Atom dixAddAtom(const char *name) {
|
static inline Atom dixAddAtom(const char *name) {
|
||||||
return MakeAtom(name, strlen(name), TRUE);
|
return MakeAtom(name, (unsigned int)strlen(name), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -732,7 +732,7 @@ static inline Atom dixAddAtom(const char *name) {
|
|||||||
* @return atom ID
|
* @return atom ID
|
||||||
*/
|
*/
|
||||||
static inline Atom dixGetAtomID(const char *name) {
|
static inline Atom dixGetAtomID(const char *name) {
|
||||||
return MakeAtom(name, strlen(name), FALSE);
|
return MakeAtom(name, (unsigned int)strlen(name), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _XSERVER_DIX_PRIV_H */
|
#endif /* _XSERVER_DIX_PRIV_H */
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ RRMonitorCrtcName(RRCrtcPtr crtc)
|
|||||||
|
|
||||||
if (crtc->numOutputs) {
|
if (crtc->numOutputs) {
|
||||||
RROutputPtr output = crtc->outputs[0];
|
RROutputPtr output = crtc->outputs[0];
|
||||||
return MakeAtom(output->name, output->nameLength, TRUE);
|
return MakeAtom(output->name, (unsigned int)output->nameLength, TRUE);
|
||||||
}
|
}
|
||||||
sprintf(name, "Monitor-%08lx", (unsigned long int)crtc->id);
|
sprintf(name, "Monitor-%08lx", (unsigned long int)crtc->id);
|
||||||
return dixAddAtom(name);
|
return dixAddAtom(name);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ XkbInternAtom(char *str, Bool only_if_exists)
|
|||||||
{
|
{
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
return None;
|
return None;
|
||||||
return MakeAtom(str, strlen(str), !only_if_exists);
|
return MakeAtom(str, (unsigned int)strlen(str), !only_if_exists);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|||||||
Reference in New Issue
Block a user