| Anonymous | Login | Signup for a new account | 2013-05-24 01:45 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0000152 | OCaml | OCaml general | public | 2000-07-02 19:12 | 2000-07-03 04:55 | |||
| Reporter | administrator | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | ||||||||
| Target Version | Fixed in Version | |||||||
| Summary | 0000152: Re: problems compiling lablGL-0.94 polymorphic variants | |||||||
| Description | Hi, Thank you for your message to the Caml mailing list. However your message seems to be a bug report; hence I send it to the relevant mailing list caml-bugs@inria.fr Thank again for your interest in Caml. Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/ [^] > proff@foo:/src/caml/lablGL-0.94$ make > ocamlc -c -labels -I /usr/local/lib/ocaml/labltk gl.ml > The implementation gl.ml does not match the interface gl.cmi: > Values do not match: > val format_size : #format[>`luminance_alpha `rgb `rgba] -> int > is not included in > val format_size : #format -> int > make: *** [gl.cmo] Error 2 > proff@foo:/src/caml/lablGL-0.94$ ocamlc -v > The Objective Caml compiler, version 3.00+8 (2000-06-30) > Standard library directory: /usr/local/lib/ocaml | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0000412) administrator (administrator) 2000-07-03 04:54 |
> proff@foo:/src/caml/lablGL-0.94$ make > ocamlc -c -labels -I /usr/local/lib/ocaml/labltk gl.ml > The implementation gl.ml does not match the interface gl.cmi: > Values do not match: > val format_size : #format[>`luminance_alpha `rgb `rgba] -> int > is not included in > val format_size : #format -> int > make: *** [gl.cmo] Error 2 > proff@foo:/src/caml/lablGL-0.94$ ocamlc -v > The Objective Caml compiler, version 3.00+8 (2000-06-30) > Standard library directory: /usr/local/lib/ocaml Such things may happen when you are using bleeding edge versions of the compiler. Polymorphic variant typing has changed a bit, to become safer and more usable in everyday programming. In particular, open matches (matches containing a wild card default) are now given a lower bound, rather than no bound at all. Here is a patch correcting these problems: Index: gl.ml =================================================================== RCS file: /staff2/garrigue/repos/lablGL/gl.ml,v retrieving revision 1.23 diff -u -r1.23 gl.ml --- gl.ml 1999/11/15 09:55:03 1.23 +++ gl.ml 2000/07/03 02:43:26 @@ -19,12 +19,13 @@ type clampf = float type short = int type kind = [`bitmap|`byte|`float|`int|`short|`ubyte|`uint|`ushort] +type real_kind = [`byte|`float|`int|`short|`ubyte|`uint|`ushort] type format = [`alpha|`blue|`color_index|`depth_component|`green|`luminance |`luminance_alpha|`red|`rgb|`rgba|`stencil_index] -let format_size (format : #format) = - match format with +let format_size (#format as f) = + match f with `rgba -> 4 | `rgb -> 3 | `luminance_alpha -> 2 Index: glPix.ml =================================================================== RCS file: /staff2/garrigue/repos/lablGL/glPix.ml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- glPix.ml 2000/04/12 07:40:25 1.6 +++ glPix.ml 2000/06/12 07:27:29 1.7 @@ -4,16 +4,17 @@ type ('a,'b) t = { format: 'a ; width: int ; height:int ; raw: 'b Raw.t } -let create (k : #Gl.kind) ~format ~width ~height = +let create k ~format ~width ~height = let size = format_size format * width * height in - let len = match k with `bitmap -> (size-1)/8+1 | _ -> size in + let len = match k with `bitmap -> (size-1)/8+1 | #Gl.real_kind -> size in let raw = Raw.create k ~len:(width * height * format_size format) in { format = format; width = width; height = height; raw = raw } let of_raw raw ~format ~width ~height = let size = format_size format * width * height and len = Raw.length raw in - let len = match Raw.kind raw with `bitmap -> len * 8 | _ -> len in + let len = + match Raw.kind raw with `bitmap -> len * 8 | #Gl.real_kind -> len in if size > len then invalid_arg "GlPix.of_raw"; { format = format; width = width; height = height; raw = raw } @@ -25,7 +26,7 @@ let raw_pos img = let width = match Raw.kind img.raw with `bitmap -> (img.width-1)/8+1 - | _ -> img.width + | #Gl.real_kind -> img.width in let stride = format_size img.format in let line = stride * width in Index: gluMisc.ml =================================================================== RCS file: /staff2/garrigue/repos/lablGL/gluMisc.ml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- gluMisc.ml 2000/04/12 07:40:25 1.3 +++ gluMisc.ml 2000/06/06 02:15:35 1.4 @@ -29,7 +29,7 @@ format:#Gl.format -> w:int -> h:int -> data:#kind Raw.t -> w:int -> h:int -> data:#kind Raw.t -> unit - = "ml_gluScaleImage" + = "ml_gluScaleImage_bc" "ml_gluScaleImage" let scale_image ~width ~height img = let k = Raw.kind (to_raw img) and format = format img in let new_img = GlPix.create k ~format ~height ~width in Index: gl.mli =================================================================== RCS file: /staff2/garrigue/repos/lablGL/gl.mli,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- gl.mli 1999/11/15 09:55:04 1.17 +++ gl.mli 2000/06/12 07:27:29 1.18 @@ -17,6 +17,7 @@ type clampf = float type short = int type kind = [`bitmap|`byte|`float|`int|`short|`ubyte|`uint|`ushort] +type real_kind = [`byte|`float|`int|`short|`ubyte|`uint|`ushort] type format = [`alpha|`blue|`color_index|`depth_component|`green|`luminance |
|
(0000413) administrator (administrator) 2000-07-03 04:55 |
LablGL to modify. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2005-11-18 10:13 | administrator | New Issue | |
| Copyright © 2000 - 2011 MantisBT Group |