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

Side by Side Diff: fusl/src/stdlib/atoll.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 unified diff | Download patch
OLDNEW
1 #include <stdlib.h> 1 #include <stdlib.h>
2 #include <ctype.h> 2 #include <ctype.h>
3 3
4 long long atoll(const char *s) 4 long long atoll(const char* s) {
5 { 5 long long n = 0;
6 » long long n=0; 6 int neg = 0;
7 » int neg=0; 7 while (isspace(*s))
8 » while (isspace(*s)) s++; 8 s++;
9 » switch (*s) { 9 switch (*s) {
10 » case '-': neg=1; 10 case '-':
11 » case '+': s++; 11 neg = 1;
12 » } 12 case '+':
13 » /* Compute n as a negative number to avoid overflow on LLONG_MIN */ 13 s++;
14 » while (isdigit(*s)) 14 }
15 » » n = 10*n - (*s++ - '0'); 15 /* Compute n as a negative number to avoid overflow on LLONG_MIN */
16 » return neg ? n : -n; 16 while (isdigit(*s))
17 n = 10 * n - (*s++ - '0');
18 return neg ? n : -n;
17 } 19 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698