aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/src/GetAtomNm.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2022-01-19 00:45:43 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-04-27 14:08:46 +0200
commit4875a15ca61358a1c95b156b2279fce092451278 (patch)
tree79054df1730d4723658b02cec311bc8ba7655662 /nx-X11/lib/src/GetAtomNm.c
parenta502149a844736dcc7f7dedd7c63229c74a448ee (diff)
downloadnx-libs-4875a15ca61358a1c95b156b2279fce092451278.tar.gz
nx-libs-4875a15ca61358a1c95b156b2279fce092451278.tar.bz2
nx-libs-4875a15ca61358a1c95b156b2279fce092451278.zip
Update libNX_X11 to upstream's libX11-1.7.3.1-10-gd60ede78
Diffstat (limited to 'nx-X11/lib/src/GetAtomNm.c')
-rw-r--r--nx-X11/lib/src/GetAtomNm.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/nx-X11/lib/src/GetAtomNm.c b/nx-X11/lib/src/GetAtomNm.c
index 32de50d23..41ec3bac6 100644
--- a/nx-X11/lib/src/GetAtomNm.c
+++ b/nx-X11/lib/src/GetAtomNm.c
@@ -36,7 +36,6 @@ char *_XGetAtomName(
Atom atom)
{
xResourceReq *req;
- char *name;
register Entry *table;
register int idx;
register Entry e;
@@ -45,10 +44,7 @@ char *_XGetAtomName(
table = dpy->atoms->table;
for (idx = TABLESIZE; --idx >= 0; ) {
if ((e = *table++) && (e->atom == atom)) {
- idx = strlen(EntryName(e)) + 1;
- if ((name = Xmalloc(idx)))
- strcpy(name, EntryName(e));
- return name;
+ return strdup(EntryName(e));
}
}
}
@@ -87,8 +83,8 @@ char *XGetAtomName(
}
typedef struct {
- unsigned long start_seq;
- unsigned long stop_seq;
+ uint64_t start_seq;
+ uint64_t stop_seq;
Atom *atoms;
char **names;
int idx;
@@ -107,10 +103,11 @@ Bool _XGetAtomNameHandler(
register _XGetAtomNameState *state;
xGetAtomNameReply replbuf;
register xGetAtomNameReply *repl;
+ uint64_t last_request_read = X_DPY_GET_LAST_REQUEST_READ(dpy);
state = (_XGetAtomNameState *)data;
- if (dpy->last_request_read < state->start_seq ||
- dpy->last_request_read > state->stop_seq)
+ if (last_request_read < state->start_seq ||
+ last_request_read > state->stop_seq)
return False;
while (state->idx < state->count && state->names[state->idx])
state->idx++;
@@ -152,7 +149,7 @@ XGetAtomNames (
int missed = -1;
LockDisplay(dpy);
- async_state.start_seq = dpy->request + 1;
+ async_state.start_seq = X_DPY_GET_REQUEST(dpy) + 1;
async_state.atoms = atoms;
async_state.names = names_return;
async_state.idx = 0;
@@ -165,7 +162,7 @@ XGetAtomNames (
for (i = 0; i < count; i++) {
if (!(names_return[i] = _XGetAtomName(dpy, atoms[i]))) {
missed = i;
- async_state.stop_seq = dpy->request;
+ async_state.stop_seq = X_DPY_GET_REQUEST(dpy);
}
}
if (missed >= 0) {