Summary: | ASTERISK-13235: [patch] Simplify main/strings.c code | ||
Reporter: | Eliel Sardanons (eliel) | Labels: | |
Date Opened: | 2008-12-17 05:16:03.000-0600 | Date Closed: | 2008-12-18 09:28:37.000-0600 |
Priority: | Trivial | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) ast_str.patch | |
Description: | DEBUG_OPAQUE is obfuscating a little the code. This is a way to simplify it. | ||
Comments: | By: Russell Bryant (russell) 2008-12-17 10:15:53.000-0600 How about we do something like this in strings.h to simplify the header, as well? By: Tilghman Lesher (tilghman) 2008-12-17 10:42:42.000-0600 That would defeat the purpose of the debug code, as someone would only need to do: str->STR in their code instead of using the accessor functions. By: Eliel Sardanons (eliel) 2008-12-18 06:43:46.000-0600 I have used __ for the LEN, STR, TS and USED, this will warning a developer about using them in the code. It will also avoid conflicts... By: Russell Bryant (russell) 2008-12-18 07:23:30.000-0600 Yeah, this is pretty much what I had in mind. However, I would use __AST_STR_USED just to avoid any potential namespace issues since this is going into a header. By: Digium Subversion (svnbot) 2008-12-18 09:25:26.000-0600 Repository: asterisk Revision: 165502 U trunk/include/asterisk/strings.h U trunk/main/strings.c ------------------------------------------------------------------------ r165502 | eliel | 2008-12-18 09:25:25 -0600 (Thu, 18 Dec 2008) | 9 lines Remove duplicate code from the ast_str API. We now use __AST_STR_* to access 'struct ast_str' members, but this must only be used inside the API implementation. (closes issue ASTERISK-13235) Reported by: eliel Patches: ast_str.patch uploaded by eliel (license 64) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=165502 By: Digium Subversion (svnbot) 2008-12-18 09:26:59.000-0600 Repository: asterisk Revision: 165503 _U branches/1.6.1/ ------------------------------------------------------------------------ r165503 | eliel | 2008-12-18 09:26:59 -0600 (Thu, 18 Dec 2008) | 14 lines Blocked revisions 165502 via svnmerge ........ r165502 | eliel | 2008-12-18 13:25:15 -0200 (Thu, 18 Dec 2008) | 9 lines Remove duplicate code from the ast_str API. We now use __AST_STR_* to access 'struct ast_str' members, but this must only be used inside the API implementation. (closes issue ASTERISK-13235) Reported by: eliel Patches: ast_str.patch uploaded by eliel (license 64) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=165503 By: Digium Subversion (svnbot) 2008-12-18 09:28:36.000-0600 Repository: asterisk Revision: 165504 _U branches/1.6.0/ ------------------------------------------------------------------------ r165504 | eliel | 2008-12-18 09:28:36 -0600 (Thu, 18 Dec 2008) | 14 lines Blocked revisions 165502 via svnmerge ........ r165502 | eliel | 2008-12-18 13:25:15 -0200 (Thu, 18 Dec 2008) | 9 lines Remove duplicate code from the ast_str API. We now use __AST_STR_* to access 'struct ast_str' members, but this must only be used inside the API implementation. (closes issue ASTERISK-13235) Reported by: eliel Patches: ast_str.patch uploaded by eliel (license 64) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=165504 |