Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1973257 Details for
Bug 2218692
haxe is incompatible with OCaml 5.x
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh89 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for partial OCaml 5.0 compatibility
haxe-ocaml5.patch (text/plain), 54.39 KB, created by
Jerry James
on 2023-06-29 21:07:05 UTC
(
hide
)
Description:
Patch for partial OCaml 5.0 compatibility
Filename:
MIME Type:
Creator:
Jerry James
Created:
2023-06-29 21:07:05 UTC
Size:
54.39 KB
patch
obsolete
>--- haxe-4.3.1/libs/extc/extc.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/extc/extc.ml 2023-06-28 20:07:42.287987004 -0600 >@@ -113,7 +113,7 @@ let input_zip ?(bufsize=65536) ch = > let rec fill_buffer() = > let rec loop pos len = > if len > 0 || pos = 0 then begin >- let r = zlib_inflate z (Bytes.unsafe_to_string tmp_in) pos len tmp_out 0 bufsize (if pos = 0 && len = 0 then Z_FINISH else Z_SYNC_FLUSH) in >+ let r = zlib_inflate z ~src:(Bytes.unsafe_to_string tmp_in) ~spos:pos ~slen:len ~dst:tmp_out ~dpos:0 ~dlen:bufsize (if pos = 0 && len = 0 then Z_FINISH else Z_SYNC_FLUSH) in > Buffer.add_subbytes tmp_buf tmp_out 0 r.z_wrote; > loop (pos + r.z_read) (len - r.z_read); > end >@@ -155,7 +155,7 @@ let output_zip ?(bufsize=65536) ?(level= > let tmp_out = Bytes.create bufsize in > let p = ref 0 in > let rec flush finish = >- let r = zlib_deflate z (Bytes.unsafe_to_string out) 0 !p tmp_out 0 bufsize (if finish then Z_FINISH else Z_SYNC_FLUSH) in >+ let r = zlib_deflate z ~src:(Bytes.unsafe_to_string out) ~spos:0 ~slen:!p ~dst:tmp_out ~dpos:0 ~dlen:bufsize (if finish then Z_FINISH else Z_SYNC_FLUSH) in > ignore(IO.really_output ch tmp_out 0 r.z_wrote); > let remain = !p - r.z_read in > Bytes.blit out r.z_read out 0 remain; >--- haxe-4.3.1/libs/extc/extc_stubs.c.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/extc/extc_stubs.c 2023-06-28 18:07:02.625029675 -0600 >@@ -92,7 +92,7 @@ int Zflush_val(value zflush_val) { > case 4: return Z_FINISH; > // TODO: support Z_BLOCK and Z_TREE > // TODO: append the received value >- default: failwith("Error in `Zflush_val` (extc_stubs.c): Unknown zflush value"); >+ default: caml_failwith("Error in `Zflush_val` (extc_stubs.c): Unknown zflush value"); > } > assert(0); > } >@@ -222,14 +222,14 @@ CAMLprim value zlib_deflate_init2(value > break; > case Z_STREAM_ERROR: > // TODO: use stream->msg to get _zlib_'s text message >- failwith("Error in `zlib_deflate_init2` (extc_stubs.c): call to `deflateInit2` failed: Z_STREAM_ERROR"); >+ caml_failwith("Error in `zlib_deflate_init2` (extc_stubs.c): call to `deflateInit2` failed: Z_STREAM_ERROR"); > break; > case Z_VERSION_ERROR: > // TODO: use stream->msg to get _zlib_'s text message >- failwith("Error in `zlib_deflate_init2` (extc_stubs.c): call to `deflateInit2` failed: Z_VERSION_ERROR"); >+ caml_failwith("Error in `zlib_deflate_init2` (extc_stubs.c): call to `deflateInit2` failed: Z_VERSION_ERROR"); > break; > default: >- failwith("Error in `zlib_deflate_init2` (extc_stubs.c): unknown return code from `deflateInit2`"); >+ caml_failwith("Error in `zlib_deflate_init2` (extc_stubs.c): unknown return code from `deflateInit2`"); > } > assert(0); > } >@@ -275,7 +275,7 @@ CAMLprim value zlib_deflate(value stream > if (deflate_result == Z_OK || deflate_result == Z_STREAM_END) { > stream->next_in = NULL; > stream->next_out = NULL; >- value zresult = alloc_small(3, 0); >+ value zresult = caml_alloc_small(3, 0); > // z_finish > Field(zresult, 0) = Val_bool(deflate_result == Z_STREAM_END); > // z_read >@@ -291,14 +291,14 @@ CAMLprim value zlib_deflate(value stream > break; > case Z_STREAM_ERROR: > // TODO: use stream->msg to get _zlib_'s text message >- failwith("Error in `zlib_deflate` (extc_stubs.c): call to `deflate` failed: Z_STREAM_ERROR"); >+ caml_failwith("Error in `zlib_deflate` (extc_stubs.c): call to `deflate` failed: Z_STREAM_ERROR"); > break; > case Z_BUF_ERROR: > // TODO: use stream->msg to get _zlib_'s text message >- failwith("Error in `zlib_deflate` (extc_stubs.c): call to `deflate` failed: Z_BUF_ERROR"); >+ caml_failwith("Error in `zlib_deflate` (extc_stubs.c): call to `deflate` failed: Z_BUF_ERROR"); > break; > default: >- failwith("Error in `zlib_deflate` (extc_stubs.c): unknown return code from `deflate`"); >+ caml_failwith("Error in `zlib_deflate` (extc_stubs.c): unknown return code from `deflate`"); > } > assert(0); > } >@@ -309,14 +309,14 @@ CAMLprim value zlib_deflate_bytecode(val > > CAMLprim value zlib_deflate_end(value zv) { > if( deflateEnd(ZStreamP_val(zv)) != 0 ) >- failwith("zlib_deflate_end"); >+ caml_failwith("zlib_deflate_end"); > return Val_unit; > } > > CAMLprim value zlib_inflate_init(value wbits) { > value z = zlib_new_stream(); > if( inflateInit2(ZStreamP_val(z),Int_val(wbits)) != Z_OK ) >- failwith("zlib_inflate_init"); >+ caml_failwith("zlib_inflate_init"); > return z; > } > >@@ -330,12 +330,12 @@ CAMLprim value zlib_inflate( value zv, v > z->avail_in = Int_val(slen); > z->avail_out = Int_val(dlen); > if( (r = inflate(z,Int_val(flush))) < 0 ) >- failwith("zlib_inflate"); >+ caml_failwith("zlib_inflate"); > > z->next_in = NULL; > z->next_out = NULL; > >- res = alloc_small(3, 0); >+ res = caml_alloc_small(3, 0); > Field(res, 0) = Val_bool(r == Z_STREAM_END); > Field(res, 1) = Val_int(Int_val(slen) - z->avail_in); > Field(res, 2) = Val_int(Int_val(dlen) - z->avail_out); >@@ -348,7 +348,7 @@ CAMLprim value zlib_inflate_bytecode(val > > CAMLprim value zlib_inflate_end(value zv) { > if( inflateEnd(ZStreamP_val(zv)) != 0 ) >- failwith("zlib_inflate_end"); >+ caml_failwith("zlib_inflate_end"); > return Val_unit; > } > >@@ -368,13 +368,13 @@ CAMLprim value executable_path(value u) > #ifdef _WIN32 > char path[MAX_PATH]; > if( GetModuleFileName(NULL,path,MAX_PATH) == 0 ) >- failwith("executable_path"); >+ caml_failwith("executable_path"); > return caml_copy_string(path); > #elif __APPLE__ > char path[MAXPATHLEN+1]; > uint32_t path_len = MAXPATHLEN; > if ( _NSGetExecutablePath(path, &path_len) ) >- failwith("executable_path"); >+ caml_failwith("executable_path"); > return caml_copy_string(path); > #elif __FreeBSD__ > char path[PATH_MAX]; >@@ -387,7 +387,7 @@ CAMLprim value executable_path(value u) > len = sizeof(path); > error = sysctl(name, 4, path, &len, NULL, 0); > if( error < 0 ) >- failwith("executable_path"); >+ caml_failwith("executable_path"); > return caml_copy_string(path); > #else > char path[PATH_MAX]; >@@ -397,7 +397,7 @@ CAMLprim value executable_path(value u) > if( p != NULL ) > return caml_copy_string(p); > else >- failwith("executable_path"); >+ caml_failwith("executable_path"); > } > path[length] = '\0'; > return caml_copy_string(path); >@@ -408,12 +408,12 @@ CAMLprim value get_full_path( value f ) > #ifdef _WIN32 > char path[MAX_PATH]; > if( GetFullPathName(String_val(f),MAX_PATH,path,NULL) == 0 ) >- failwith("get_full_path"); >+ caml_failwith("get_full_path"); > return caml_copy_string(path); > #else > char path[4096]; > if( realpath(String_val(f),path) == NULL ) >- failwith("get_full_path"); >+ caml_failwith("get_full_path"); > return caml_copy_string(path); > #endif > } >@@ -428,7 +428,7 @@ CAMLprim value get_real_path( value path > > // this will ensure the full class path with proper casing > if( GetFullPathName(String_val(path),MAX_PATH,out,NULL) == 0 ) >- failwith("get_real_path"); >+ caml_failwith("get_real_path"); > > len = strlen(out); > i = 0; >@@ -501,7 +501,7 @@ CAMLprim value sys_time() { > ULARGE_INTEGER ui; > GetSystemTime(&t); > if( !SystemTimeToFileTime(&t,&ft) ) >- failwith("sys_cpu_time"); >+ caml_failwith("sys_cpu_time"); > ui.LowPart = ft.dwLowDateTime; > ui.HighPart = ft.dwHighDateTime; > return caml_copy_double( ((double)ui.QuadPart) / 10000000.0 - EPOCH_DIFF ); >@@ -572,4 +572,4 @@ CAMLprim value sys_filetime( value file > return caml_copy_double(0.); > return caml_copy_double( sbuf.st_mtime ); > # endif >-} >\ No newline at end of file >+} >--- haxe-4.3.1/libs/extc/process_stubs.c.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/extc/process_stubs.c 2023-06-28 18:08:28.088416744 -0600 >@@ -67,10 +67,10 @@ > #define val_null Val_int(0) > #define val_some(v) Field(v,0) > #define val_int(v) Int_val(v) >-#define neko_error() failwith(__FUNCTION__) >+#define neko_error() caml_failwith(__FUNCTION__) > > static value alloc_private( int size ) { >- return alloc((size + sizeof(value) - 1) / sizeof(value), Abstract_tag); >+ return caml_alloc((size + sizeof(value) - 1) / sizeof(value), Abstract_tag); > } > > // --- buffer api >--- haxe-4.3.1/libs/extc/test.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/extc/test.ml 2023-06-28 20:43:33.050524393 -0600 >@@ -35,7 +35,7 @@ let s = Extc.unzip (Extc.zip contents) i > if s <> contents then failwith "zip + unzip failed"; > > let p = Process.run "test" [|"Hello"|] in >-let tmp = String.create 100 in >+let tmp = Bytes.create 100 in > let out = String.sub tmp 0 (Process.read_stdout p tmp 0 100) in > if out <> "Hello" then failwith ("OUT=" ^ out ^ "#"); > let err = String.sub tmp 0 (Process.read_stderr p tmp 0 100) in >@@ -48,4 +48,4 @@ let code = Process.exit p in > if code <> 66 then failwith ("EXIT=" ^ string_of_int code); > Process.close p; > >-prerr_endline "End"; >\ No newline at end of file >+prerr_endline "End"; >--- haxe-4.3.1/libs/extlib-leftovers/uTF8.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/extlib-leftovers/uTF8.ml 2023-06-28 18:09:02.144773118 -0600 >@@ -177,7 +177,7 @@ let rec iter_aux proc s i = > > let iter proc s = iter_aux proc s 0 > >-let compare s1 s2 = Pervasives.compare s1 s2 >+let compare s1 s2 = Stdlib.compare s1 s2 > > exception Malformed_code > >--- haxe-4.3.1/libs/ilib/ilMetaReader.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/ilib/ilMetaReader.ml 2023-06-28 20:09:16.558216743 -0600 >@@ -2346,7 +2346,7 @@ let read_meta_tables pctx header module_ > List.iter (fun s -> > let rva = Int32.add (fst header.clr_meta) (Int32.of_int s.str_offset) in > seek_rva pctx rva; >- match String.lowercase s.str_name with >+ match String.lowercase_ascii s.str_name with > | "#guid" -> > sguid := nread_string i (Int32.to_int s.str_size) > | "#strings" -> >--- haxe-4.3.1/libs/ilib/peReader.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/ilib/peReader.ml 2023-06-28 18:09:26.223317610 -0600 >@@ -25,7 +25,7 @@ open ExtList;; > exception Error_message of string > > type reader_ctx = { >- ch : Pervasives.in_channel; >+ ch : Stdlib.in_channel; > i : IO.input; > verbose : bool; > } >@@ -42,7 +42,7 @@ let seek r pos = > seek_in r.ch pos > > let pos r = >- Pervasives.pos_in r.ch >+ Stdlib.pos_in r.ch > > let info r msg = > if r.verbose then >--- haxe-4.3.1/libs/mbedtls/mbedtls_stubs.c.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/mbedtls/mbedtls_stubs.c 2023-06-28 19:50:09.782750321 -0600 >@@ -200,7 +200,7 @@ CAMLprim value hx_cert_get_alt_names(val > CAMLparam1(chain); > CAMLlocal1(obj); > mbedtls_x509_crt* cert = X509Crt_val(chain); >- if (cert->ext_types & MBEDTLS_X509_EXT_SUBJECT_ALT_NAME == 0 || &cert->subject_alt_names == NULL) { >+ if ((cert->ext_types & MBEDTLS_X509_EXT_SUBJECT_ALT_NAME) == 0 || &cert->subject_alt_names == NULL) { > obj = Atom(0); > } else { > mbedtls_asn1_sequence* cur = &cert->subject_alt_names; >@@ -595,4 +595,4 @@ CAMLprim value hx_get_ssl_transport_flag > const char* names[] = {"SSL_TRANSPORT_STREAM", "SSL_TRANSPORT_DATAGRAM"}; > int values[] = {MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_TRANSPORT_DATAGRAM}; > CAMLreturn(build_fields(sizeof(values) / sizeof(values[0]), names, values)); >-} >\ No newline at end of file >+} >--- haxe-4.3.1/libs/objsize/c_objsize.c.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/objsize/c_objsize.c 2023-06-28 20:02:01.548385636 -0600 >@@ -352,7 +352,7 @@ void c_rec_objsize(value v, size_t depth > > DBG(printf("COL: w %08lx %i\n", v, col)); > >- Hd_val(v) = Coloredhd_hd(hd, Col_blue); >+ ((header_t *)v)[-1] = Coloredhd_hd(hd, Col_blue); > > if (Tag_val(v) < No_scan_tag) > { >@@ -378,7 +378,7 @@ void restore_colors(value v) > > col = readcolor(); > DBG(printf("COL: r %08lx %i\n", v, col)); >- Hd_val(v) = Coloredhd_hd(Hd_val(v), col); >+ ((header_t *)v)[-1] = Coloredhd_hd(Hd_val(v), col); > > if (Tag_val(v) < No_scan_tag) > { >@@ -417,7 +417,7 @@ int c_objsize(value v, value scan, value > head = Field(head,1); > if( col == Col_blue ) continue; > writecolor(col); >- Hd_val(v) = Coloredhd_hd(hd, Col_blue); >+ ((header_t *)v)[-1] = Coloredhd_hd(hd, Col_blue); > } > > acc_data = 0; >@@ -444,7 +444,7 @@ int c_objsize(value v, value scan, value > head = Field(head,1); > if( Colornum_hd(Hd_val(v)) != Col_blue ) continue; > col = readcolor(); >- Hd_val(v) = Coloredhd_hd(Hd_val(v), col); >+ ((header_t *)v)[-1] = Coloredhd_hd(Hd_val(v), col); > } > > while( COND_BLOCK(reach) ) { >--- haxe-4.3.1/libs/ocamake/ocamake.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/ocamake/ocamake.ml 2023-06-28 20:43:50.530195421 -0600 >@@ -45,7 +45,7 @@ let if_some f opt def = > | None -> def > | Some v -> f v > >-let print str = print_endline str; flush Pervasives.stdout >+let print str = print_endline str; flush Stdlib.stdout > > let (???) file = > failwith ("Don't know what to do with file " ^ file) >@@ -68,7 +68,7 @@ let extension file = > in > let file = unescape file in > let s = try snd(rsplit_char file '.') with Not_found -> "" in >- String.uppercase s >+ String.uppercase_ascii s > > let (+!) file suff = > let base = Filename.chop_extension file in >@@ -138,7 +138,7 @@ let print_errors output msg = > let f = open_in file in > for i = 1 to line-1 do ignore(input_line f) done; > seek_in f ((pos_in f)+cmin); >- let s = String.create (cmax - cmin) in >+ let s = Bytes.create (cmax - cmin) in > ignore(input f s 0 (cmax - cmin)); > prerr_endline (try > (String.sub s 0 (String.index s '\n'))^"..." >@@ -653,9 +653,9 @@ match files with > close_out out > with > Failure msg -> >- Pervasives.flush Pervasives.stdout; >+ Stdlib.flush Stdlib.stdout; > prerr_endline msg; >- Pervasives.flush Pervasives.stderr; >+ Stdlib.flush Stdlib.stderr; > exit 1; > > (* ************************************************************************ *) >--- haxe-4.3.1/libs/swflib/swfParser.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/swflib/swfParser.ml 2023-06-28 20:29:10.142765201 -0600 >@@ -444,7 +444,7 @@ and tag_length t = > (* READ PRIMS *) > > let skip ch n = >- seek_in ch ((Pervasives.pos_in ch) + n) >+ seek_in ch ((Stdlib.pos_in ch) + n) > > let read_rgba ch = > let r = read_byte ch in >@@ -605,28 +605,28 @@ let write_gradient ch = function > let write_rect ch r = > let b = output_bits ch in > let nbits = rect_nbits r in >- write_bits b 5 nbits; >- write_bits b nbits r.left; >- write_bits b nbits r.right; >- write_bits b nbits r.top; >- write_bits b nbits r.bottom; >+ write_bits b ~nbits:5 nbits; >+ write_bits b ~nbits:nbits r.left; >+ write_bits b ~nbits:nbits r.right; >+ write_bits b ~nbits:nbits r.top; >+ write_bits b ~nbits:nbits r.bottom; > flush_bits b > > let rec write_multi_bits b n l = > if n <= 30 then > match l with >- | [] -> write_bits b n 0 >- | [x] -> write_bits b n x >+ | [] -> write_bits b ~nbits:n 0 >+ | [x] -> write_bits b ~nbits:n x > | _ -> assert false > else > match l with >- | [] -> write_bits b 30 0; write_multi_bits b (n - 30) [] >- | x :: l -> write_bits b 30 x; write_multi_bits b (n - 30) l >+ | [] -> write_bits b ~nbits:30 0; write_multi_bits b (n - 30) [] >+ | x :: l -> write_bits b ~nbits:30 x; write_multi_bits b (n - 30) l > > let write_big_rect ch r = > let b = output_bits ch in > let nbits = bigrect_nbits r in >- write_bits b 5 nbits; >+ write_bits b ~nbits:5 nbits; > write_multi_bits b nbits r.bleft; > write_multi_bits b nbits r.bright; > write_multi_bits b nbits r.btop; >@@ -637,22 +637,22 @@ let write_matrix ch m = > let b = output_bits ch in > let write_matrix_part m = > let nbits = matrix_part_nbits m in >- write_bits b 5 nbits; >- write_bits b nbits m.mx; >- write_bits b nbits m.my; >+ write_bits b ~nbits:5 nbits; >+ write_bits b ~nbits:nbits m.mx; >+ write_bits b ~nbits:nbits m.my; > in > (match m.scale with > | None -> >- write_bits b 1 0 >+ write_bits b ~nbits:1 0 > | Some s -> >- write_bits b 1 1; >+ write_bits b ~nbits:1 1; > write_matrix_part s > ); > (match m.rotate with > | None -> >- write_bits b 1 0 >+ write_bits b ~nbits:1 0 > | Some r -> >- write_bits b 1 1; >+ write_bits b ~nbits:1 1; > write_matrix_part r); > write_matrix_part m.trans; > flush_bits b >@@ -662,19 +662,19 @@ let write_cxa ch c = > let nbits = cxa_nbits c in > (match c.cxa_add , c.cxa_mult with > | None , None -> >- write_bits b 2 0; >- write_bits b 4 1; (* some strange MM thing... *) >+ write_bits b ~nbits:2 0; >+ write_bits b ~nbits:4 1; (* some strange MM thing... *) > | Some c , None -> >- write_bits b 2 2; >- write_bits b 4 nbits; >+ write_bits b ~nbits:2 2; >+ write_bits b ~nbits:4 nbits; > List.iter (write_bits b ~nbits) [c.r;c.g;c.b;c.a]; > | None , Some c -> >- write_bits b 2 1; >- write_bits b 4 nbits; >+ write_bits b ~nbits:2 1; >+ write_bits b ~nbits:4 nbits; > List.iter (write_bits b ~nbits) [c.r;c.g;c.b;c.a]; > | Some c1 , Some c2 -> >- write_bits b 2 3; >- write_bits b 4 nbits; >+ write_bits b ~nbits:2 3; >+ write_bits b ~nbits:4 nbits; > List.iter (write_bits b ~nbits) [c2.r;c2.g;c2.b;c2.a;c1.r;c1.g;c1.b;c1.a] > ); > flush_bits b >@@ -1617,11 +1617,11 @@ let write_shape_array ch f sl = > > let write_shape_style_change_record ch b nlbits nfbits s = > let flags = make_flags [flag s.scsr_move; flag s.scsr_fs0; flag s.scsr_fs1; flag s.scsr_ls; flag s.scsr_new_styles] in >- write_bits b 6 flags; >+ write_bits b ~nbits:6 flags; > opt (fun (n,dx,dy) -> >- write_bits b 5 n; >- write_bits b n dx; >- write_bits b n dy; >+ write_bits b ~nbits:5 n; >+ write_bits b ~nbits:n dx; >+ write_bits b ~nbits:n dy; > ) s.scsr_move; > opt (write_bits b ~nbits:!nfbits) s.scsr_fs0; > opt (write_bits b ~nbits:!nfbits) s.scsr_fs1; >@@ -1634,45 +1634,45 @@ let write_shape_style_change_record ch b > write_shape_array ch write_shape_line_style s.sns_line_styles; > nfbits := s.sns_nfbits; > nlbits := s.sns_nlbits; >- write_bits b 4 !nfbits; >- write_bits b 4 !nlbits >+ write_bits b ~nbits:4 !nfbits; >+ write_bits b ~nbits:4 !nlbits > > let write_shape_record ch b nlbits nfbits = function > | SRStyleChange s -> > write_shape_style_change_record ch b nlbits nfbits s > | SRCurvedEdge s -> >- write_bits b 2 2; >- write_bits b 4 (s.scer_nbits - 2); >- write_bits b s.scer_nbits s.scer_cx; >- write_bits b s.scer_nbits s.scer_cy; >- write_bits b s.scer_nbits s.scer_ax; >- write_bits b s.scer_nbits s.scer_ay; >+ write_bits b ~nbits:2 2; >+ write_bits b ~nbits:4 (s.scer_nbits - 2); >+ write_bits b ~nbits:s.scer_nbits s.scer_cx; >+ write_bits b ~nbits:s.scer_nbits s.scer_cy; >+ write_bits b ~nbits:s.scer_nbits s.scer_ax; >+ write_bits b ~nbits:s.scer_nbits s.scer_ay; > | SRStraightEdge s -> >- write_bits b 2 3; >- write_bits b 4 (s.sser_nbits - 2); >+ write_bits b ~nbits:2 3; >+ write_bits b ~nbits:4 (s.sser_nbits - 2); > match s.sser_line with > | None , None -> assert false > | None , Some p > | Some p , None -> >- write_bits b 1 0; >- write_bits b 1 (if (fst s.sser_line) = None then 1 else 0); >- write_bits b s.sser_nbits p; >+ write_bits b ~nbits:1 0; >+ write_bits b ~nbits:1 (if (fst s.sser_line) = None then 1 else 0); >+ write_bits b ~nbits:s.sser_nbits p; > | Some dx, Some dy -> >- write_bits b 1 1; >- write_bits b s.sser_nbits dx; >- write_bits b s.sser_nbits dy >+ write_bits b ~nbits:1 1; >+ write_bits b ~nbits:s.sser_nbits dx; >+ write_bits b ~nbits:s.sser_nbits dy > > let write_shape_without_style ch s = > (* write_shape_array ch write_shape_fill_style s.sws_fill_styles; *) > (* write_shape_array ch write_shape_line_style s.sws_line_styles; *) > let r = s in (* s.sws_records in *) > let b = output_bits ch in >- write_bits b 4 r.srs_nfbits; >- write_bits b 4 r.srs_nlbits; >+ write_bits b ~nbits:4 r.srs_nfbits; >+ write_bits b ~nbits:4 r.srs_nlbits; > let nlbits = ref r.srs_nlbits in > let nfbits = ref r.srs_nfbits in > List.iter (write_shape_record ch b nlbits nfbits) r.srs_records; >- (* write_bits b 6 0; *) >+ (* write_bits b ~nbits:6 0; *) > flush_bits b > > let write_shape_with_style ch s = >@@ -1680,12 +1680,12 @@ let write_shape_with_style ch s = > write_shape_array ch write_shape_line_style s.sws_line_styles; > let r = s.sws_records in > let b = output_bits ch in >- write_bits b 4 r.srs_nfbits; >- write_bits b 4 r.srs_nlbits; >+ write_bits b ~nbits:4 r.srs_nfbits; >+ write_bits b ~nbits:4 r.srs_nlbits; > let nlbits = ref r.srs_nlbits in > let nfbits = ref r.srs_nfbits in > List.iter (write_shape_record ch b nlbits nfbits) r.srs_records; >- write_bits b 6 0; >+ write_bits b ~nbits:6 0; > flush_bits b > > let write_shape ch s = >@@ -1721,8 +1721,8 @@ let write_text_record ch t r = > write_byte ch (List.length r.txr_glyphs); > let bits = output_bits ch in > List.iter (fun g -> >- write_bits bits t.txt_ngbits g.txg_index; >- write_bits bits t.txt_nabits g.txg_advanced; >+ write_bits bits ~nbits:t.txt_ngbits g.txg_index; >+ write_bits bits ~nbits:t.txt_nabits g.txg_advanced; > ) r.txr_glyphs; > flush_bits bits > >@@ -2255,4 +2255,4 @@ let init inflate deflate = > > ;; > Swf.__parser := parse; >-Swf.__printer := write >\ No newline at end of file >+Swf.__printer := write >--- haxe-4.3.1/libs/swflib/swfPic.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/swflib/swfPic.ml 2023-06-28 20:08:13.982391822 -0600 >@@ -59,7 +59,7 @@ let load_picture file id = > let len = String.length file in > let p = (try String.rindex file '.' with Not_found -> len) in > let ext = String.sub file (p + 1) (len - (p + 1)) in >- match String.uppercase ext with >+ match String.uppercase_ascii ext with > | "PNG" -> > let png , header, data = (try > let p = Png.parse ch in >--- haxe-4.3.1/libs/ttflib/tTFParser.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/ttflib/tTFParser.ml 2023-06-28 18:10:34.623023659 -0600 >@@ -24,7 +24,7 @@ open TTFData > open IO > > type ctx = { >- file : Pervasives.in_channel; >+ file : Stdlib.in_channel; > ch : input; > mutable entry : entry; > } >--- haxe-4.3.1/libs/ttflib/tTFSwfWriter.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/ttflib/tTFSwfWriter.ml 2023-06-28 20:30:41.237050720 -0600 >@@ -153,14 +153,14 @@ let int_from_langcode lc = > | LCTraditionalChinese -> 5 > > let write_font2 ch b f2 = >- IO.write_bits b 1 (bi true); >- IO.write_bits b 1 (bi f2.font_shift_jis); >- IO.write_bits b 1 (bi f2.font_is_small); >- IO.write_bits b 1 (bi f2.font_is_ansi); >- IO.write_bits b 1 (bi f2.font_wide_offsets); >- IO.write_bits b 1 (bi f2.font_wide_codes); >- IO.write_bits b 1 (bi f2.font_is_italic); >- IO.write_bits b 1 (bi f2.font_is_bold); >+ IO.write_bits b ~nbits:1 (bi true); >+ IO.write_bits b ~nbits:1 (bi f2.font_shift_jis); >+ IO.write_bits b ~nbits:1 (bi f2.font_is_small); >+ IO.write_bits b ~nbits:1 (bi f2.font_is_ansi); >+ IO.write_bits b ~nbits:1 (bi f2.font_wide_offsets); >+ IO.write_bits b ~nbits:1 (bi f2.font_wide_codes); >+ IO.write_bits b ~nbits:1 (bi f2.font_is_italic); >+ IO.write_bits b ~nbits:1 (bi f2.font_is_bold); > IO.write_byte ch (int_from_langcode f2.font_language); > IO.write_byte ch ((String.length f2.font_name) + 1); > IO.nwrite_string ch f2.font_name; >--- haxe-4.3.1/libs/ziplib/zip.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/libs/ziplib/zip.ml 2023-06-28 18:11:12.870300088 -0600 >@@ -62,7 +62,7 @@ type entry = > > type in_file = > { if_filename: string; >- if_channel: Pervasives.in_channel; >+ if_channel: Stdlib.in_channel; > if_entries: entry list; > if_directory: (string, entry) Hashtbl.t; > if_comment: string } >@@ -72,7 +72,7 @@ let comment ifile = ifile.if_comment > > type out_file = > { of_filename: string; >- of_channel: Pervasives.out_channel; >+ of_channel: Stdlib.out_channel; > mutable of_entries: entry list; > of_comment: string } > >@@ -217,7 +217,7 @@ let read_cd filename ic cd_entries cd_of > (* Open a ZIP file for reading *) > > let open_in filename = >- let ic = Pervasives.open_in_bin filename in >+ let ic = Stdlib.open_in_bin filename in > let (cd_entries, cd_size, cd_offset, cd_comment) = read_ecd filename ic in > let entries = > read_cd filename ic cd_entries cd_offset (Int32.add cd_offset cd_size) in >@@ -232,7 +232,7 @@ let open_in filename = > (* Close a ZIP file opened for reading *) > > let close_in ifile = >- Pervasives.close_in ifile.if_channel >+ Stdlib.close_in ifile.if_channel > > (* Return the info associated with an entry *) > >@@ -369,7 +369,7 @@ let open_out ?(comment = "") filename = > if String.length comment >= 0x10000 then > raise(Error(filename, "", "comment too long")); > { of_filename = filename; >- of_channel = Pervasives.open_out_bin filename; >+ of_channel = Stdlib.open_out_bin filename; > of_entries = []; > of_comment = comment } > >@@ -416,7 +416,7 @@ let close_out ofile = > write4_int oc start_cd; (* offset of central dir *) > write2 oc (String.length ofile.of_comment); (* length of comment *) > writestring oc ofile.of_comment; (* comment *) >- Pervasives.close_out oc >+ Stdlib.close_out oc > > (* Write a local file header and return the corresponding entry *) > >@@ -552,9 +552,9 @@ let copy_file_to_entry infilename ofile > with Unix.Unix_error(_,_,_) -> None in > try > copy_channel_to_entry ic ofile ~extra ~comment ~level ?mtime:mtime' name; >- Pervasives.close_in ic >+ Stdlib.close_in ic > with x -> >- Pervasives.close_in ic; raise x >+ Stdlib.close_in ic; raise x > > > (* Add an entry whose content will be produced by the caller *) >--- haxe-4.3.1/src/codegen/dotnet.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/codegen/dotnet.ml 2023-06-28 20:16:01.657597570 -0600 >@@ -68,7 +68,7 @@ let cs_unops = > let netname_to_hx name = > let len = String.length name in > let chr = String.get name 0 in >- String.make 1 (Char.uppercase chr) ^ (String.sub name 1 (len-1)) >+ String.make 1 (Char.uppercase_ascii chr) ^ (String.sub name 1 (len-1)) > > (* -net-lib implementation *) > >@@ -105,7 +105,7 @@ let escape_chars = > > let netcl_to_hx cl = > let cl = if String.length cl > 0 && String.get cl 0 >= 'a' && String.get cl 0 <= 'z' then >- Char.escaped (Char.uppercase (String.get cl 0)) ^ (String.sub cl 1 (String.length cl - 1)) >+ Char.escaped (Char.uppercase_ascii (String.get cl 0)) ^ (String.sub cl 1 (String.length cl - 1)) > else > cl > in >@@ -118,11 +118,11 @@ let netcl_to_hx cl = > let netpath_to_hx std = function > | [],[], cl -> [], netcl_to_hx cl > | ns,[], cl -> >- let ns = (List.map (fun s -> String.lowercase (escape_chars s)) ns) in >+ let ns = (List.map (fun s -> String.lowercase_ascii (escape_chars s)) ns) in > add_cs ns, netcl_to_hx cl > | ns,(nhd :: ntl as nested), cl -> > let nested = List.map (netcl_to_hx) nested in >- let ns = (List.map (fun s -> String.lowercase (escape_chars s)) ns) @ [nhd] in >+ let ns = (List.map (fun s -> String.lowercase_ascii (escape_chars s)) ns) @ [nhd] in > add_cs ns, String.concat "_" nested ^ "_" ^ netcl_to_hx cl > > let lookup_ilclass std com ilpath = >@@ -1277,7 +1277,7 @@ let before_generate com = > > (* net target *) > let net_target = try >- String.lowercase (Common.defined_value com Define.NetTarget) >+ String.lowercase_ascii (Common.defined_value com Define.NetTarget) > with | Not_found -> > "net" > in >@@ -1310,7 +1310,7 @@ let before_generate com = > let rec loop () = > try > let f = Unix.readdir f in >- let finsens = String.lowercase f in >+ let finsens = String.lowercase_ascii f in > if String.ends_with finsens ".dll" then > add_net_lib com (path ^ "/" ^ f) true false (); > loop() >--- haxe-4.3.1/src/codegen/java.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/codegen/java.ml 2023-06-28 20:45:19.713516960 -0600 >@@ -46,7 +46,7 @@ let is_haxe_keyword = function > let jname_to_hx name = > let name = > if name <> "" && (String.get name 0 < 'A' || String.get name 0 > 'Z') then >- Char.escaped (Char.uppercase (String.get name 0)) ^ String.sub name 1 (String.length name - 1) >+ Char.escaped (Char.uppercase_ascii (String.get name 0)) ^ String.sub name 1 (String.length name - 1) > else > name > in >@@ -57,7 +57,7 @@ let normalize_pack pack = > List.map (function > | "" -> "" > | str when String.get str 0 >= 'A' && String.get str 0 <= 'Z' -> >- String.lowercase str >+ String.lowercase_ascii str > | str -> str > ) pack > >@@ -966,7 +966,7 @@ class virtual java_library com name file > if Meta.has Meta.JavaCanonical metas then > List.map (function > | (Meta.JavaCanonical,[EConst (String(cpack,_)), _; EConst(String(cname,_)), _],_) -> >- let did_replace,name = String.replace cname name_original name_replace in >+ let did_replace,name = String.replace ~str:cname ~sub:name_original ~by:name_replace in > if not did_replace then print_endline (cname ^ " -> " ^ name_original ^ " -> " ^ name_replace); > mk_meta name > | m -> m >--- haxe-4.3.1/src/codegen/javaModern.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/codegen/javaModern.ml 2023-06-28 20:16:26.504130256 -0600 >@@ -555,7 +555,7 @@ module PathConverter = struct > let jname_to_hx name = > let name = > if name <> "" && (String.get name 0 < 'A' || String.get name 0 > 'Z') then >- Char.escaped (Char.uppercase (String.get name 0)) ^ String.sub name 1 (String.length name - 1) >+ Char.escaped (Char.uppercase_ascii (String.get name 0)) ^ String.sub name 1 (String.length name - 1) > else > name > in >@@ -576,7 +576,7 @@ module PathConverter = struct > List.map (function > | "" -> "" > | str when String.get str 0 >= 'A' && String.get str 0 <= 'Z' -> >- String.lowercase str >+ String.lowercase_ascii str > | str -> str > ) pack > >@@ -1056,4 +1056,4 @@ class java_library_modern com name file_ > build path > > method get_data = () >-end >\ No newline at end of file >+end >--- haxe-4.3.1/src/codegen/swfLoader.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/codegen/swfLoader.ml 2023-06-28 20:17:17.431172379 -0600 >@@ -33,7 +33,7 @@ let lowercase_pack pack = > let name = > let fchar = String.get name 0 in > if fchar >= 'A' && fchar <= 'Z' then >- (String.make 1 (Char.lowercase fchar)) ^ String.sub name 1 (String.length name - 1) >+ (String.make 1 (Char.lowercase_ascii fchar)) ^ String.sub name 1 (String.length name - 1) > else > name > in >--- haxe-4.3.1/src/compiler/displayProcessing.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/compiler/displayProcessing.ml 2023-06-28 21:12:28.299717078 -0600 >@@ -268,7 +268,7 @@ let maybe_load_display_file_before_typin > > let handle_display_after_typing ctx tctx display_file_dot_path = > let com = ctx.com in >- if ctx.com.display.dms_kind = DMNone & ctx.has_error then raise Abort; >+ if ctx.com.display.dms_kind = DMNone && ctx.has_error then raise Abort; > begin match ctx.com.display.dms_kind,!Parser.delayed_syntax_completion with > | DMDefault,Some(kind,subj) -> DisplayOutput.handle_syntax_completion com kind subj > | _ -> () >@@ -354,4 +354,4 @@ let handle_display_after_finalization ct > DisplayOutput.emit_statistics tctx > | RMNone -> > () >- end >\ No newline at end of file >+ end >--- haxe-4.3.1/src/context/display/displayException.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/context/display/displayException.ml 2023-06-28 20:10:59.484281090 -0600 >@@ -23,7 +23,7 @@ let max_completion_items = ref 0 > let filter_somehow ctx items kind subj = > let subject = match subj.s_name with > | None -> "" >- | Some name-> String.lowercase name >+ | Some name-> String.lowercase_ascii name > in > let subject_length = String.length subject in > let determine_cost s = >@@ -67,7 +67,7 @@ let filter_somehow ctx items kind subj = > let rec loop acc items index = > match items with > | item :: items -> >- let name = String.lowercase (get_filter_name item) in >+ let name = String.lowercase_ascii (get_filter_name item) in > let cost = determine_cost name in > let acc = if cost >= 0 then > (item,index,cost) :: acc >@@ -221,4 +221,4 @@ let to_json ctx de = > | DisplayPackage pack -> > jarray (List.map jstring pack) > | DisplayNoResult -> >- jnull >\ No newline at end of file >+ jnull >--- haxe-4.3.1/src/context/display/documentSymbols.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/context/display/documentSymbols.ml 2023-06-28 20:39:41.613880285 -0600 >@@ -56,7 +56,7 @@ let collect_module_symbols mname with_lo > | FFun f -> > add_field ( > if fst cff_name = "new" then Constructor >- else if ((parent_kind = EnumAbstract or parent_kind = Abstract) && Meta.has_one_of [Meta.Op; Meta.ArrayAccess; Meta.Resolve] cff_meta) then Operator >+ else if ((parent_kind = EnumAbstract || parent_kind = Abstract) && Meta.has_one_of [Meta.Op; Meta.ArrayAccess; Meta.Resolve] cff_meta) then Operator > else Method > ); > if with_locals then func field_parent f >@@ -164,4 +164,4 @@ module Printer = struct > ) [] symbols in > let js = JArray ja in > string_of_json js >-end >\ No newline at end of file >+end >--- haxe-4.3.1/src/context/typecore.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/context/typecore.ml 2023-06-28 20:17:30.143933274 -0600 >@@ -592,7 +592,7 @@ let merge_core_doc ctx mt = > > let field_to_type_path com e = > let rec loop e pack name = match e with >- | EField(e,f,_),p when Char.lowercase (String.get f 0) <> String.get f 0 -> (match name with >+ | EField(e,f,_),p when Char.lowercase_ascii (String.get f 0) <> String.get f 0 -> (match name with > | [] | _ :: [] -> > loop e pack (f :: name) > | _ -> (* too many name paths *) >@@ -604,7 +604,7 @@ let field_to_type_path com e = > let pack, name, sub = match name with > | [] -> > let fchar = String.get f 0 in >- if Char.uppercase fchar = fchar then >+ if Char.uppercase_ascii fchar = fchar then > pack, f, None > else begin > display_error com "A class name must start with an uppercase letter" (snd e); >@@ -654,12 +654,12 @@ let s_field_call_candidate fcc = > let relative_path ctx file = > let slashes path = String.concat "/" (ExtString.String.nsplit path "\\") in > let fpath = slashes (Path.get_full_path file) in >- let fpath_lower = String.lowercase fpath in >+ let fpath_lower = String.lowercase_ascii fpath in > let flen = String.length fpath_lower in > let rec loop = function > | [] -> file > | path :: l -> >- let spath = String.lowercase (slashes path) in >+ let spath = String.lowercase_ascii (slashes path) in > let slen = String.length spath in > if slen > 0 && slen < flen && String.sub fpath_lower 0 slen = spath then String.sub fpath slen (flen - slen) else loop l > in >--- haxe-4.3.1/src/core/error.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/core/error.ml 2023-06-28 20:40:36.524846812 -0600 >@@ -318,7 +318,7 @@ let error_require r p = > "a system platform (php,neko,cpp,etc.)" > else try > if String.sub r 0 5 <> "flash" then raise Exit; >- let _, v = ExtString.String.replace (String.sub r 5 (String.length r - 5)) "_" "." in >+ let _, v = ExtString.String.replace ~str:(String.sub r 5 (String.length r - 5)) ~sub:"_" ~by:"." in > "flash version " ^ v ^ " (use -swf-version " ^ v ^ ")" > with _ -> > "'" ^ r ^ "' to be enabled" >--- haxe-4.3.1/src/core/path.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/core/path.ml 2023-06-28 20:11:41.340493804 -0600 >@@ -223,7 +223,7 @@ end = struct > > let create = > if Globals.is_windows then >- (fun f -> String.lowercase (get_full_path f)) >+ (fun f -> String.lowercase_ascii (get_full_path f)) > else > get_full_path > >@@ -378,7 +378,7 @@ let full_dot_path pack mname tname = > > let file_extension file = > match List.rev (ExtString.String.nsplit file ".") with >- | e :: _ -> String.lowercase e >+ | e :: _ -> String.lowercase_ascii e > | [] -> "" > > module FilePath = struct >@@ -428,4 +428,4 @@ module FilePath = struct > | Some name -> match path.extension with > | None -> name > | Some ext -> name ^ "." ^ ext >-end >\ No newline at end of file >+end >--- haxe-4.3.1/src/dune.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/dune 2023-06-28 20:23:18.322384421 -0600 >@@ -11,7 +11,7 @@ > (libraries > extc extproc extlib_leftovers ilib javalib mbedtls neko objsize pcre2 swflib ttflib ziplib > json >- unix str bigarray threads dynlink >+ unix str bigarray threads dynlink camlp-streams > xml-light extlib ptmap sha > luv > ) >@@ -31,4 +31,4 @@ > (link_flags (:include ../lib.sexp)) > ; Uncomment to enable bytecode output for ocamldebug support > ; (modes byte) >-) >\ No newline at end of file >+) >--- haxe-4.3.1/src/generators/gencpp.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/gencpp.ml 2023-06-28 20:46:10.249565877 -0600 >@@ -499,7 +499,7 @@ let get_code meta key = > let magic_var = "${GENCPP_SOURCE_DIRECTORY}" in > let code = if ExtString.String.exists code magic_var then begin > let source_directory = get_meta_string_full_dirname meta key in >- let _,code = ExtString.String.replace code magic_var source_directory in >+ let _,code = ExtString.String.replace ~str:code ~sub:magic_var ~by:source_directory in > code > end else > code >@@ -7030,8 +7030,8 @@ let write_build_options common_ctx filen > | _ -> write_define name (escape_command value)) defines; > let pin,pid = Process_helper.open_process_args_in_pid "haxelib" [|"haxelib"; "path"; "hxcpp"|] in > set_binary_mode_in pin false; >- write_define "hxcpp" (Pervasives.input_line pin); >- Pervasives.ignore (Process_helper.close_process_in_pid (pin,pid)); >+ write_define "hxcpp" (Stdlib.input_line pin); >+ Stdlib.ignore (Process_helper.close_process_in_pid (pin,pid)); > writer#close;; > > let create_member_types common_ctx = >--- haxe-4.3.1/src/generators/genhl.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/genhl.ml 2023-06-28 20:52:19.852609810 -0600 >@@ -4059,7 +4059,7 @@ let add_types ctx types = > | Method MethNormal when not (List.exists (fun (m,_,_) -> m = Meta.HlNative) f.cf_meta) -> > (match f.cf_expr with > | Some { eexpr = TFunction { tf_expr = { eexpr = TBlock ([] | [{ eexpr = TReturn (Some { eexpr = TConst _ })}]) } } } | None -> >- let name = prefix ^ String.lowercase (Str.global_replace (Str.regexp "[A-Z]+") "_\\0" f.cf_name) in >+ let name = prefix ^ String.lowercase_ascii (Str.global_replace (Str.regexp "[A-Z]+") "_\\0" f.cf_name) in > f.cf_meta <- (Meta.HlNative, [(EConst (String(lib,SDoubleQuotes)),p);(EConst (String(name,SDoubleQuotes)),p)], p) :: f.cf_meta; > | _ -> ()) > | _ -> () >@@ -4149,7 +4149,7 @@ let generate com = > in > > if Path.file_extension com.file = "c" then begin >- let gnames = Array.create (Array.length code.globals) "" in >+ let gnames = Array.make (Array.length code.globals) "" in > PMap.iter (fun n i -> gnames.(i) <- n) ctx.cglobals.map; > if not (Common.defined com Define.SourceHeader) then begin > let version_major = com.version / 1000 in >--- haxe-4.3.1/src/generators/genjvm.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/genjvm.ml 2023-06-28 21:02:29.283121477 -0600 >@@ -263,7 +263,7 @@ module AnnotationHandler = struct > AEnum(object_path_sig path,s) > | ECall(e1, el) -> > let path = parse_path e1 in >- let _,name = ExtString.String.replace (snd path) "." "$" in >+ let _,name = ExtString.String.replace ~str:(snd path) ~sub:"." ~by:"$" in > let path = (fst path, name) in > let values = List.map parse_value_pair el in > AAnnotation(TObject(path, []),values) >@@ -278,7 +278,7 @@ module AnnotationHandler = struct > let parse_expr e = match fst e with > | ECall(e1,el) -> > let path = parse_path e1 in >- let _,name = ExtString.String.replace (snd path) "." "$" in >+ let _,name = ExtString.String.replace ~str:(snd path) ~sub:"." ~by:"$" in > let path = (fst path,name) in > let values = List.map parse_value_pair el in > path,values >--- haxe-4.3.1/src/generators/genphp7.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/genphp7.ml 2023-06-28 20:44:02.994960841 -0600 >@@ -46,7 +46,7 @@ let write_resource dir name data = > *) > let copy_file src dst = > let buffer_size = 8192 in >- let buffer = String.create buffer_size in >+ let buffer = Bytes.create buffer_size in > let fd_in = Unix.openfile src [O_RDONLY] 0 in > let fd_out = Unix.openfile dst [O_WRONLY; O_CREAT; O_TRUNC] 0o644 in > let rec copy_loop () = >@@ -196,7 +196,7 @@ end > (** > Check if specified string is a reserved word in PHP > *) >-let is_keyword str = Hashtbl.mem php_keywords_tbl (String.lowercase str) >+let is_keyword str = Hashtbl.mem php_keywords_tbl (String.lowercase_ascii str) > > (** > Check if specified type is php.NativeArray >@@ -3667,7 +3667,7 @@ class class_builder ctx (cls:tclass) = > List.iter > (fun field -> > if not !required then >- required := (String.lowercase field.cf_name = String.lowercase self#get_name) >+ required := (String.lowercase_ascii field.cf_name = String.lowercase_ascii self#get_name) > ) > (cls.cl_ordered_statics @ cls.cl_ordered_fields); > !required >--- haxe-4.3.1/src/generators/genswf9.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/genswf9.ml 2023-06-28 20:35:46.609303353 -0600 >@@ -645,7 +645,7 @@ let begin_switch ctx = > constructs := (tag,ctx.infos.ipos) :: !constructs; > in > let fend() = >- let cases = Array.create (!max + 1) 1 in >+ let cases = Array.make (!max + 1) 1 in > List.iter (fun (tag,pos) -> Array.set cases tag (pos - switch_pos)) !constructs; > DynArray.set ctx.code switch_index (HSwitch (1,Array.to_list cases)); > branch(); >--- haxe-4.3.1/src/generators/hl2c.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/hl2c.ml 2023-06-28 20:36:13.602795292 -0600 >@@ -1134,7 +1134,7 @@ let make_types_idents htypes = > try > PMap.find vp (!types_descs) > with Not_found -> >- let arr = Array.create (Array.length vp.vfields) ("",DSimple HVoid) in >+ let arr = Array.make (Array.length vp.vfields) ("",DSimple HVoid) in > let td = DVirtual arr in > types_descs := PMap.add vp td (!types_descs); > Array.iteri (fun i (f,_,t) -> arr.(i) <- (f,make_desc t)) vp.vfields; >--- haxe-4.3.1/src/generators/hlinterp.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/generators/hlinterp.ml 2023-06-28 20:48:20.991105272 -0600 >@@ -1111,7 +1111,7 @@ let interp ctx f args = > (match rtype r with > | HEnum e -> > let _, _, fl = e.efields.(f) in >- let vl = Array.create (Array.length fl) VUndef in >+ let vl = Array.make (Array.length fl) VUndef in > set r (VEnum (e, f, vl)) > | _ -> Globals.die "" __LOC__ > ) >@@ -1257,7 +1257,7 @@ let load_native ctx lib name t = > | _ -> Globals.die "" __LOC__) > | "alloc_array" -> > (function >- | [VType t;VInt i] -> VArray (Array.create (int i) (default t),t) >+ | [VType t;VInt i] -> VArray (Array.make (int i) (default t),t) > | _ -> Globals.die "" __LOC__) > | "alloc_obj" -> > (function >@@ -1347,7 +1347,7 @@ let load_native ctx lib name t = > | "math_asin" -> (function [VFloat f] -> VFloat (asin f) | _ -> Globals.die "" __LOC__) > | "math_atan" -> (function [VFloat f] -> VFloat (atan f) | _ -> Globals.die "" __LOC__) > | "math_atan2" -> (function [VFloat a; VFloat b] -> VFloat (atan2 a b) | _ -> Globals.die "" __LOC__) >- | "math_log" -> (function [VFloat f] -> VFloat (Pervasives.log f) | _ -> Globals.die "" __LOC__) >+ | "math_log" -> (function [VFloat f] -> VFloat (Stdlib.log f) | _ -> Globals.die "" __LOC__) > | "math_exp" -> (function [VFloat f] -> VFloat (exp f) | _ -> Globals.die "" __LOC__) > | "math_pow" -> (function [VFloat a; VFloat b] -> VFloat (a ** b) | _ -> Globals.die "" __LOC__) > | "parse_int" -> >@@ -1539,7 +1539,7 @@ let load_native ctx lib name t = > | "Darwin" -> "Mac" > | n -> n > ) in >- Pervasives.ignore (Process_helper.close_process_in_pid (ic, pid)); >+ Stdlib.ignore (Process_helper.close_process_in_pid (ic, pid)); > cached_sys_name := Some uname; > uname) > | "Win32" | "Cygwin" -> "Windows" >@@ -2147,7 +2147,7 @@ let add_code ctx code = > ctx.t_globals <- globals; > (* expand function table *) > let nfunctions = Array.length code.functions + Array.length code.natives in >- let functions = Array.create nfunctions (FNativeFun ("",(fun _ -> Globals.die "" __LOC__),HDyn)) in >+ let functions = Array.make nfunctions (FNativeFun ("",(fun _ -> Globals.die "" __LOC__),HDyn)) in > Array.blit ctx.t_functions 0 functions 0 (Array.length ctx.t_functions); > let rec loop i = > if i = Array.length code.natives then () else >@@ -2191,7 +2191,7 @@ let add_code ctx code = > (* ------------------------------- CHECK ---------------------------------------------- *) > > let check code macros = >- let ftypes = Array.create (Array.length code.natives + Array.length code.functions) HVoid in >+ let ftypes = Array.make (Array.length code.natives + Array.length code.functions) HVoid in > let is_native_fun = Hashtbl.create 0 in > > let check_fun f = >--- haxe-4.3.1/src/macro/eval/evalJit.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/macro/eval/evalJit.ml 2023-06-28 18:12:17.926069396 -0600 >@@ -230,7 +230,7 @@ and jit_expr jit return e = > let hasret = jit_closure.has_nonfinal_return in > let eci = get_env_creation jit_closure false tf.tf_expr.epos.pfile (EKLocalFunction jit.num_closures) in > let captures = Hashtbl.fold (fun vid (i,declared) acc -> (i,vid,declared) :: acc) jit_closure.captures [] in >- let captures = List.sort (fun (i1,_,_) (i2,_,_) -> Pervasives.compare i1 i2) captures in >+ let captures = List.sort (fun (i1,_,_) (i2,_,_) -> Stdlib.compare i1 i2) captures in > (* Check if the out-of-scope var is in the outer scope because otherwise we have to promote outwards. *) > List.iter (fun var -> ignore(get_capture_slot jit var)) jit_closure.captures_outside_scope; > let captures = ExtList.List.filter_map (fun (i,vid,declared) -> >@@ -723,4 +723,4 @@ let jit_expr ctx e = > let f = jit_expr jit false (mk_block e) in > jit,f > in >- jit_timer ctx f >\ No newline at end of file >+ jit_timer ctx f >--- haxe-4.3.1/src/macro/eval/evalLuv.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/macro/eval/evalLuv.ml 2023-06-28 21:04:32.609773520 -0600 >@@ -782,12 +782,12 @@ let buffer_fields = [ > let buffer = decode_buffer v1 > and offset = decode_int v2 > and length = decode_int v3 in >- encode_buffer (Buffer.sub buffer offset length) >+ encode_buffer (Buffer.sub buffer ~offset ~length) > ); > "blit", vfun2 (fun v1 v2 -> > let buffer = decode_buffer v1 > and destination = decode_buffer v2 in >- Buffer.blit buffer destination; >+ Buffer.blit ~source:buffer ~destination; > vnull > ); > "fill", vfun2 (fun v1 v2 -> >@@ -812,21 +812,21 @@ let buffer_fields = [ > let buffer = decode_buffer v1 > and destination = decode_bytes v2 > and offset = decode_int v3 in >- Buffer.blit_to_bytes buffer destination offset; >+ Buffer.blit_to_bytes buffer destination ~destination_offset:offset; > vnull > ); > "blitFromBytes", vfun3 (fun v1 v2 v3 -> > let buffer = decode_buffer v1 > and source = decode_bytes v2 > and offset = decode_int v3 in >- Buffer.blit_from_bytes buffer source offset; >+ Buffer.blit_from_bytes buffer source ~source_offset:offset; > vnull > ); > "blitFromString", vfun3 (fun v1 v2 v3 -> > let buffer = decode_buffer v1 > and source = decode_native_string v2 > and offset = decode_int v3 in >- Buffer.blit_from_string buffer source offset; >+ Buffer.blit_from_string buffer source ~source_offset:offset; > vnull > ); > ] >@@ -1159,7 +1159,7 @@ let stream_fields = [ > "accept", vfun2 (fun v1 v2 -> > let server = decode_stream v1 > and client = decode_stream v2 in >- encode_unit_result (Stream.accept server client) >+ encode_unit_result (Stream.accept ~server ~client) > ); > "readStart", vfun3 (fun v1 v2 v3 -> > let stream = decode_stream v1 >@@ -2445,4 +2445,4 @@ let version_fields = [ > "isRelease", vbool (Version.is_release); > "suffix", encode_string (Version.suffix); > "hex", vint (Version.hex); >-] >\ No newline at end of file >+] >--- haxe-4.3.1/src/macro/eval/evalStdLib.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/macro/eval/evalStdLib.ml 2023-06-28 21:13:04.707023928 -0600 >@@ -289,7 +289,7 @@ module StdBytes = struct > let compare = vifun1 (fun vthis other -> > let this = this vthis in > let other = decode_bytes other in >- vint (Pervasives.compare this other) >+ vint (Stdlib.compare this other) > ) > > let fastGet = vfun2 (fun b pos -> >@@ -555,7 +555,7 @@ module StdCompress = struct > let srcPos = decode_int srcPos in > let dst = decode_bytes dst in > let dstPos = decode_int dstPos in >- let r = try f this.z (Bytes.unsafe_to_string src) srcPos (Bytes.length src - srcPos) dst dstPos (Bytes.length dst - dstPos) this.z_flush with _ -> exc_string "oops" in >+ let r = try f this.z ~src:(Bytes.unsafe_to_string src) ~spos:srcPos ~slen:(Bytes.length src - srcPos) ~dst ~dpos:dstPos ~dlen:(Bytes.length dst - dstPos) this.z_flush with _ -> exc_string "oops" in > encode_obj [ > key_done,vbool r.z_finish; > key_read,vint r.z_read; >@@ -576,7 +576,7 @@ module StdCompress = struct > let level = decode_int level in > let zip = zlib_deflate_init level in > let d = Bytes.make (zlib_deflate_bound zip (Bytes.length s)) (char_of_int 0) in >- let r = zlib_deflate zip (Bytes.unsafe_to_string s) 0 (Bytes.length s) d 0 (Bytes.length d) Z_FINISH in >+ let r = zlib_deflate zip ~src:(Bytes.unsafe_to_string s) ~spos:0 ~slen:(Bytes.length s) ~dst:d ~dpos:0 ~dlen:(Bytes.length d) Z_FINISH in > zlib_deflate_end zip; > if not r.z_finish || r.z_read <> (Bytes.length s) then exc_string "Compression failed"; > encode_bytes (Bytes.sub d 0 r.z_wrote) >@@ -1694,13 +1694,13 @@ module StdMath = struct > let ceil = vfun1 (fun v -> match v with VInt32 _ -> v | _ -> vint32 (to_int (ceil (num v)))) > let cos = vfun1 (fun v -> vfloat (cos (num v))) > let exp = vfun1 (fun v -> vfloat (exp (num v))) >- let fceil = vfun1 (fun v -> vfloat (Pervasives.ceil (num v))) >- let ffloor = vfun1 (fun v -> vfloat (Pervasives.floor (num v))) >+ let fceil = vfun1 (fun v -> vfloat (Stdlib.ceil (num v))) >+ let ffloor = vfun1 (fun v -> vfloat (Stdlib.floor (num v))) > let floor = vfun1 (fun v -> match v with VInt32 _ -> v | _ -> vint32 (to_int (floor (num v)))) >- let fround = vfun1 (fun v -> vfloat (Pervasives.floor (num v +. 0.5))) >+ let fround = vfun1 (fun v -> vfloat (Stdlib.floor (num v +. 0.5))) > let isFinite = vfun1 (fun v -> vbool (match v with VFloat f -> f <> infinity && f <> neg_infinity && f = f | _ -> true)) > let isNaN = vfun1 (fun v -> vbool (match v with VFloat f -> f <> f | VInt32 _ -> false | _ -> true)) >- let log = vfun1 (fun v -> vfloat (Pervasives.log (num v))) >+ let log = vfun1 (fun v -> vfloat (Stdlib.log (num v))) > > let max = vfun2 (fun a b -> > let a = num a in >@@ -1716,7 +1716,7 @@ module StdMath = struct > > let pow = vfun2 (fun a b -> vfloat ((num a) ** (num b))) > let random = vfun0 (fun () -> vfloat (Random.State.float random 1.)) >- let round = vfun1 (fun v -> match v with VInt32 _ -> v | _ -> vint32 (to_int (Pervasives.floor (num v +. 0.5)))) >+ let round = vfun1 (fun v -> match v with VInt32 _ -> v | _ -> vint32 (to_int (Stdlib.floor (num v +. 0.5)))) > let sin = vfun1 (fun v -> vfloat (sin (num v))) > > let sqrt = vfun1 (fun v -> >@@ -2690,7 +2690,7 @@ module StdSys = struct > | "Darwin" -> "Mac" > | n -> n > ) in >- Pervasives.ignore (Process_helper.close_process_in_pid (ic, pid)); >+ Stdlib.ignore (Process_helper.close_process_in_pid (ic, pid)); > cached_sys_name := Some uname; > uname) > | "Win32" | "Cygwin" -> "Windows" >@@ -2736,7 +2736,7 @@ module StdThread = struct > ) > > let kill = vifun0 (fun vthis -> >- Thread.kill (this vthis).tthread; >+ (* Thread.kill (this vthis).tthread; *) > vnull > ) > >@@ -3038,7 +3038,7 @@ module StdUncompress = struct > let buf = Buffer.create 0 in > let tmp = Bytes.make bufsize (char_of_int 0) in > let rec loop pos = >- let r = zlib_inflate zip (Bytes.unsafe_to_string src) pos (Bytes.length src - pos) tmp 0 bufsize Z_SYNC_FLUSH in >+ let r = zlib_inflate zip ~src:(Bytes.unsafe_to_string src) ~spos:pos ~slen:(Bytes.length src - pos) ~dst:tmp ~dpos:0 ~dlen:bufsize Z_SYNC_FLUSH in > Buffer.add_subbytes buf tmp 0 r.z_wrote; > if not r.z_finish then loop (pos + r.z_read) > in >@@ -3064,7 +3064,7 @@ module StdUtf8 = struct > let compare = vfun2 (fun a b -> > let a = decode_string a in > let b = decode_string b in >- vint (Pervasives.compare a b) >+ vint (Stdlib.compare a b) > ) > > let decode = vfun1 (fun s -> >--- haxe-4.3.1/src/optimization/inlineConstructors.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/optimization/inlineConstructors.ml 2023-06-28 21:01:31.940213210 -0600 >@@ -499,7 +499,7 @@ let inline_constructors ctx original_e = > | IOFInlineMethod(io,io_var,c,tl,cf,tf) -> > let argvs, pl = analyze_call_args call_args in > io.io_dependent_vars <- io.io_dependent_vars @ argvs; >- io.io_has_untyped <- io.io_has_untyped or (Meta.has Meta.HasUntyped cf.cf_meta); >+ io.io_has_untyped <- io.io_has_untyped || (Meta.has Meta.HasUntyped cf.cf_meta); > begin match Inline.type_inline ctx cf tf (mk (TLocal io_var.iv_var) (TInst (c,tl)) e.epos) pl e.etype None e.epos true with > | Some e -> > let e = mark_ctors e in >@@ -727,4 +727,4 @@ let inline_constructors ctx original_e = > end > ) !vars; > e >- end >\ No newline at end of file >+ end >--- haxe-4.3.1/src/typing/matcher.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/typing/matcher.ml 2023-06-28 19:47:33.552682360 -0600 >@@ -1461,7 +1461,7 @@ module TexprConverter = struct > in > let s = match unmatched with > | [] -> "_" >- | _ -> String.concat " | " (List.sort Pervasives.compare sl) >+ | _ -> String.concat " | " (List.sort Stdlib.compare sl) > in > typing_error (Printf.sprintf "Unmatched patterns: %s" (s_subject v_lookup s e_subject)) e_subject.epos > >--- haxe-4.3.1/src/typing/typeloadCheck.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/typing/typeloadCheck.ml 2023-06-28 20:12:47.883242235 -0600 >@@ -318,7 +318,7 @@ let check_module_types ctx m p t = > let t = t_infos t in > try > let path2 = ctx.com.type_to_module#find t.mt_path in >- if m.m_path <> path2 && String.lowercase (s_type_path path2) = String.lowercase (s_type_path m.m_path) then typing_error ("Module " ^ s_type_path path2 ^ " is loaded with a different case than " ^ s_type_path m.m_path) p; >+ if m.m_path <> path2 && String.lowercase_ascii (s_type_path path2) = String.lowercase_ascii (s_type_path m.m_path) then typing_error ("Module " ^ s_type_path path2 ^ " is loaded with a different case than " ^ s_type_path m.m_path) p; > let m2 = ctx.com.module_lut#find path2 in > let hex1 = Digest.to_hex m.m_extra.m_sign in > let hex2 = Digest.to_hex m2.m_extra.m_sign in >--- haxe-4.3.1/src/typing/typeloadParse.ml.orig 2023-04-28 13:57:43.000000000 -0600 >+++ haxe-4.3.1/src/typing/typeloadParse.ml 2023-06-28 20:13:03.139955282 -0600 >@@ -102,7 +102,7 @@ let resolve_module_file com m remap p = > with Not_found -> > Common.find_file com (compose_path true) > in >- let file = (match String.lowercase (snd m) with >+ let file = (match String.lowercase_ascii (snd m) with > | "con" | "aux" | "prn" | "nul" | "com1" | "com2" | "com3" | "lpt1" | "lpt2" | "lpt3" when Sys.os_type = "Win32" -> > (* these names are reserved by the OS - old DOS legacy, such files cannot be easily created but are reported as visible *) > if (try (Unix.stat file).Unix.st_size with _ -> 0) > 0 then file else raise Not_found >@@ -347,4 +347,4 @@ let parse_module ctx m p = > > (* let parse_module ctx m p = > let timer = Timer.timer ["typing";"parse_module"] in >- Std.finally timer (parse_module ctx m) p *) >\ No newline at end of file >+ Std.finally timer (parse_module ctx m) p *)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2218692
: 1973257