bladeRF/host/common/include/minmax.h
Jon Szymaniak 625694eaa5 license: License changes on various portions of the codebase
Where possible (and with contributor permission), items have been
changed to LGPLv2.1 or MIT licenses to avoid issues with any proprietary
libraries from vendors (HDL and FW), allow static linking (with headless
mode operation in mind), and to generally present users with more
permissive licenses.

File headers and the COPYING have been updated accordingly. Third party
sources have been either removed, replaced, or relocated in the source
tree, in accordance with the licenses decided upon for each part of the tree.

Contributor Assignment Agreements have been added, and it is required
that these be submitted before significant patches and pull requests
are accepted.
2013-10-27 00:17:35 -04:00

33 lines
574 B
C

/**
* @file minmax.h
*
* @brief These static inline routines are preferred over the use of macros,
* as they provide type safety.
*/
#ifndef MINMAX_H__
#define MINMAX_H__
#include "host_config.h"
static inline size_t min_sz(size_t x, size_t y)
{
return x < y ? x : y;
}
static inline size_t max_sz(size_t x, size_t y)
{
return x > y ? x : y;
}
static inline unsigned int uint_min(unsigned int x, unsigned int y)
{
return x < y ? x : y;
}
static inline unsigned int uint_max(unsigned int x, unsigned int y)
{
return x > y ? x : y;
}
#endif