/+junk/vala-bit-field

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/vala-bit-field

« back to all changes in this revision

Viewing changes to src/bit_map.vala

  • Committer: Gustav Hartvigsson
  • Date: 2020-11-03 17:19:50 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20201103171950-u9cjz5g22bcrvmyd
* Fixed type : campare->compare.
* Fixed type for function alias.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
  
17
17
  private static GLib.Tree<FieldInfo?, uint16> mask_cache;
18
18
  
19
 
  public void init () {
 
19
  void init () {
20
20
    list_of_types = new GLib.Tree<string, Type?> ((a, b) => {
21
21
      return (GLib.strcmp (a,b));
22
22
    });
26
26
    });
27
27
  }
28
28
  
29
 
  public void deinit () {
 
29
  void deinit () {
30
30
    list_of_types.foreach ((_key, _val) => {
31
31
      list_of_types.remove (_key);
32
32
      
34
34
    });
35
35
  }
36
36
  
37
 
  public static bool add_type_v (string name, FieldInfo first_field, ...) {
 
37
  static bool add_type_v (string name, FieldInfo first_field, ...) {
38
38
    var va = va_list ();
39
39
    
40
40
    GLib.List<FieldInfo?> lst = new GLib.List<FieldInfo?> ();
50
50
    for (uint i = 0; i < lst.length (); i++) {
51
51
      lst2[i] = lst.nth_data (i);
52
52
    }
53
 
   
54
 
    return add_type (name, lst2);
 
53
    
 
54
    add_type (name, lst2);
 
55
    
 
56
    return false;
55
57
  }
56
58
  
57
59
  /**
179
181
    uint8 start;
180
182
    uint8 end;
181
183
    uint8 length;
 
184
    GLib.pointer padding;
182
185
    
183
186
    public FieldInfo (int field_id, uint8 start, uint8 end, uint8 length) {
184
187
      this.field_id = field_id;
185
188
      this.start = start;
186
189
      this.end = end;
187
190
      this.length = length; 
 
191
      this.padding = null;
188
192
    }
189
193
    
190
194
    public int compare (FieldInfo other) {