/+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 21:37:26 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20201103213726-cnc5g98qp233eio6
* removed unused code
* Added a bit of information on how to use this to the comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
  public void deinit () {
30
30
    list_of_types.foreach ((_key, _val) => {
31
31
      list_of_types.remove (_key);
32
 
      
33
32
      return false;
34
33
    });
35
34
  }
171
170
  /**
172
171
   * Create a new FieldInfo using the following syntax:
173
172
   * {{{
 
173
   *  enum MyTypeFields {
 
174
   *    F1,
 
175
   *    F2,
 
176
   *    //....
 
177
   *  }
 
178
   *
 
179
   *  BitField.FieldInfo[] my_fields_info = {
 
180
   *    BitField.FieldInfo (MyTypeFields.F1, 0, 5, 6),
 
181
   *    BitField.FieldInfo (MyTypeFields.F2, 0, 5, 6),
 
182
   *    //.....
 
183
   *  }
 
184
   *  
 
185
   *  if (FieldInfo.add_type ("MyType", my_fields_info)) {
 
186
   *    stderr.printf ("Something went wrong!");
 
187
   *  }
174
188
   * }}}
175
189
   * 
176
190
   */
199
213
        return this.length - other.length;
200
214
      }
201
215
      
202
 
      #if 0
203
 
      if (this.start > other.start) {
204
 
        return -1;
205
 
      } else if (this.start < other.start) {
206
 
        return 1;
207
 
      } else {
208
 
        if (this.end > other.end) {
209
 
          return -1;
210
 
        } else if (this.end < other.end) {
211
 
          return 1;
212
 
        } else {
213
 
          if (this.length > other.length) {
214
 
            return -1;
215
 
          } else if (this.length < other.length) {
216
 
            return 1;
217
 
          }
218
 
        }
219
 
      }
220
 
      #endif
221
 
      
222
216
      return 0;
223
217
    }
224
218