Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: fusl/src/search/insque.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/search/hsearch.c ('k') | fusl/src/search/lsearch.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <search.h>
2
3 struct node {
4 struct node *next;
5 struct node *prev;
6 };
7
8 void insque(void *element, void *pred)
9 {
10 struct node *e = element;
11 struct node *p = pred;
12
13 if (!p) {
14 e->next = e->prev = 0;
15 return;
16 }
17 e->next = p->next;
18 e->prev = p;
19 p->next = e;
20 if (e->next)
21 e->next->prev = e;
22 }
23
24 void remque(void *element)
25 {
26 struct node *e = element;
27
28 if (e->next)
29 e->next->prev = e->prev;
30 if (e->prev)
31 e->prev->next = e->next;
32 }
OLDNEW
« no previous file with comments | « fusl/src/search/hsearch.c ('k') | fusl/src/search/lsearch.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698