git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@110039 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@102487 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@102485 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@93316 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -8,13 +8,14 @@ read_int (unsigned char **bytes) { |
8 | 8 |
return x; |
9 | 9 |
} |
10 | 10 |
|
11 |
-static inline char |
|
11 |
+static inline unsigned char |
|
12 | 12 |
read_char (unsigned char **bytes) { |
13 |
- char x = (*bytes)[0]; |
|
13 |
+ unsigned char x = (*bytes)[0]; |
|
14 | 14 |
(*bytes)++; |
15 | 15 |
return x; |
16 | 16 |
} |
17 | 17 |
|
18 |
+ |
|
18 | 19 |
static inline const char * |
19 | 20 |
read_string (unsigned char **bytes) { |
20 | 21 |
const char *string = *bytes; |
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@69806 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,23 @@ |
1 |
+/* Functions for reading data from byte streams. Inlined because they |
|
2 |
+ are tiny and need to be fast. */ |
|
3 |
+ |
|
4 |
+static inline int |
|
5 |
+read_int (unsigned char **bytes) { |
|
6 |
+ int x = ((int *)*bytes)[0]; |
|
7 |
+ *bytes += sizeof(int); |
|
8 |
+ return x; |
|
9 |
+} |
|
10 |
+ |
|
11 |
+static inline char |
|
12 |
+read_char (unsigned char **bytes) { |
|
13 |
+ char x = (*bytes)[0]; |
|
14 |
+ (*bytes)++; |
|
15 |
+ return x; |
|
16 |
+} |
|
17 |
+ |
|
18 |
+static inline const char * |
|
19 |
+read_string (unsigned char **bytes) { |
|
20 |
+ const char *string = *bytes; |
|
21 |
+ (*bytes) += strlen(string) + 1; |
|
22 |
+ return string; |
|
23 |
+} |