/vqdr/trunk

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

« back to all changes in this revision

Viewing changes to src/utils/random.vala

  • Committer: Gustav Hartvigsson
  • Date: 2022-06-01 12:09:53 UTC
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: gustav.hartvigsson@gmail.com-20220601120953-3t2j3v68izknnmyw
int -> int32

Finished the last of the convertion to fixed sized integer values.
(where applicable).

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
      return rand.double_range (begin, end);
37
37
    }
38
38
    
39
 
    public int get_int () {
40
 
      return (int) rand.next_int ();
 
39
    public int32 get_int () {
 
40
      return (int32) rand.next_int ();
41
41
    }
42
42
    
43
 
    public int get_int_range (int begin, int end) {
 
43
    public int32 get_int_range (int32 begin, int32 end) {
44
44
      return rand.int_range ((int32) begin, (int32) end);
45
45
    }
46
46
    
47
 
    public void seed (int seed) {
 
47
    public void seed (int32 seed) {
48
48
      rand.set_seed ((uint32) seed);
49
49
    }
50
50
    
51
51
    
52
52
    /* **** Static versions *** */
53
 
    public static int get_static_int () {
 
53
      public static int32 get_static_int () {
54
54
      Random r = Random.get_instance ();
55
55
      return r.get_int ();
56
56
    }
60
60
      return r.get_double ();
61
61
    }
62
62
    
63
 
    public static int get_static_int_range (int begin, int end) {
 
63
    public static int32 get_static_int_range (int32 begin, int32 end) {
64
64
      Random r = Random.get_instance ();
65
65
      return r.get_int_range (begin, end);
66
66
    }