Changeset 137


Ignore:
Timestamp:
Sep 27, 2010, 4:19:28 PM (9 years ago)
Author:
mulligan
Message:

Bug noticed in string conversion routine. Note added.

Location:
Deliverables/D4.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/BitVectors.ml

    r98 r137  
    132132        true :: aux d
    133133
    134 let rec pad i l =
    135   match i with
    136     0 -> l
    137   | n -> false :: (pad (i - 1) l)
    138 
    139134let vect_of_int i size =
    140135  let big_list = List.rev (aux i) in
     
    143138    else
    144139      let diff = (size_lookup size) - (List.length big_list) in
    145         pad diff big_list
     140        pad false diff big_list
    146141   
    147 let zero size = pad (size_lookup size) []
     142let zero size = pad false (size_lookup size) []
  • Deliverables/D4.1/IntelHex.ml

    r136 r137  
    160160    | (prs,_)::_ -> Some prs
    161161
     162(* DPM: BUG --- length and addr hex values are sometimes shortened if the hex
     163        string begins with a zero.  All length strings should be two hex chars
     164        long, and all addr strings should be four.                            *)
    162165let string_of_intel_hex_entry entry =
    163166  let record_length_l, record_length_r = entry.record_length in
     
    226229
    227230(* DPM: Debug
    228    let tot = complement <*> snd $ add_bytes [vect_of_int 2 `Eight; vect_of_int 0 `Eight; vect_of_int 0 `Eight; vect_of_int 4 `Eight; vect_of_int 255 `Eight; vect_of_int 255 `Eight];;
    229    let Some entry = intel_hex_format_of_string ":02000004FFFFFC";;
     231   let Some entry = intel_hex_format_of_string ":10002F00EFF88DF0A4FFEDC5F0CEA42EFEEC88F016";;
    230232   checksum_valid $ List.hd entry;;
    231233*)
  • Deliverables/D4.1/Util.ml

    r135 r137  
    1414;;
    1515
     16let rec pad v i l =
     17  match i with
     18    0 -> l
     19  | n -> v :: (pad v (i - 1) l)
     20;;
     21
    1622let char_list_of_string s =
    1723  let str_length = String.length s in
Note: See TracChangeset for help on using the changeset viewer.