/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/utils.vala

  • Committer: Gustav Hartvigsson
  • Date: 2022-06-01 20:50:29 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20220601205029-cmy0mxi9x59bzymx
Added int32_abs () to Utils.

Made Dice.roll () use uint32 as it's return value. It can never be negative, so...

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
[CCode (cname = "V", cprefix = "v_")]
7
7
namespace Utils {
 
8
  // int32 is missinng the abs method. This will have to do for the time being.
 
9
  // BUG: https://gitlab.gnome.org/GNOME/vala/-/issues/1328
 
10
  static int32 int32_abs (int32 N) { return ((N < 0) ? ( -N ) : (N)); }
 
11
 
8
12
  [CCode (cname = "v_str_cmp")]
9
13
  public int str_cmp (string a, string b) {
10
14
    return a.collate (b);