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

Side by Side Diff: fusl/tools/add-cfi.common.awk

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/unistd/writev.c ('k') | fusl/tools/add-cfi.i386.awk » ('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 function hex2int(str, i) {
2 str = tolower(str)
3
4 for (i = 1; i <= 16; i++) {
5 char = substr("0123456789abcdef", i, 1)
6 lookup[char] = i-1
7 }
8
9 result = 0
10 for (i = 1; i <= length(str); i++) {
11 result = result * 16
12 char = substr(str, i, 1)
13 result = result + lookup[char]
14 }
15 return result
16 }
17
18 function parse_const(str) {
19 sign = sub(/^-/, "", str)
20 hex = sub(/^0x/, "", str)
21 if (hex)
22 n = hex2int(str)
23 else
24 n = str+0
25 return sign ? -n : n
26 }
OLDNEW
« no previous file with comments | « fusl/src/unistd/writev.c ('k') | fusl/tools/add-cfi.i386.awk » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698