History

Use 4.14 alpha1 and fix the fallout

malc committed 4 years ago

Commit 21ca13a1 parent 59c9db73 files · +32 −33Browse files

Unified · Split

3 files
  1. build.bash +2 −2
  2. lablGL/ml_gl.c +6 −6
  3. lablGL/ml_raw.c +24 −25
build.bash+2−2
@@ -104,8 +104,8 @@ mflags() { · 103 unmodified lines
104104 }
105105
106106 overs=$(ocamlc -vnum 2>/dev/null) || overs=""
107−if test "$overs" != "4.13.1"; then
108− url=https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.1.tar.xz
107+if test "$overs" != "4.14.0~alpha1"; then
108+ url=https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~alpha1.tar.xz
109109 txz=$outd/$(basename $url)
110110 keycmd="printf $url; digest $txz;"
111111 isfresh $txz "$(eval $keycmd)" || {
lablGL/ml_gl.c+6−6
@@ -32,17 +32,17 @@ void ml_raise_gl(const char *errmsg) · 31 unmodified lines
3232 static value const * gl_exn;
3333 if (gl_exn == NULL)
3434 gl_exn = caml_named_value("glerror");
35− raise_with_string(*gl_exn, (char*)errmsg);
35+ caml_raise_with_string(*gl_exn, (char*)errmsg);
3636 }
3737
3838 value copy_string_check (const char *str)
3939 {
4040 if (!str) ml_raise_gl("Null string");
41− return copy_string ((char*) str);
41+ return caml_copy_string ((char*) str);
4242 }
4343
4444 struct record {
45− value key;
45+ value key;
4646 GLenum data;
4747 };
4848
@@ -59,7 +59,7 @@ CAMLprim value ml_gl_make_table (value unit) · 10 unmodified lines
5959 int i;
6060 unsigned int hash;
6161
62− tag_table = stat_alloc (TABLE_SIZE * sizeof(struct record));
62+ tag_table = caml_stat_alloc (TABLE_SIZE * sizeof(struct record));
6363 memset ((char *) tag_table, 0, TABLE_SIZE * sizeof(struct record));
6464 for (i = 0; i < TAG_NUMBER; i++) {
6565 hash = (unsigned long) input_table[i].key % TABLE_SIZE;
@@ -266,7 +266,7 @@ CAMLprim value ml_glLight (value n, value param) /* ML */ · 200 unmodified lines
266266 float params[4];
267267 int i;
268268
269− if (Int_val(n) >= GL_MAX_LIGHTS) invalid_argument ("Gl.light");
269+ if (Int_val(n) >= GL_MAX_LIGHTS) caml_invalid_argument ("Gl.light");
270270 switch (Field(param,0))
271271 {
272272 case MLTAG_ambient:
@@ -712,7 +712,7 @@ CAMLprim value ml_glCallLists (value indexes) /* ML */ · 439 unmodified lines
712712
713713 switch (Field(indexes,0)) {
714714 case MLTAG_byte:
715− glCallLists (string_length(Field(indexes,1)),
715+ glCallLists (caml_string_length(Field(indexes,1)),
716716 GL_UNSIGNED_BYTE,
717717 String_val(Field(indexes,1)));
718718 break;
lablGL/ml_raw.c+24−25
@@ -16,8 +16,7 @@ · 15 unmodified lines
1616 #define SIZE_FLOAT sizeof(float)
1717 #define SIZE_DOUBLE sizeof(double)
1818
19−extern void invalid_argument (char *) Noreturn;
20−extern void raise_out_of_memory (void) Noreturn;
19+extern void caml_invalid_argument (char *) Noreturn;
2120
2221 static int raw_sizeof (value kind)
2322 {
@@ -52,7 +51,7 @@ static void check_size (value raw, long pos, char *msg) · 28 unmodified lines
5251 {
5352 if (pos < 0 ||
5453 (pos+1) * raw_sizeof(Kind_raw(raw)) > Int_val(Size_raw(raw)))
55− invalid_argument (msg);
54+ caml_invalid_argument (msg);
5655 }
5756
5857 CAMLprim value ml_raw_get (value raw, value pos) /* ML */
@@ -89,8 +88,8 @@ CAMLprim value ml_raw_read (value raw, value pos, value len) /* ML */ · 30 unmodified lines
8988 value ret;
9089
9190 check_size (raw,s+l-1,"Raw.read");
92− if (l<0 || s<0) invalid_argument("Raw.read");
93− ret = alloc_shr (l, 0);
91+ if (l<0 || s<0) caml_invalid_argument("Raw.read");
92+ ret = caml_alloc_shr (l, 0);
9493 switch (Kind_raw(raw)) {
9594 case MLTAG_bitmap:
9695 case MLTAG_ubyte:
@@ -161,8 +160,8 @@ CAMLprim value ml_raw_read_string (value raw, value pos, value len) /* ML */ · 64 unmodified lines
161160 value ret;
162161
163162 if (l<0 || s<0 || s+l > Int_val(Size_raw(raw)))
164− invalid_argument("Raw.read_string");
165− ret = alloc_string (l);
163+ caml_invalid_argument("Raw.read_string");
164+ ret = caml_alloc_string (l);
166165 memcpy (Bp_val(ret), Bp_val(Addr_raw(raw))+s, l);
167166 CAMLreturn(ret);
168167 }
@@ -170,10 +169,10 @@ CAMLprim value ml_raw_read_string (value raw, value pos, value len) /* ML */ · 1 unmodified line
170169 CAMLprim value ml_raw_write_string (value raw, value pos, value data) /* ML */
171170 {
172171 int s = Int_val(pos);
173− int l = string_length(data);
172+ int l = caml_string_length(data);
174173
175174 if (s<0 || s+l > Int_val(Size_raw(raw)))
176− invalid_argument("Raw.write_string");
175+ caml_invalid_argument("Raw.write_string");
177176 memcpy (Bp_val(Addr_raw(raw))+s, String_val(data), l);
178177 return Val_unit;
179178 }
@@ -215,7 +214,7 @@ CAMLprim value ml_raw_write (value raw, value pos, value data) /* ML */ · 35 unmodified lines
215214 int i, l = Wosize_val(data);
216215
217216 check_size (raw,s+l-1,"Raw.write");
218− if (s<0) invalid_argument("Raw.write");
217+ if (s<0) caml_invalid_argument("Raw.write");
219218
220219 switch (Kind_raw(raw)) {
221220 case MLTAG_bitmap:
@@ -273,9 +272,9 @@ CAMLprim value ml_raw_get_float (value raw, value pos) /* ML */ · 51 unmodified lines
273272
274273 check_size (raw,i,"Raw.get_float");
275274 if (Kind_raw(raw) == MLTAG_float)
276− return copy_double ((double) Float_raw(raw)[i]);
275+ return caml_copy_double ((double) Float_raw(raw)[i]);
277276 else
278− return copy_double (Double_raw(raw)[i]);
277+ return caml_copy_double (Double_raw(raw)[i]);
279278 }
280279
281280 CAMLprim value ml_raw_read_float (value raw, value pos, value len) /* ML */
@@ -285,8 +284,8 @@ CAMLprim value ml_raw_read_float (value raw, value pos, value len) /* ML */ · 3 unmodified lines
285284 value ret = Val_unit;
286285
287286 check_size (raw,s+l-1,"Raw.read_float");
288− if (l<0 || s<0) invalid_argument("Raw.read_float");
289− ret = alloc_shr (l*sizeof(double)/sizeof(value), Double_array_tag);
287+ if (l<0 || s<0) caml_invalid_argument("Raw.read_float");
288+ ret = caml_alloc_shr (l*sizeof(double)/sizeof(value), Double_array_tag);
290289 if (Kind_raw(raw) == MLTAG_float) {
291290 float *float_raw = Float_raw(raw)+s;
292291 for (i = 0; i < l; i++)
@@ -317,7 +316,7 @@ CAMLprim value ml_raw_write_float (value raw, value pos, value data) /* ML */ · 24 unmodified lines
317316 int i, l = Wosize_val(data)*sizeof(value)/sizeof(double);
318317
319318 check_size (raw,s+l-1,"Raw.write_float");
320− if (s<0) invalid_argument("Raw.write_float");
319+ if (s<0) caml_invalid_argument("Raw.write_float");
321320 if (Kind_raw(raw) == MLTAG_float) {
322321 float *float_raw = Float_raw(raw)+s;
323322 for (i = 0; i < l; i++)
@@ -428,10 +427,10 @@ CAMLprim value ml_raw_get_long (value raw, value pos) /* ML */ · 104 unmodified lines
428427 switch (Kind_raw(raw)) {
429428 case MLTAG_int:
430429 case MLTAG_uint:
431− return copy_nativeint (Int_raw(raw)[i]);
430+ return caml_copy_nativeint (Int_raw(raw)[i]);
432431 case MLTAG_long:
433432 case MLTAG_ulong:
434− return copy_nativeint (Long_raw(raw)[i]);
433+ return caml_copy_nativeint (Long_raw(raw)[i]);
435434 }
436435 return Val_unit;
437436 }
@@ -463,10 +462,10 @@ CAMLprim value ml_raw_alloc (value kind, value len) /* ML */ · 25 unmodified lines
463462 int offset = 0;
464463
465464 if (kind == MLTAG_double && sizeof(double) > sizeof(value)) {
466− data = alloc_shr ((size-1)/sizeof(value)+2, Abstract_tag);
465+ data = caml_alloc_shr ((size-1)/sizeof(value)+2, Abstract_tag);
467466 offset = (data % sizeof(double) ? sizeof(value) : 0);
468− } else data = alloc_shr ((size-1)/sizeof(value)+1, Abstract_tag);
469− raw = alloc_small (SIZE_RAW,0);
467+ } else data = caml_alloc_shr ((size-1)/sizeof(value)+1, Abstract_tag);
468+ raw = caml_alloc_small (SIZE_RAW,0);
470469 Kind_raw(raw) = kind;
471470 Size_raw(raw) = Val_int(size);
472471 Base_raw(raw) = data;
@@ -483,10 +482,10 @@ CAMLprim value ml_raw_alloc_static (value kind, value len) /* ML */ · 10 unmodified lines
483482 int offset = 0;
484483
485484 if (kind == MLTAG_double && sizeof(double) > sizeof(long)) {
486− data = stat_alloc (size+sizeof(long));
485+ data = caml_stat_alloc (size+sizeof(long));
487486 offset = ((long)data % sizeof(double) ? sizeof(value) : 0);
488− } else data = stat_alloc (size);
489− raw = alloc_small (SIZE_RAW, 0);
487+ } else data = caml_stat_alloc (size);
488+ raw = caml_alloc_small (SIZE_RAW, 0);
490489 Kind_raw(raw) = kind;
491490 Size_raw(raw) = Val_int(size);
492491 Base_raw(raw) = (value) data;
@@ -497,8 +496,8 @@ CAMLprim value ml_raw_alloc_static (value kind, value len) /* ML */ · 4 unmodified lines
497496
498497 CAMLprim value ml_raw_free_static (value raw) /* ML */
499498 {
500− if (Static_raw(raw) != Val_int(1)) invalid_argument ("Raw.free_static");
501− stat_free (Void_raw(raw));
499+ if (Static_raw(raw) != Val_int(1)) caml_invalid_argument ("Raw.free_static");
500+ caml_stat_free (Void_raw(raw));
502501 Base_raw(raw) = Val_unit;
503502 Size_raw(raw) = Val_unit;
504503 Offset_raw(raw) = Val_unit;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t