Skip to content

Commit 7eea000

Browse files
committed
CHJ:LIB: fix warnings and reformat
1 parent 1a2a2ca commit 7eea000

File tree

3 files changed

+40
-37
lines changed

3 files changed

+40
-37
lines changed

CodeHawk/CHJ/jchlib/jCHBasicTypesAPI.mli

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ type java_basic_type_t =
9595

9696
class type class_name_int =
9797
object ('a)
98-
method compare : 'a -> int
99-
method equal : 'a -> bool
100-
method index : int
101-
method name : string
102-
method package : string list
98+
method compare: 'a -> int
99+
method equal: 'a -> bool
100+
method index: int
101+
method name: string
102+
method package: string list
103103
method abbreviated_package_name: string
104104
method package_name: string
105-
method simple_name : string
105+
method simple_name: string
106106
method abbreviated_name: string
107-
method toPretty : pretty_t
107+
method toPretty: pretty_t
108108
end
109109

110110
type object_type_t = TClass of class_name_int | TArray of value_type_t
@@ -647,31 +647,33 @@ type opcode_t =
647647

648648
class type opcodes_int =
649649
object
650-
method replace : int -> opcode_t -> unit
651-
method at : int -> opcode_t
652-
method length : int
653-
method instr_count : int
654-
method opcodes : opcode_t array
650+
method replace: int -> opcode_t -> unit
651+
method at: int -> opcode_t
652+
method length: int
653+
method instr_count: int
654+
method opcodes: opcode_t array
655655

656656
method offset_to_instrn_array: int array
657657
method offset_to_from_instrn_arrays: int array * int array
658658

659-
method iteri : (int -> opcode_t -> unit) -> unit
660-
method next : int -> int option
661-
method previous : int -> int option
659+
method iteri: (int -> opcode_t -> unit) -> unit
660+
method next: int -> int option
661+
method previous: int -> int option
662662

663-
method toPretty : pretty_t
663+
method toPretty: pretty_t
664664
end
665665

666+
666667
class type exception_handler_int =
667668
object
668-
method catch_type : class_name_int option
669-
method h_end : int
670-
method h_start : int
671-
method handler : int
672-
method toPretty : pretty_t
669+
method catch_type: class_name_int option
670+
method h_end: int
671+
method h_start: int
672+
method handler: int
673+
method toPretty: pretty_t
673674
end
674675

676+
675677
class type bytecode_int =
676678
object
677679
method get_attributes : (string * string) list

CodeHawk/CHJ/jchlib/jCHParseUTF8Signature.ml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,14 @@ let read_utf8 getchar =
220220
end
221221
| _ -> assert false
222222

223-
let in_range c lower_bound upper_bound = c >= lower_bound && c <= upper_bound
224-
225-
let is_ascii c = in_range 0x01 0x7F
226-
227223

228224
module XString = struct
229225
type t = string
230-
let empty = ""
231-
let length = String.length
232-
let append = ( ^ )
233-
let lowercase = String.lowercase_ascii
234-
let iter f s =
226+
let _empty = ""
227+
let _length = String.length
228+
let _append = ( ^ )
229+
let _lowercase = String.lowercase_ascii
230+
let _iter f s =
235231
let len = String.length s in
236232
let pos = ref ~-1 in
237233
let get () =
@@ -242,19 +238,21 @@ module XString = struct
242238
while true do f (read_utf8 get) done
243239
with
244240
| Exit -> ()
245-
let of_string s = s
246-
let to_utf8 f v x = f v x
241+
let _of_string s = s
242+
let _to_utf8 f v x = f v x
247243
let compare = String.compare
248244
end
249245

250-
let string_equal s1 s2 = (XString.compare s1 s2) = 0
246+
247+
let _string_equal s1 s2 = (XString.compare s1 s2) = 0
248+
251249

252250
module XBuffer = struct
253-
type string = XString.t
254-
type t = Buffer.t
251+
type _string = XString.t
252+
type _t = Buffer.t
255253
exception Full
256254
let create = Buffer.create
257-
let add_char = Buffer.add_char
255+
let _add_char = Buffer.add_char
258256
let add_uchar buffer uchar =
259257
try
260258
let store c = Buffer.add_char buffer (Char.chr c) in
@@ -282,11 +280,13 @@ module XBuffer = struct
282280

283281
let clear = Buffer.clear
284282
let contents = Buffer.contents
285-
let length = Buffer.length
283+
let _length = Buffer.length
286284
end
287285

286+
288287
let c_end_of_input = max_int
289288

289+
290290
let raise_utf8_parse_error msg char_la s =
291291
if char_la = c_end_of_input then
292292
raise

CodeHawk/CHJ/jchlib/jCHParseUTF8Signature.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ open JCHBasicTypesAPI
3535

3636
exception UTF8ParseError of pretty_t
3737

38+
3839
val parse_base_type: string -> java_basic_type_t
3940

4041
val parse_class_name: string -> class_name_int

0 commit comments

Comments
 (0)