Commits

camlspotter  committed c35d170

cleanup for warnings

  • Participants
  • Parent commits 10632f2

Comments (0)

Files changed (11)

File examples/gifanim/gifanim.ml

 open Guienv;;
 
 open Gdk;;
-open GDraw;;
 open GMain;;
 
 open Gif;;
 prerr_endline "first call";
 
 let id = ref None in
-id := Some (window#event#connect#configure ~callback: (fun ev ->
+id := Some (window#event#connect#configure ~callback: (fun _ev ->
     begin match !id with
     | Some id -> window#misc#disconnect id
     | None -> ()

File examples/gifanim/guienv.ml

 (* $Id: guienv.ml,v 1.6.2.1 2010/05/13 13:36:09 furuse Exp $ *)
 
 open Gdk;;
-open GDraw;;
 open GMain;;
 
 GtkMain.Main.init ();;

File examples/liv/OMakefile

   jpf
   liv
   livmisc
-  livsh
+#  livsh
   livshtype
   mylazy
   pathfind

File examples/liv/cache.ml

       | Some elt ->
           match !found with
           | None -> found := Some (i, Some elt)
-          | Some (j, Some elt') when elt.time < elt'.time ->
+          | Some (_j, Some elt') when elt.time < elt'.time ->
             found := Some (i, Some elt)
           | _ -> ()
     done

File examples/liv/display.ml

     pixbuf'
   end else old
 
-let create_pixbuf (id : int) image filters =
+let create_pixbuf (_id : int) image filters =
   let pixbuf = Imagegdk.to_pixbuf image in
   let filters = sort_filters filters in
   let rec filter_pixbuf pixbuf = function
     | [] -> pixbuf
-    | `SIZE (w, h, cond) :: fs -> 
+    | `SIZE (w, h, cond) :: _fs -> 
 	(* original pixbuf will be GC'ed automatically *)
 	resize w h cond pixbuf
   in

File examples/liv/gui.ml

 class new_progress_bar obj = object
   inherit GRange.progress_bar obj as super
   val mutable previous = 0.0
-  method set_fraction x =
+  method! set_fraction x =
     let x = floor (x *. 10.0) /. 10.0 in
     if x <> previous then begin 
       super#set_fraction x; sync (); previous <- x 
 class prog_nop = object
   method map () = ()
   method unmap () = ()
-  method set_text (s : string) = ()
-  method set_fraction (s : float) = ()
+  method set_text (_s : string) = ()
+  method set_fraction (_s : float) = ()
 end
 
 class prog (p : GRange.progress_bar) = object

File examples/liv/icon.ml

   (* prerr_endline ("thumbdir: " ^ thumbdir); *)
   if not (Sys.file_exists thumbdir) then Unix.mkdir thumbdir 0o755;
 
-  let format, hdrs = Images.file_format name in
+  let format, _hdrs = Images.file_format name in
   let w, h, img =
     match format with
     | Jpeg ->
   (* prerr_endline ("thumbdir: " ^ thumbdir); *)
   if not (Sys.file_exists thumbdir) then Unix.mkdir thumbdir 0o755;
 
-  let format, hdrs = Images.file_format name in
+  let format, _hdrs = Images.file_format name in
   let w, h, img =
     match format with
     | Jpeg ->

File examples/liv/jWidget.ml

     p
   in
 
-  object (self)
+  object 
   inherit GObj.widget hbox#as_widget
 
   method set_text = label#set_text
     | Some id -> 
 	Timeout.remove id; timeout <- None;
 	begin match pix, frames with
-	| Some pix, Some ((img,wait)::_) -> pix#set_pixmap img; Gui.sync ()
+	| Some pix, Some ((img,_wait)::_) -> pix#set_pixmap img; Gui.sync ()
 	| _ -> ()
 	end
     | None -> ()

File examples/liv/jpf.ml

   q, enhanced, checked;;
 
 let get_flags file =
-  let body, ext = Images.get_extension file in
+  let body, _ext = Images.get_extension file in
   try
     let pos = String.rindex body '~' in
     let flag_str = String.sub body (pos+1) (String.length body - (pos+1)) in

File examples/liv/liv.ml

 ;;
 *)
 
+
+let _ = prerr_endline "init done";;
+
 module D = Display
 open D
 
      "-Check", Arg.Unit (fun () -> check := true; gcheck := true), 
        ": ground check mode";
      "-x", Arg.Unit (fun () -> xmode := `x), ": x mode";
+     "-XXX", Arg.Unit (fun () -> xmode := `XXX), ": x mode";
      "-X", Arg.Unit (fun () -> xmode := `X), ": X mode";
      "-_", Arg.Unit (fun () -> xmode := `u), ": -_ mode";
      "--_", Arg.Unit (fun () -> xmode := `u), ": -_ mode";
 	      try 
 		ignore (guess_extension (snd (Livmisc.get_extension f)));
 		fs := f :: !fs;
-	      with e -> (* prerr_endline ((f^": "^ Printexc.to_string e)) *) ()) f
+	      with _e -> (* prerr_endline ((f^": "^ Printexc.to_string e)) *) ()) f
 	| _ -> fs := f :: !fs
       with
       | _ -> prerr_endline ("ERROR: " ^ f)) !files;
 
     let f = 
       if !gcheck && files.(!cur) = f then begin
-	let xlevel, enhanced, checked = Jpf.get_flags files.(!cur) in
+	let xlevel, enhanced, _checked = Jpf.get_flags files.(!cur) in
 	let newname = Jpf.set_flags files.(!cur) (xlevel,enhanced,true) in
 	if files.(!cur) <> newname then begin
 	  rename !cur newname
 	if Filename.dirname disp_file = Filename.dirname cur_file then
 	  raise Skipped
     | None ->
-        let xlevel, enhanced, checked = Jpf.get_flags files.(!cur) in
+        let xlevel, _enhanced, checked = Jpf.get_flags files.(!cur) in
         if !gcheck && checked then raise Skipped;
         match !xmode with
         | `n -> ()
     	  | _ -> 100
     	in
     	if Random.int 100 < perc then () else raise Skipped
+        | `XXX ->
+(*
+    	let imgs = Array.length files in
+*)
+    	let perc = 
+              if xlevel < 0 then 0 else  
+    	  match xlevel with
+    	    0 | 1 -> 1
+          | 2 -> 10
+    	  | _ -> 100
+    	in
+    	if Random.int 100 < perc then () else raise Skipped
         | `X ->
     	let perc = 
               if xlevel < 0 then 0 else  
       | "P" | "B" -> prev (Some `DIR)
 (*/JPF*)
       | "q" -> Main.quit ()
+(*
       | "v" -> 
 	(* liv visual shell *)
   	  let rec func = fun file typ ->
 	    end else dirname
 	  in
 	  ignore (new Livsh.livsh dirname func)
+*)
 (*JPF*)
       | "e" -> 
 	  if !check then begin
 	    let name = files.(!disp_cur) in
-	    let xlevel,enhance,checked = Jpf.get_flags name in
+	    let _xlevel,enhance,checked = Jpf.get_flags name in
             let xlevel' = -1 in
             let newname = Jpf.set_flags name (xlevel',enhance,checked) in
 	    if name <> newname then begin
     ignore (window#event#connect#key_press ~callback: callback);
     ignore (infowindow#event#connect#key_press ~callback: callback);
 
-    ignore (imglist#connect#select_row ~callback: (fun ~row ~column ~event ->
+    ignore (imglist#connect#select_row ~callback: (fun ~row ~column:_ ~event:_ ->
       if !cur <> row then begin
       	cur := row;
       	display_image false files.(!cur)
 
   let starter = ref None in
 
-  starter := Some (window#event#connect#configure ~callback: (fun ev ->
+  starter := Some (window#event#connect#configure ~callback: (fun _ev ->
     may window#misc#disconnect !starter;
     if Array.length files <> 0 then begin
       cur := 0;

File examples/liv/livsh.ml

       ~packing: (vbox#pack ~expand: false ~fill: false)
       ~show: true () as status_bar
 
-  method activate () = joe#start_rotate; status_bar#activate ()
+  method! activate () = joe#start_rotate; status_bar#activate ()
   method deactivate () = joe#stop_rotate; status_bar#set_fraction 0.0
 
   val mutable dir = init_dir
       let x = ref 0 and y = ref 0 in
       let positions =
         List.map
-          (fun item ->
+          (fun _item ->
              let px = !x and py = !y in
              if !mx < !x + button_width then mx := !x + button_width;
              if !my < !y + button_height + label_height
 
       List.iter2
         (fun item (x,y) ->
-           let ix, iy = item#position in
+           let ix, _iy = item#position in
            if ix < 0
            then fixed#put item#coerce ~x ~y
            else fixed#move item#coerce ~x ~y;