@@ -142,29 +142,50 @@ function caml_string_get(s, i) {
142142}
143143
144144//Provides: caml_string_get16
145- //Requires: caml_string_unsafe_get, caml_string_bound_error
145+ //Requires: caml_string_bound_error
146146//Requires: caml_ml_string_length
147+ //Requires: caml_string_get16u
147148function caml_string_get16 ( s , i ) {
148149 if ( i >>> 0 >= caml_ml_string_length ( s ) - 1 ) caml_string_bound_error ( ) ;
150+ return caml_string_get16u ( s , i ) ;
151+ }
152+
153+ //Provides: caml_string_get16u
154+ //Requires: caml_string_unsafe_get
155+ function caml_string_get16u ( s , i ) {
149156 var b1 = caml_string_unsafe_get ( s , i ) ,
150157 b2 = caml_string_unsafe_get ( s , i + 1 ) ;
151158 return ( b2 << 8 ) | b1 ;
152159}
153160
154161//Provides: caml_bytes_get16
155- //Requires: caml_bytes_unsafe_get, caml_bytes_bound_error
162+ //Requires: caml_bytes_bound_error
163+ //Requires: caml_bytes_get16u
156164function caml_bytes_get16 ( s , i ) {
157165 if ( i >>> 0 >= s . l - 1 ) caml_bytes_bound_error ( ) ;
166+ return caml_bytes_get16u ( s , i )
167+ }
168+
169+ //Provides: caml_bytes_get16u
170+ //Requires: caml_bytes_unsafe_get
171+ function caml_bytes_get16u ( s , i ) {
158172 var b1 = caml_bytes_unsafe_get ( s , i ) ,
159173 b2 = caml_bytes_unsafe_get ( s , i + 1 ) ;
160174 return ( b2 << 8 ) | b1 ;
161175}
162176
163177//Provides: caml_string_get32
164- //Requires: caml_string_unsafe_get, caml_string_bound_error
178+ //Requires: caml_string_bound_error
165179//Requires: caml_ml_string_length
180+ //Requires: caml_string_get32u
166181function caml_string_get32 ( s , i ) {
167182 if ( i >>> 0 >= caml_ml_string_length ( s ) - 3 ) caml_string_bound_error ( ) ;
183+ return caml_string_get32u ( s , i ) ;
184+ }
185+
186+ //Provides: caml_string_get32u
187+ //Requires: caml_string_unsafe_get
188+ function caml_string_get32u ( s , i ) {
168189 var b1 = caml_string_unsafe_get ( s , i ) ,
169190 b2 = caml_string_unsafe_get ( s , i + 1 ) ,
170191 b3 = caml_string_unsafe_get ( s , i + 2 ) ,
@@ -173,9 +194,16 @@ function caml_string_get32(s, i) {
173194}
174195
175196//Provides: caml_bytes_get32
176- //Requires: caml_bytes_unsafe_get, caml_bytes_bound_error
197+ //Requires: caml_bytes_bound_error
198+ //Requires: caml_bytes_get32u
177199function caml_bytes_get32 ( s , i ) {
178200 if ( i >>> 0 >= s . l - 3 ) caml_bytes_bound_error ( ) ;
201+ return caml_bytes_get32u ( s , i )
202+ }
203+
204+ //Provides: caml_bytes_get32u
205+ //Requires: caml_bytes_unsafe_get
206+ function caml_bytes_get32u ( s , i ) {
179207 var b1 = caml_bytes_unsafe_get ( s , i ) ,
180208 b2 = caml_bytes_unsafe_get ( s , i + 1 ) ,
181209 b3 = caml_bytes_unsafe_get ( s , i + 2 ) ,
@@ -184,11 +212,18 @@ function caml_bytes_get32(s, i) {
184212}
185213
186214//Provides: caml_string_get64
187- //Requires: caml_string_unsafe_get, caml_string_bound_error
188- //Requires: caml_int64_of_bytes
215+ //Requires: caml_string_bound_error
189216//Requires: caml_ml_string_length
217+ //Requires: caml_string_get64u
190218function caml_string_get64 ( s , i ) {
191219 if ( i >>> 0 >= caml_ml_string_length ( s ) - 7 ) caml_string_bound_error ( ) ;
220+ return caml_string_get64u ( s , i ) ;
221+ }
222+
223+ //Provides: caml_string_get64u
224+ //Requires: caml_string_unsafe_get
225+ //Requires: caml_int64_of_bytes
226+ function caml_string_get64u ( s , i ) {
192227 var a = new Array ( 8 ) ;
193228 for ( var j = 0 ; j < 8 ; j ++ ) {
194229 a [ 7 - j ] = caml_string_unsafe_get ( s , i + j ) ;
@@ -197,10 +232,17 @@ function caml_string_get64(s, i) {
197232}
198233
199234//Provides: caml_bytes_get64
200- //Requires: caml_bytes_unsafe_get, caml_bytes_bound_error
201- //Requires: caml_int64_of_bytes
235+ //Requires: caml_bytes_bound_error
236+ //Requires: caml_bytes_get64u
202237function caml_bytes_get64 ( s , i ) {
203238 if ( i >>> 0 >= s . l - 7 ) caml_bytes_bound_error ( ) ;
239+ return caml_bytes_get64u ( s , i )
240+ }
241+
242+ //Provides: caml_bytes_get64u
243+ //Requires: caml_bytes_unsafe_get
244+ //Requires: caml_int64_of_bytes
245+ function caml_bytes_get64u ( s , i ) {
204246 var a = new Array ( 8 ) ;
205247 for ( var j = 0 ; j < 8 ; j ++ ) {
206248 a [ 7 - j ] = caml_bytes_unsafe_get ( s , i + j ) ;
@@ -231,9 +273,16 @@ function caml_string_set(s, i, c) {
231273}
232274
233275//Provides: caml_bytes_set16
234- //Requires: caml_bytes_bound_error, caml_bytes_unsafe_set
276+ //Requires: caml_bytes_bound_error
277+ //Requires: caml_bytes_set16u
235278function caml_bytes_set16 ( s , i , i16 ) {
236279 if ( i >>> 0 >= s . l - 1 ) caml_bytes_bound_error ( ) ;
280+ return caml_bytes_set16u ( s , i , i16 ) ;
281+ }
282+
283+ //Provides: caml_bytes_set16u
284+ //Requires: caml_bytes_unsafe_set
285+ function caml_bytes_set16u ( s , i , i16 ) {
237286 var b2 = 0xff & ( i16 >> 8 ) ,
238287 b1 = 0xff & i16 ;
239288 caml_bytes_unsafe_set ( s , i + 0 , b1 ) ;
@@ -242,9 +291,16 @@ function caml_bytes_set16(s, i, i16) {
242291}
243292
244293//Provides: caml_bytes_set32
245- //Requires: caml_bytes_bound_error, caml_bytes_unsafe_set
294+ //Requires: caml_bytes_bound_error
295+ //Requires: caml_bytes_set32u
246296function caml_bytes_set32 ( s , i , i32 ) {
247297 if ( i >>> 0 >= s . l - 3 ) caml_bytes_bound_error ( ) ;
298+ return caml_bytes_set32u ( s , i , i32 ) ;
299+ }
300+
301+ //Provides: caml_bytes_set32u
302+ //Requires: caml_bytes_unsafe_set
303+ function caml_bytes_set32u ( s , i , i32 ) {
248304 var b4 = 0xff & ( i32 >> 24 ) ,
249305 b3 = 0xff & ( i32 >> 16 ) ,
250306 b2 = 0xff & ( i32 >> 8 ) ,
@@ -257,10 +313,17 @@ function caml_bytes_set32(s, i, i32) {
257313}
258314
259315//Provides: caml_bytes_set64
260- //Requires: caml_bytes_bound_error, caml_bytes_unsafe_set
261- //Requires: caml_int64_to_bytes
316+ //Requires: caml_bytes_bound_error
317+ //Requires: caml_bytes_set64u
262318function caml_bytes_set64 ( s , i , i64 ) {
263319 if ( i >>> 0 >= s . l - 7 ) caml_bytes_bound_error ( ) ;
320+ return caml_bytes_set64u ( s , i , i64 ) ;
321+ }
322+
323+ //Provides: caml_bytes_set64u
324+ //Requires: caml_bytes_unsafe_set
325+ //Requires: caml_int64_to_bytes
326+ function caml_bytes_set64u ( s , i , i64 ) {
264327 var a = caml_int64_to_bytes ( i64 ) ;
265328 for ( var j = 0 ; j < 8 ; j ++ ) {
266329 caml_bytes_unsafe_set ( s , i + 7 - j , a [ j ] ) ;
0 commit comments