From: <and...@us...> - 2008-12-08 20:58:56
|
Revision: 9059 http://plplot.svn.sourceforge.net/plplot/?rev=9059&view=rev Author: andrewross Date: 2008-12-08 20:58:53 +0000 (Mon, 08 Dec 2008) Log Message: ----------- ANR for Hezekiah M. Carty. Cleanup to make plparseopt option handling consistent with other API functions. Modified Paths: -------------- trunk/bindings/ocaml/plplot.idl trunk/bindings/ocaml/plplot_impl.c trunk/examples/ocaml/x01.ml trunk/examples/ocaml/x02.ml trunk/examples/ocaml/x03.ml trunk/examples/ocaml/x04.ml trunk/examples/ocaml/x05.ml trunk/examples/ocaml/x06.ml trunk/examples/ocaml/x07.ml trunk/examples/ocaml/x08.ml trunk/examples/ocaml/x09.ml trunk/examples/ocaml/x10.ml trunk/examples/ocaml/x11.ml trunk/examples/ocaml/x12.ml trunk/examples/ocaml/x13.ml trunk/examples/ocaml/x15.ml trunk/examples/ocaml/x16.ml trunk/examples/ocaml/x18.ml trunk/examples/ocaml/x19.ml trunk/examples/ocaml/x20.ml trunk/examples/ocaml/x21.ml trunk/examples/ocaml/x22.ml trunk/examples/ocaml/x23.ml trunk/examples/ocaml/x24.ml trunk/examples/ocaml/x25.ml trunk/examples/ocaml/x26.ml trunk/examples/ocaml/x27.ml trunk/examples/ocaml/x28.ml trunk/examples/ocaml/x29.ml trunk/examples/ocaml/x30.ml Modified: trunk/bindings/ocaml/plplot.idl =================================================================== --- trunk/bindings/ocaml/plplot.idl 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/bindings/ocaml/plplot.idl 2008-12-08 20:58:53 UTC (rev 9059) @@ -172,5 +172,5 @@ PL_PARSE_SKIP"); RAW_ML(external plgriddata : float array -> float array -> float array -> float array -> float array -> plplot_grid_method_type -> float -> float array array = "ml_plgriddata_bytecode" "ml_plgriddata") -RAW_ML(external plparseopts : string array -> plplot_parse_method_type array -> int = "ml_plparseopts") +RAW_ML(external plparseopts : string array -> plplot_parse_method_type list -> int = "ml_plparseopts") Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/bindings/ocaml/plplot_impl.c 2008-12-08 20:58:53 UTC (rev 9059) @@ -429,21 +429,21 @@ int i; int result; int argv_length; - int parse_method_length; int combined_parse_method; argv_length = Wosize_val(argv); - parse_method_length = Wosize_val(parse_method); // Make a copy of the command line argument strings const char* argv_copy[argv_length]; for (i = 0; i < argv_length; i++) { argv_copy[i] = String_val( Field(argv, i) ); } - // OR the elements of the parse_method array together - combined_parse_method = Int_val(Field(parse_method, 0)); - for (i = 1; i < parse_method_length; i++) { + // OR the elements of the parse_method list together + combined_parse_method = 0; + while (parse_method != Val_emptylist) { combined_parse_method = combined_parse_method | - translate_parse_option(Int_val(Field(parse_method, i))); + translate_parse_option(Int_val(Field(parse_method, 0))); + // Point to the tail of the list for the next loop + parse_method = Field(parse_method, 1); } result = plparseopts(&argv_length, argv_copy, combined_parse_method); CAMLreturn( Val_int(result) ); Modified: trunk/examples/ocaml/x01.ml =================================================================== --- trunk/examples/ocaml/x01.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x01.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -245,7 +245,7 @@ (* Parse and process command line arguments *) plMergeOpts(options, "x01c options", notes); *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Get version number, just for kicks *) let plplot_version = plgver () in Modified: trunk/examples/ocaml/x02.ml =================================================================== --- trunk/examples/ocaml/x02.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x02.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -129,7 +129,7 @@ let main () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x03.ml =================================================================== --- trunk/examples/ocaml/x03.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x03.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -36,7 +36,7 @@ let y0 = Array.init 361 (fun i -> sin (dtr *. float_of_int i)) in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x04.ml =================================================================== --- trunk/examples/ocaml/x04.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x04.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -81,7 +81,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit(); Modified: trunk/examples/ocaml/x05.ml =================================================================== --- trunk/examples/ocaml/x05.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x05.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -15,7 +15,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x06.ml =================================================================== --- trunk/examples/ocaml/x06.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x06.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -11,7 +11,7 @@ \*--------------------------------------------------------------------------*) let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x07.ml =================================================================== --- trunk/examples/ocaml/x07.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x07.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -15,7 +15,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x08.ml =================================================================== --- trunk/examples/ocaml/x08.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x08.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -85,7 +85,7 @@ let rosen = true in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x09.ml =================================================================== --- trunk/examples/ocaml/x09.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x09.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -249,7 +249,7 @@ let space = [|1500|] in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x10.ml =================================================================== --- trunk/examples/ocaml/x10.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x10.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -10,7 +10,7 @@ \*--------------------------------------------------------------------------*) let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x11.ml =================================================================== --- trunk/examples/ocaml/x11.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x11.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -54,7 +54,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x12.ml =================================================================== --- trunk/examples/ocaml/x12.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x12.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -20,7 +20,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x13.ml =================================================================== --- trunk/examples/ocaml/x13.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x13.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -24,7 +24,7 @@ let per = [|10.0; 32.0; 12.0; 30.0; 16.0|] in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x15.ml =================================================================== --- trunk/examples/ocaml/x15.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x15.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -120,7 +120,7 @@ \*--------------------------------------------------------------------------*) let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Set up color map 1 *) cmap1_init2 (); Modified: trunk/examples/ocaml/x16.ml =================================================================== --- trunk/examples/ocaml/x16.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x16.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -56,7 +56,7 @@ let cont_width = 0 in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display *) plscmap0n 3; Modified: trunk/examples/ocaml/x18.ml =================================================================== --- trunk/examples/ocaml/x18.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x18.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -76,7 +76,7 @@ \*--------------------------------------------------------------------------*) let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x19.ml =================================================================== --- trunk/examples/ocaml/x19.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x19.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -55,7 +55,7 @@ let maxy = 80.0 in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); plinit(); Modified: trunk/examples/ocaml/x20.ml =================================================================== --- trunk/examples/ocaml/x20.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x20.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -105,7 +105,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x21.ml =================================================================== --- trunk/examples/ocaml/x21.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x21.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -102,7 +102,7 @@ let opt = [|0.0; 0.0; wmin; float_of_int knn_order; threshold; 0.0|] in - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x22.ml =================================================================== --- trunk/examples/ocaml/x22.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x22.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -234,7 +234,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x23.ml =================================================================== --- trunk/examples/ocaml/x23.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x23.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -216,7 +216,7 @@ |] let () = - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); plinit (); Modified: trunk/examples/ocaml/x24.ml =================================================================== --- trunk/examples/ocaml/x24.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x24.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -111,7 +111,7 @@ |] let () = - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); plinit (); Modified: trunk/examples/ocaml/x25.ml =================================================================== --- trunk/examples/ocaml/x25.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x25.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -10,7 +10,7 @@ let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plssub 3 3; Modified: trunk/examples/ocaml/x26.ml =================================================================== --- trunk/examples/ocaml/x26.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x26.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -170,7 +170,7 @@ \*--------------------------------------------------------------------------*) let () = (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x27.ml =================================================================== --- trunk/examples/ocaml/x27.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x27.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -93,7 +93,7 @@ (* plplot initialization *) (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x28.ml =================================================================== --- trunk/examples/ocaml/x28.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x28.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -69,7 +69,7 @@ let z = Array.make_matrix xpts ypts 0.0 in (* Parse and process command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); plinit (); Modified: trunk/examples/ocaml/x29.ml =================================================================== --- trunk/examples/ocaml/x29.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x29.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -169,7 +169,7 @@ \*--------------------------------------------------------------------------*) let () = (* Parse command line arguments *) - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); (* Initialize plplot *) plinit (); Modified: trunk/examples/ocaml/x30.ml =================================================================== --- trunk/examples/ocaml/x30.ml 2008-12-08 19:06:27 UTC (rev 9058) +++ trunk/examples/ocaml/x30.ml 2008-12-08 20:58:53 UTC (rev 9059) @@ -43,7 +43,7 @@ let rev = [|false; false|] let () = - ignore (plparseopts Sys.argv [|PL_PARSE_FULL|]); + ignore (plparseopts Sys.argv [PL_PARSE_FULL]); plinit (); plscmap0n 4; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |