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

Unified Diff: fusl/src/search/lsearch.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: fusl/src/search/lsearch.c
diff --git a/fusl/src/search/lsearch.c b/fusl/src/search/lsearch.c
index 63f319223a0abcd8c9f70544c0500bcdf9a6195b..21d0e53f6d2e7a2c4f2c4610a4a7caaa6c9d865e 100644
--- a/fusl/src/search/lsearch.c
+++ b/fusl/src/search/lsearch.c
@@ -1,31 +1,33 @@
#include <search.h>
#include <string.h>
-void *lsearch(const void *key, void *base, size_t *nelp, size_t width,
- int (*compar)(const void *, const void *))
-{
- char (*p)[width] = base;
- size_t n = *nelp;
- size_t i;
+void* lsearch(const void* key,
+ void* base,
+ size_t* nelp,
+ size_t width,
+ int (*compar)(const void*, const void*)) {
+ char(*p)[width] = base;
+ size_t n = *nelp;
+ size_t i;
- for (i = 0; i < n; i++)
- if (compar(p[i], key) == 0)
- return p[i];
- *nelp = n+1;
- return memcpy(p[n], key, width);
+ for (i = 0; i < n; i++)
+ if (compar(p[i], key) == 0)
+ return p[i];
+ *nelp = n + 1;
+ return memcpy(p[n], key, width);
}
-void *lfind(const void *key, const void *base, size_t *nelp,
- size_t width, int (*compar)(const void *, const void *))
-{
- char (*p)[width] = (void *)base;
- size_t n = *nelp;
- size_t i;
+void* lfind(const void* key,
+ const void* base,
+ size_t* nelp,
+ size_t width,
+ int (*compar)(const void*, const void*)) {
+ char(*p)[width] = (void*)base;
+ size_t n = *nelp;
+ size_t i;
- for (i = 0; i < n; i++)
- if (compar(p[i], key) == 0)
- return p[i];
- return 0;
+ for (i = 0; i < n; i++)
+ if (compar(p[i], key) == 0)
+ return p[i];
+ return 0;
}
-
-

Powered by Google App Engine
This is Rietveld 408576698