summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_math.h
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-12-13 17:20:24 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-12-13 17:20:24 +0000
commitd7f4fe1de14209b7d2587a602a01dd93f6714fad (patch)
tree29ace7d04af2c02398b7da59b1014a6b7242d77f /recordmydesktop/src/rmd_math.h
parent61ab7edf42e5a7ff3b7d663a2661d3b60723cf14 (diff)
Added missing stdio.h and errno.h headers in any
files that needed them (could cause compilation failure on some platforms). Also, rearranged the sequence with which include's happen, so that any missing headers will be more likely to show up as copilation errors, in the future. rmd_yuv_utils.[ch] and rmd_block_utils.[ch] have been merged within the former, as they deal with the same subject (converting rgb buffers to yuv ones, with the only difference that rmd_block_utils had the double-buffer convertions while rmd_yuv_utils dealt with the single-buffered ones). Their headers also had the a circular dependency (rmd_yuv_utils.h included rmd_block_utils.h and vice-versa). rmd_math.[ch] was added. This file holds now the rmdRoundf function which is a portable implementation of roundf (which depends on C99). The reasoning behind the addition of these files, is that they might hold more purely mathematical functions, in the future. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@583 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rmd_math.h')
-rw-r--r--recordmydesktop/src/rmd_math.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/recordmydesktop/src/rmd_math.h b/recordmydesktop/src/rmd_math.h
new file mode 100644
index 0000000..87c6166
--- /dev/null
+++ b/recordmydesktop/src/rmd_math.h
@@ -0,0 +1,44 @@
+/******************************************************************************
+* recordMyDesktop - rmd_math.h *
+*******************************************************************************
+* *
+* Copyright (C) 2008 John Varouhakis *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the Free Software *
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+* *
+* *
+* *
+* For further information contact me at johnvarouhakis@gmail.com *
+******************************************************************************/
+
+#ifndef RMD_MATH_H
+#define RMD_MATH_H 1
+
+/*
+ * Since roundf depends on C99, using it might make
+ * the code non-portable. rmdRoundf solves this
+ * problem, by behaving identically with roundf
+ * and being portable (floorf and ceilf, that are
+ * used in the implementation, are defined in C89)
+ *
+ * \param val Number to be rounded
+ *
+ * \returns val rounded
+ *
+ */
+double rmdRoundf( double val );
+
+#endif
+
© All Rights Reserved