Commit 0b89bb79 authored by marko's avatar marko

branches/zip: Add __attribute__((const)) or __attribute__((pure))

to all fold functions.
parent 81334fe6
......@@ -880,7 +880,8 @@ buf_page_address_fold(
/*==================*/
/* out: the folded value */
ulint space, /* in: space id */
ulint offset);/* in: offset of the page within space */
ulint offset) /* in: offset of the page within space */
__attribute__((const));
/**********************************************************************
Returns the control block of a file page, NULL if not found. */
UNIV_INLINE
......
......@@ -262,7 +262,8 @@ dtuple_fold(
ulint n_fields,/* in: number of complete fields to fold */
ulint n_bytes,/* in: number of bytes to fold in an
incomplete last field */
dulint tree_id);/* in: index tree id */
dulint tree_id)/* in: index tree id */
__attribute__((pure));
/***********************************************************************
Sets types of fields binary in a tuple. */
UNIV_INLINE
......
......@@ -545,7 +545,8 @@ lock_rec_fold(
/*==========*/
/* out: folded value */
ulint space, /* in: space */
ulint page_no);/* in: page number */
ulint page_no)/* in: page number */
__attribute__((const));
/*************************************************************************
Calculates the hash value of a page file address: used in inserting or
searching for a lock in the hash table. */
......
......@@ -586,7 +586,8 @@ rec_fold(
fields to fold */
ulint n_bytes, /* in: number of bytes to fold
in an incomplete last field */
dulint tree_id); /* in: index tree id */
dulint tree_id) /* in: index tree id */
__attribute__((pure));
/*************************************************************
Builds a physical record out of a data tuple and
stores it into the given buffer. */
......
......@@ -77,7 +77,8 @@ ut_fold_ulint_pair(
/*===============*/
/* out: folded value */
ulint n1, /* in: ulint */
ulint n2); /* in: ulint */
ulint n2) /* in: ulint */
__attribute__((const));
/*****************************************************************
Folds a dulint. */
UNIV_INLINE
......@@ -85,7 +86,8 @@ ulint
ut_fold_dulint(
/*===========*/
/* out: folded value */
dulint d); /* in: dulint */
dulint d) /* in: dulint */
__attribute__((const));
/*****************************************************************
Folds a character string ending in the null character. */
UNIV_INLINE
......@@ -93,7 +95,8 @@ ulint
ut_fold_string(
/*===========*/
/* out: folded value */
const char* str); /* in: null-terminated string */
const char* str) /* in: null-terminated string */
__attribute__((pure));
/*****************************************************************
Folds a binary string. */
UNIV_INLINE
......@@ -102,7 +105,8 @@ ut_fold_binary(
/*===========*/
/* out: folded value */
const byte* str, /* in: string of bytes */
ulint len); /* in: length */
ulint len) /* in: length */
__attribute__((pure));
/***************************************************************
Looks for a prime number slightly greater than the given argument.
The prime is chosen so that it is not near any power of 2. */
......@@ -111,7 +115,8 @@ ulint
ut_find_prime(
/*==========*/
/* out: prime */
ulint n); /* in: positive number > 100 */
ulint n) /* in: positive number > 100 */
__attribute__((const));
#ifndef UNIV_NONINL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment