Skip to content

Commit e9c7055

Browse files
committed
tinync: Tweak syntax
1 parent 41be11a commit e9c7055

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

tinync/tinync.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ struct cr {
3131

3232
#define cr_local static
3333

34-
#define cr_begin() \
35-
do { \
36-
if ((ctx)->status == CR_FINISHED) \
37-
return; \
38-
if ((ctx)->label) \
39-
goto *(ctx)->label; \
34+
#define cr_begin() \
35+
do { \
36+
if ((ctx)->status == CR_FINISHED) \
37+
return; \
38+
if ((ctx)->label) \
39+
goto *(ctx)->label; \
4040
} while (0)
4141
#define cr_label(o, stat) \
4242
do { \
@@ -47,17 +47,17 @@ struct cr {
4747

4848
#define cr_status(name) cr_context_name(name).status
4949

50-
#define cr_wait(cond) \
51-
do { \
52-
cr_label(ctx, CR_BLOCKED); \
53-
if (!(cond)) \
54-
return; \
50+
#define cr_wait(cond) \
51+
do { \
52+
cr_label(ctx, CR_BLOCKED); \
53+
if (!(cond)) \
54+
return; \
5555
} while (0)
5656

57-
#define cr_exit(stat) \
58-
do { \
59-
cr_label(ctx, stat); \
60-
return; \
57+
#define cr_exit(stat) \
58+
do { \
59+
cr_label(ctx, stat); \
60+
return; \
6161
} while (0)
6262

6363
#define cr_queue(T, size) \
@@ -178,10 +178,7 @@ int main(int argc, char *argv[])
178178

179179
struct sockaddr_in addr = {
180180
.sin_family = AF_INET,
181-
.sin_addr =
182-
{
183-
.s_addr = inet_addr(host),
184-
},
181+
.sin_addr = {.s_addr = inet_addr(host)},
185182
.sin_port = htons(port),
186183
};
187184
connect(fd, (struct sockaddr *) &addr, sizeof(struct sockaddr_in));

0 commit comments

Comments
 (0)