mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
docs: Move the checkedmath SECTION
Move it to a separate Markdown file. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3037
This commit is contained in:
parent
b93e35dc17
commit
3957b47e59
30
docs/reference/glib/checked-math.md
Normal file
30
docs/reference/glib/checked-math.md
Normal file
@ -0,0 +1,30 @@
|
||||
Title: Bounds-checking Integer Arithmetic
|
||||
SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
SPDX-FileCopyrightText: 2015 Allison Lortie
|
||||
|
||||
# Bounds-checking Integer Arithmetic
|
||||
|
||||
GLib offers a set of macros for doing additions and multiplications
|
||||
of unsigned integers, with checks for overflows.
|
||||
|
||||
The helpers all have three arguments. A pointer to the destination
|
||||
is always the first argument and the operands to the operation are
|
||||
the other two.
|
||||
|
||||
Following standard GLib convention, the helpers return true in case
|
||||
of success (ie: no overflow).
|
||||
|
||||
The helpers may be macros, normal functions or inlines. They may be
|
||||
implemented with inline assembly or compiler intrinsics where
|
||||
available.
|
||||
|
||||
Since: 2.48
|
||||
|
||||
The APIs are:
|
||||
|
||||
* [func@GLib.uint_checked_add]
|
||||
* [func@GLib.uint_checked_mul]
|
||||
* [func@GLib.uint64_checked_add]
|
||||
* [func@GLib.uint64_checked_mul]
|
||||
* [func@GLib.size_checked_add]
|
||||
* [func@GLib.size_checked_mul]
|
@ -68,6 +68,7 @@ content_files = [
|
||||
"reference-counting.md",
|
||||
"testing.md",
|
||||
"atomic.md",
|
||||
"checked-math.md",
|
||||
"threads.md",
|
||||
"spawn.md",
|
||||
"unix.md",
|
||||
|
@ -149,6 +149,7 @@ expand_content_files = [
|
||||
'base64.md',
|
||||
'building.md',
|
||||
'character-set.md',
|
||||
'checked-math.md',
|
||||
'compiling.md',
|
||||
'cross-compiling.md',
|
||||
'datalist-and-dataset.md',
|
||||
|
21
glib/docs.c
21
glib/docs.c
@ -1702,27 +1702,6 @@
|
||||
*/
|
||||
|
||||
/* Bounds-checked integer arithmetic {{{1 */
|
||||
/**
|
||||
* SECTION:checkedmath
|
||||
* @title: Bounds-checking integer arithmetic
|
||||
* @short_description: a set of helpers for performing checked integer arithmetic
|
||||
*
|
||||
* GLib offers a set of macros for doing additions and multiplications
|
||||
* of unsigned integers, with checks for overflows.
|
||||
*
|
||||
* The helpers all have three arguments. A pointer to the destination
|
||||
* is always the first argument and the operands to the operation are
|
||||
* the other two.
|
||||
*
|
||||
* Following standard GLib convention, the helpers return %TRUE in case
|
||||
* of success (ie: no overflow).
|
||||
*
|
||||
* The helpers may be macros, normal functions or inlines. They may be
|
||||
* implemented with inline assembly or compiler intrinsics where
|
||||
* available.
|
||||
*
|
||||
* Since: 2.48
|
||||
*/
|
||||
|
||||
/**
|
||||
* g_uint_checked_add
|
||||
|
Loading…
Reference in New Issue
Block a user