Deleted Added
sdiff udiff text old ( 121642 ) new ( 160157 )
full compact
1/*
2Copyright (c) 2003 Hewlett-Packard Development Company, L.P.
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the
9Software is furnished to do so, subject to the following
10conditions:

--- 30 unchanged lines hidden (view full) ---

41 bstream->bufp = (unsigned char *) &bstream->buf;
42 bstream->nbuf = 0;
43 bstream->copyin = env->copyin;
44 bstream->cb_token = env->cb_token;
45 bstream->request = request;
46 }
47 else {
48 bstream->source = 0;
49 bstream->bufp = (unsigned char *) source;
50 bstream->nbuf = len;
51 bstream->copyin = 0;
52 bstream->cb_token = 0;
53 bstream->request = 0;
54 }
55 bstream->ntotal = len;
56 bstream->peekc = -1;
57}
58
59
60/* uwx_get_byte: read the next byte from the byte stream */
61
62int uwx_get_byte(struct uwx_bstream *bstream)
63{
64 int len;
65 int n;
66 int b;
67
68 if (bstream->peekc >= 0) {
69 b = bstream->peekc;
70 bstream->peekc = -1;
71 return b;
72 }
73 if (bstream->ntotal <= 0)
74 return -1;

--- 49 unchanged lines hidden (view full) ---

124 val |= (uint64_t)(b & 0x7f) << 63;
125 }
126 if (b & 0x80)
127 return -1;
128 *valp = val;
129 return 0;
130}
131
132#if 0
133int uwx_get_uleb128_alt(struct uwx_bstream *bstream, uint64_t *valp)
134{
135 uint64_t val;
136 int b;
137
138 b = uwx_get_byte(bstream);
139 val = b & 0x7f;
140 if (b & 0x80) {

--- 32 unchanged lines hidden (view full) ---

173 }
174 }
175 }
176 }
177 }
178 *valp = val;
179 return 0;
180}
181#endif