QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
safe.h File Reference

Provides safe math operations that won't overflow. More...

#include "qev.h"

Go to the source code of this file.

Functions

gboolean qev_safe_uadd (guint64 a, guint64 b, guint64 *res)
 Add two unsigned integers. More...
 

Detailed Description

Provides safe math operations that won't overflow.

Returns an error if an overflow is possible.

Author
Andrew Stone andre.nosp@m.w@cl.nosp@m.ovar..nosp@m.com

Function Documentation

gboolean qev_safe_uadd ( guint64  a,
guint64  b,
guint64 *  res 
)

Add two unsigned integers.

Parameters
aThe first uint
bThe second uint
resWhere the result should be placed
Returns
If the operation succeeded without overflow.