History

do not use anonymous struct member

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 891af291 parent 55cb4771 file · +13 −12Browse files

Unified · Split

9gc.c+13−12
@@ -31,7 +31,7 @@ typedef struct C9aux C9aux; · 30 unmodified lines
3131 typedef struct REntry REntry;
3232
3333 struct C9aux {
34− C9ctx;
34+ C9ctx c;
3535 int f;
3636 int flags;
3737 uint8_t rdbuf[Msize];
@@ -238,14 +238,15 @@ ctxregistryR(C9ctx *ctx, C9r *r) · 200 unmodified lines
238238 b++;
239239 if ((s = strchr(s, '\n')) == NULL)
240240 s = (char*)&r->read.data[r->read.size];
241− *s++ = 0;
241+ else
242+ *s++ = 0;
242243 if (strstr(b, "tlssrv") == NULL && (s = strchr(b, ' ')) != NULL) {
243244 *s = 0;
244245 close(a->f);
245246 if ((a->f = dial(b)) < 0)
246247 exit(1);
247248 a->flags = 0;
248− a->r = ctxchatR;
249+ ctx->r = ctxchatR;
249250 a->wroff = 0;
250251 c9version(ctx, &tag, Msize);
251252 if (wrsend(a) != 0)
@@ -289,11 +290,11 @@ srv(char *s) · 37 unmodified lines
289290 return NULL;
290291 c = calloc(1, sizeof(*c));
291292 c->f = f;
292− c->read = ctxread;
293− c->begin = ctxbegin;
294− c->end = ctxend;
295− c->error = ctxerror;
296− c->aux = c;
293+ c->c.read = ctxread;
294+ c->c.begin = ctxbegin;
295+ c->c.end = ctxend;
296+ c->c.error = ctxerror;
297+ c->c.aux = c;
297298
298299 return c;
299300 }
@@ -313,10 +314,10 @@ registry(void) · 13 unmodified lines
313314 if (a == NULL)
314315 return NULL;
315316
316− a->r = ctxregistryR;
317− c9version((C9ctx*)a, &tag, Msize);
317+ a->c.r = ctxregistryR;
318+ c9version(&a->c, &tag, Msize);
318319 wrsend(a);
319− while (c9proc((C9ctx*)a) == 0 && a->r == ctxregistryR)
320+ while (c9proc(&a->c) == 0 && a->c.r == ctxregistryR)
320321 wrsend(a);
321322
322323 return a;
@@ -350,7 +351,7 @@ chatrw(C9aux *a) · 27 unmodified lines
350351 break;
351352 }
352353
353− ctx = (C9ctx*)a;
354+ ctx = &a->c;
354355 if (FD_ISSET(a->f, &r)) {
355356 c9proc(ctx);
356357 } else if (FD_ISSET(0, &r)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t