summaryrefslogtreecommitdiff
path: root/pdf/pdf_lex.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-08 13:49:11 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-08 13:49:11 +0200
commit94e774a8bd2891f36885ae710efd42caebd855ed (patch)
tree883147e1bf5dc8feba5d142b8ffcde8e7e0676f6 /pdf/pdf_lex.c
parenta1b5f023ccebd339e9a74ef7f3bcc94c0c74d3e0 (diff)
downloadmupdf-94e774a8bd2891f36885ae710efd42caebd855ed.tar.xz
Remove inline keyword where it is not strictly necessary for performance.
Also put the function on the same line for inline functions, so they stick out and are easy to find with grep.
Diffstat (limited to 'pdf/pdf_lex.c')
-rw-r--r--pdf/pdf_lex.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/pdf/pdf_lex.c b/pdf/pdf_lex.c
index bb0e6e32..31d8a825 100644
--- a/pdf/pdf_lex.c
+++ b/pdf/pdf_lex.c
@@ -23,8 +23,7 @@
#define RANGE_A_F \
'A':case'B':case'C':case'D':case'E':case'F'
-static inline int
-iswhite(int ch)
+static inline int iswhite(int ch)
{
return
ch == '\000' ||
@@ -35,40 +34,32 @@ iswhite(int ch)
ch == '\040';
}
-static inline int
-from_hex(int ch)
+static inline int unhex(int ch)
{
- if (ch >= '0' && ch <= '9')
- return ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- return ch - 'A' + 0xA;
- else if (ch >= 'a' && ch <= 'f')
- return ch - 'a' + 0xA;
+ if (ch >= '0' && ch <= '9') return ch - '0';
+ if (ch >= 'A' && ch <= 'F') return ch - 'A' + 0xA;
+ if (ch >= 'a' && ch <= 'f') return ch - 'a' + 0xA;
return 0;
}
-static inline void
+static void
lex_white(fz_stream *f)
{
int c;
- do
- {
+ do {
c = fz_read_byte(f);
- }
- while ((c <= 32) && (iswhite(c)));
+ } while ((c <= 32) && (iswhite(c)));
if (c != EOF)
fz_unread_byte(f);
}
-static inline void
+static void
lex_comment(fz_stream *f)
{
int c;
- do
- {
+ do {
c = fz_read_byte(f);
- }
- while ((c != '\012') && (c != '\015') && (c != EOF));
+ } while ((c != '\012') && (c != '\015') && (c != EOF));
}
static int
@@ -329,12 +320,12 @@ lex_hex_string(fz_stream *f, char *buf, int n)
case IS_HEX:
if (x)
{
- *s++ = a * 16 + from_hex(c);
+ *s++ = a * 16 + unhex(c);
x = !x;
}
else
{
- a = from_hex(c);
+ a = unhex(c);
x = !x;
}
break;