summaryrefslogtreecommitdiff
path: root/funcs/func_math.c
AgeCommit message (Collapse)Author
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-07clang compiler warnings: Fix sometimes-initialized warning in func_mathMatthew Jordan
This patch fixes a bug in a unit test in func_math where a variable could be passed to ast_free that wasn't allocated. This patch corrects the issue and ensures that we only attempt to free a variable if we previously allocated it. Review: https://reviewboard.asterisk.org/r/4552 ASTERISK-24917 Reported by: dkdegroot patches: rb4552.patch submitted by dkdegroot (License 6600) ........ Merged revisions 434190 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 434191 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-27Fix dialplan function NULL channel safety issuesCorey Farrell
(closes issue ASTERISK-23391) Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3386/ ........ Merged revisions 411313 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411314 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411315 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23memory leaks: Memory leak cleanup patch by Corey Farrell (first set)Jonathan Rose
(issue ASTERSIK-22467) Reported by: Corey Farrell Patches: chan_sip-parse_contact_header_test-free-contacts.patch uploaded by coreyfarrell (license 5909) cli-filename-completion-leak.patch uploaded by coreyfarrell (license 5909) func_math.patch uploaded by corefarrell (license 5909) main-test-cleanup.patch uploaded by coreyfarrell (license 5909) test_dlinklists.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401660 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401661 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401662 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07Remove annoying unconditional debug message from INC/DEC functions.Richard Mudgett
(closes issue AST-1001) Reported by: Guenther Kelleter ........ Merged revisions 372628 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372629 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372630 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12Correct Documentation For DEC FunctionMichael L. Young
The documentation for DEC in func_math.c was incorrect. Looks like a copy and paste error. (Closes issue ASTERISK-20095) Reported by: Billy Chia Tested by: Michael L. Young Patches: func_math.patch uploaded by Billy Chia (license 6381) ........ Merged revisions 369970 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369971 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12Reverting last merge since it wasn't completed properly.Michael L. Young
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12Correct Documentation For DEC FunctionMichael L. Young
The documentation for DEC in func_math.c was incorrect. Looks like a copy and paste error. (Closes issue ASTERISK-20095) Reported by: Billy Chia Tested by: Michael L. Young Patches: func_math.patch uploaded by Billy Chia (license 6381) ........ Merged revisions 369970 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-31Coverity Report: Fix issues for error type REVERSE_INULL (core modules)Richard Mudgett
* Fixes findings: 0-2,5,7-15,24-26,28-31 (issue ASTERISK-19648) Reported by: Matt Jordan ........ Merged revisions 368039 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368042 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09Kill some startup warnings and errors and make some messages more helpful in ↵Tilghman Lesher
tracking down the source. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-09Various updates to the unit test API.Russell Bryant
1) It occurred to me that the difference in usage between the error ast_str and the ast_test_update_status() usage has turned out to be a bit ambiguous in practice. In a lot of cases, the same message was being sent to both. In other cases, it was only sent to one or the other. My opinion now is that in every case, I think it makes sense to do both; we should output it to the CLI as well as save it off for logging purposes. This change results in most of the changes in this diff, since it required changes to all existing unit tests. It also allowed for some simplifications of unit test API implementation code. 2) Update ast_test_status_update() to include the file, function, and line number for the code providing the update. 3) There are some formatting tweaks here and there. Hopefully they aren't too distracting for code review purposes. Reviewboard's diff viewer seems to do a pretty good job of pointing out when something is a whitespace change. 4) I moved the md5_test and sha1_test into the test_utils module. It seemed like a better approach since these tests are so tiny. 5) I changed the number of nodes used in heap_test_2 from 1 million to 100 thousand. The only reason for this was to reduce the time it took for this test to run. 6) Remove an unused function prototype that was at the bottom of utils.h. 7) Simplify test_insert() using the LIST_INSERT_SORTALPHA() macro. The one minor difference in behavior is that it no longer checks for a test registered with the same name. 8) Expand the code in test_alloc() to provide specific error messages for each failure case, to clearly inform developers if they forget to set the name, summary, description, etc. 9) Tweak the output of the "test show registered" CLI command. I swapped the name and category to have the category first. It seemed more natural since that is the sort key. 10) Don't output the status ast_str in the "test show results" CLI command. This is going to tend to be pretty verbose, so just leave that for the detailed test logs (test generate results). Review: https://reviewboard.asterisk.org/r/493/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02Correct some off-by-one errors, especially when expressions don't contain ↵Tilghman Lesher
expected spaces. Also include the tests provided by the reporter, as regression tests. (closes issue #16667) Reported by: wdoekes Patches: astsvn-func_match-off-by-one.diff uploaded by wdoekes (license 717) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-21Merged revisions 241765 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r241765 | tilghman | 2010-01-20 23:53:17 -0600 (Wed, 20 Jan 2010) | 2 lines Guard against division by zero. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-30Fixes numerous spelling errors. Patch submitted by alecdavis.David Brooks
(closes issue #15595) Reported by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01Add INCrement and DECrement functionsTilghman Lesher
(closes issue #15025) Reported by: greenfieldtech Patches: func_math.c.patch_v4 uploaded by greenfieldtech (license 369) slightly modified by me Tested by: greenfieldtech, lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02Fix various spelling and grammatical issues in documentationRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01Merge changes from team/group/appdocsxmlRussell Bryant
This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06Merged revisions 146799 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r146799 | tilghman | 2008-10-06 15:52:04 -0500 (Mon, 06 Oct 2008) | 8 lines Dialplan functions should not actually return 0, unless they have modified the workspace. To signal an error (and no change to the workspace), -1 should be returned instead. (closes issue #13340) Reported by: kryptolus Patches: 20080827__bug13340__2.diff.txt uploaded by Corydon76 (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-28Added AND, OR, and XOR bitwise operations to MATH for issue 9891, thanks jcmooreDwayne M. Hubbard
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04Merged revisions 67162 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r67162 | tilghman | 2007-06-04 18:43:01 -0500 (Mon, 04 Jun 2007) | 10 lines Merged revisions 67161 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r67161 | tilghman | 2007-06-04 18:41:49 -0500 (Mon, 04 Jun 2007) | 2 lines According to MATH, 0+1181000386 = 1181000448. Oops. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24Merged revisions 65866 via svnmerge from Dwayne M. Hubbard
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r65866 | dhubbard | 2007-05-24 10:08:56 -0500 (Thu, 24 May 2007) | 1 line merged qwell's func_math patch for issue 9507 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24Doxygen updateOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-06finish const-ifying ast_func_read()Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-02Tweak description text to match new functionality (Issue 7959)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-31Add power and right/left shift functions (Issue 7959)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-25Merged revisions 48956 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r48956 | russell | 2006-12-25 00:21:20 -0500 (Mon, 25 Dec 2006) | 14 lines Merged revisions 48955 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r48955 | russell | 2006-12-25 00:19:48 -0500 (Mon, 25 Dec 2006) | 6 lines Fix an error introduced by copying and pasting the handling of the >= operator for the MATH function. If a single equal sign was used as an operator, the function would treat it is as if it were the >= operator. Now, it properly handles it as an invalid operator. (issue #8665, patch by tempest1) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21merge new_loader_completion branch, including (at least):Kevin P. Fleming
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵Kevin P. Fleming
again :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-14This rather large commit changes the way modules are loaded. Luigi Rizzo
As partly documented in loader.c and include/asterisk/module.h, modules are now expected to return all of their methods and flags into a structure 'mod_data', and are normally loaded with RTLD_NOW | RTLD_LOCAL, so symbols are resolved immediately and conflicts should be less likely. Only in a small number of cases (res_*, typically) modules are loaded RTLD_GLOBAL, so they can export symbols. The core of the change is only the two files loader.c and include/asterisk/module.h, all the rest is simply adaptation of the existing modules to the new API, a rather mechanical (but believe me, time and finger-consuming!) process whose detail you can figure out by svn diff'ing any single module. Expect some minor compilation issue after this change, please report it on mantis http://bugs.digium.com/view.php?id=6968 so we collect all the feedback in one place. I am just sorry that this change missed SVN version number 20000! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-08since the module API is changing, it's a good time to const-ify the ↵Kevin P. Fleming
description() and key() return values git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-12major dialplan functions updateKevin P. Fleming
deprecate LANGUAGE() and MUSICCLASS(), in favor of CHANNEL() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-11build function modules independently (no more pbx_functions.so)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21on this pass, only remove duplicate log messagesRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21revert my pass through the tree to remove checks of the result of ast_strdupaRussell Bryant
(revisions 8378 through 8381) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21remove useless checks of the result of ast_strdupaRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-106186 amd 6187 with minor revisions. added argMatt O'Gorman
parsing from macro. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-30update doxygen docs to specify authorsRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29remove extraneous svn:executable propertiesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-08make app_queue 1.2 jump compliant (issue #5580)Russell Bryant
add missing includes of stdio.h remove some unused and duplicate headers git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-08issue #5648Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-03major update to arg/option parsing APIs and documentationKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-24Doxygen documentation update from oej (issue #5505)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-14update MANY more files with proper copyright/license info (thanks Ian!)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-09add MATH() dialplan function (bug #4473, with mods)Kevin P. Fleming
deprecate the Math() application git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5895 65c4cc65-6c06-0410-ace0-fbb531ad65f3