dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

25 Commits

Author SHA1 Message Date
kpfleming 230a66da7d Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 21:13:09 +00:00
seanbright 71107a3e7c Start moving in changes from my resolve-shadow-warnings branch. Going to do
this in pieces so the diffs are a little bit smaller and more reviewable.

pbx/ and formats/ first.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@136298 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-07 00:44:55 +00:00
bbryant 8e222897e6 Janitor patch to change uses of sizeof to ARRAY_LEN
(closes issue #13054)
Reported by: pabelanger
Patches:
      ARRAY_LEN.patch2 uploaded by pabelanger (license 224)
Tested by: seanbright


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130129 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11 18:09:35 +00:00
bbryant 0110f8c87a Janitor project to convert sizeof to ARRAY_LEN macro.
(closes issue #13002)
Reported by: caio1982
Patches:
      janitor_arraylen5.diff uploaded by caio1982 (license 22)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@129045 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-08 16:40:28 +00:00
russell 5262d4ab16 Merge another change from team/russell/events ...
DUNDi uses a concept called the Entity ID for unique server identifiers.  I have
pulled out the handling of EIDs and made it something available to all of Asterisk.
There is now a global Entity ID that can be used for other purposes as well, such
as code providing distributed device state, which is why I did this.  The global
Entity ID is set automatically, just like it was done in DUNDi, but it can also be
set in asterisk.conf.  DUNDi will now use this global EID unless one is specified
in dundi.conf.

The current EID for the system can be seen in the "core show settings" CLI command.
It is also available in the dialplan via the ENTITYID variable.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@121439 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-10 12:48:50 +00:00
rizzo 18911d90cb remove a bunch of duplicate includes
Reproduce with

grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr 



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89348 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16 23:54:45 +00:00
rizzo 883346d64a Start untangling header inclusion in a way that does not affect
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: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16 20:04:58 +00:00
rizzo ea0d4674a6 make the 'name' and 'value' fields in ast_variable const char *
This prevents modifying the strings in the stored variables, 
and catched a few instances where this was actually done.

Given the differences between trunk and 1.4 (and the fact that this
is effectively an API change) it is better to fix 1.4 independently.
These are

chan_sip.c::sip_register()
chan_skinny.c:: near line 2847
config.c:: near line 1774
logger.c::make_components()
res_adsi.c:: near line 1049

I may have missed some instances for modules that do not build here.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89268 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-14 13:18:40 +00:00
russell cb5696de52 Simplify buffer handling in dundi-parser.c. This also makes the code a bit
safer by removing various assumptions about sizes. (No vulnerabilities, though)

(closes issue #10977)
Reported by: dimas
Patches: 
      dundiparser.patch uploaded by dimas (license 88)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85558 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-15 15:55:23 +00:00
russell dac373f539 Corydon posted this janitor project to the bug tracker and mvanbaak provided
a patch for it.  It replaces a bunch of simple calls to snprintf with ast_copy_string

(closes issue #10843)
Reported by: Corydon76
Patches: 
      2007092900_10843.diff uploaded by mvanbaak (license 7)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84173 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01 15:23:19 +00:00
kpfleming 470f688a28 Merged revisions 46200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46200 | kpfleming | 2006-10-25 09:32:08 -0500 (Wed, 25 Oct 2006) | 2 lines

apparently developers are still not aware that they should be use ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46201 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-25 14:44:50 +00:00
russell f395a52a02 Merge a new implementation of ast_inet_ntoa, our thread safe replacement for
inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38042 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21 17:31:28 +00:00
kpfleming 73c525e6e2 simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07 18:54:56 +00:00
kpfleming 24c1e3c222 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7221 f38db490-d61c-443f-a65b-d21fe96a405b 2005-11-29 18:24:39 +00:00
russell 2c3b3edc86 Doxygen documentation update from oej (issue #5505)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6847 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-24 20:12:06 +00:00
kpfleming 95fe2b8fd4 update MANY more files with proper copyright/license info (thanks Ian!)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6596 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-14 20:46:50 +00:00
kpfleming a6013bf67a use native-sign characters for strings (issue #5105)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6507 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-02 19:15:03 +00:00
kpfleming 6f0f46299c more file version tags
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5866 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06 22:12:19 +00:00
kpfleming 31e8dcf4fe use double-quotes instead of angle-brackets for non-system include files (bug #4058)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5490 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-21 06:02:45 +00:00
russell 7288b1ced0 update copyright headers for 2005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4868 f38db490-d61c-443f-a65b-d21fe96a405b
2005-01-21 07:06:25 +00:00
markster bd91710f17 Fix off-by-one buglet
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4147 f38db490-d61c-443f-a65b-d21fe96a405b
2004-11-02 21:38:38 +00:00
markster 8129d4f03e Preliminary "PRECACHE" / push support...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4110 f38db490-d61c-443f-a65b-d21fe96a405b
2004-10-27 13:58:31 +00:00
markster 0a95ef7a16 Add cache bypass mode
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4075 f38db490-d61c-443f-a65b-d21fe96a405b
2004-10-24 05:51:57 +00:00
citats e074114c01 Cleanup dundi-parser.c
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4053 f38db490-d61c-443f-a65b-d21fe96a405b
2004-10-23 04:53:12 +00:00
markster 852e93e07c Add DUNDi.... (http://www.dundi.com)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4033 f38db490-d61c-443f-a65b-d21fe96a405b
2004-10-18 21:45:13 +00:00