/bitfield/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/bitfield/trunk

« back to all changes in this revision

Viewing changes to src/main.vala

  • Committer: Gustav Hartvigsson
  • Date: 2020-06-05 21:05:07 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20200605210507-cf47ohzmnet3ohc4
* encountered a bug in Valac:
https://gitlab.gnome.org/GNOME/vala/-/issues/1003

This makes it so I can't continue with this in any sane way.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
enum TestFields {
2
 
  A,
3
 
  B,
4
 
  C,
5
 
}
6
 
 
7
1
int main (string[] args) {
8
2
  
9
3
  BitField.init ();
10
4
  
11
 
  BitField.FieldInfo[] info = {
12
 
    BitField.FieldInfo (TestFields.A, 0, 5, 6),
13
 
    BitField.FieldInfo (TestFields.B, 6, 7, 2),
14
 
    BitField.FieldInfo (TestFields.C, 8, 15, 8),
15
 
  };
16
 
  
17
 
  BitField.add_type ("foo", info);
18
 
  
19
 
  uint16 t1 = 0;
20
 
  BitField.set (ref t1, "foo", TestFields.C, 137);
21
 
  print ("%i\n", t1);
22
 
  
23
 
  uint16 t2 = BitField.get (t1 ,"foo", TestFields.C);
24
 
  print ("%i\n", t2);
 
5
  BitField.FieldInfo a = {1,2,3};
 
6
  BitField.FieldInfo b = {3, 2, 1};
 
7
  
 
8
  BitField.FieldInfo.static_campare (a,b);
25
9
  
26
10
  BitField.deinit ();
27
11
  return 0;