[asterisk-commits] kpfleming: branch 1.4 r100264 - /branches/1.4/include/asterisk/app.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 24 15:57:42 CST 2008


Author: kpfleming
Date: Thu Jan 24 15:57:41 2008
New Revision: 100264

URL: http://svn.digium.com/view/asterisk?view=rev&rev=100264
Log:
make these macros not assume that the only other field in the structure is 'argc'... this is true when someone uses AST_DECLARE_APP_ARGS, but it's perfectly reasonable to define your own structure as long as it has the right fields

Modified:
    branches/1.4/include/asterisk/app.h

Change Statistics:
 0 files changed

Modified: branches/1.4/include/asterisk/app.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/app.h?view=diff&rev=100264&r1=100263&r2=100264
==============================================================================
--- branches/1.4/include/asterisk/app.h (original)
+++ branches/1.4/include/asterisk/app.h Thu Jan 24 15:57:41 2008
@@ -275,7 +275,7 @@
   the argc argument counter field.
  */
 #define AST_STANDARD_APP_ARGS(args, parse) \
-	args.argc = ast_app_separate_args(parse, '|', args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0]))
+	args.argc = ast_app_separate_args(parse, '|', args.argv, ((sizeof(args) - offsetof(typeof(args), argv)) / sizeof(args.argv[0])))
 	
 /*!
   \brief Performs the 'nonstandard' argument separation process for an application.
@@ -288,7 +288,7 @@
   the argc argument counter field.
  */
 #define AST_NONSTANDARD_APP_ARGS(args, parse, sep) \
-	args.argc = ast_app_separate_args(parse, sep, args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0]))
+	args.argc = ast_app_separate_args(parse, sep, args.argv, ((sizeof(args) - offsetof(typeof(args), argv)) / sizeof(args.argv[0])))
 	
 /*!
   \brief Separate a string into arguments in an array




More information about the asterisk-commits mailing list