[asterisk-commits] russell: branch group/asterisk-cpp r168406 - in /team/group/asterisk-cpp: inc...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 19:17:18 CST 2009


Author: russell
Date: Sat Jan 10 19:17:18 2009
New Revision: 168406

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168406
Log:
Remove ast_frame constructor.

Adding a constructor prevents the usage of offsetof(), which we need in a few places.
This will break the build in places where it was used, but I'll fix that next.

Modified:
    team/group/asterisk-cpp/include/asterisk/frame.h
    team/group/asterisk-cpp/main/app.c

Modified: team/group/asterisk-cpp/include/asterisk/frame.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/frame.h?view=diff&rev=168406&r1=168405&r2=168406
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/frame.h (original)
+++ team/group/asterisk-cpp/include/asterisk/frame.h Sat Jan 10 19:17:18 2009
@@ -139,8 +139,6 @@
 /*! \brief Data structure associated with a single frame of data
  */
 struct ast_frame {
-	ast_frame() {}
-	ast_frame(enum ast_frame_type frametype, int sublcass, int datalen = 0, int samples = 0, void *ptr = NULL) : frametype(frametype), subclass(subclass), datalen(datalen), samples(samples) {data.ptr = ptr;}
 	/*! Kind of frame */
 	enum ast_frame_type frametype;				
 	/*! Subclass, frame dependent */

Modified: team/group/asterisk-cpp/main/app.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/app.c?view=diff&rev=168406&r1=168405&r2=168406
==============================================================================
--- team/group/asterisk-cpp/main/app.c (original)
+++ team/group/asterisk-cpp/main/app.c Sat Jan 10 19:17:18 2009
@@ -372,9 +372,11 @@
 {
 	short buf[2048 + AST_FRIENDLY_OFFSET / 2];
 	struct linear_state *ls = (struct linear_state *) data;
-	struct ast_frame f (AST_FRAME_VOICE, AST_FORMAT_SLINEAR);
+	struct ast_frame f = { AST_FRAME_VOICE, };
 	int res;
 
+	f.frametype = AST_FRAME_VOICE;
+	f.subclass = AST_FORMAT_SLINEAR;
 	f.data.ptr = buf + AST_FRIENDLY_OFFSET / 2;
 	f.offset = AST_FRIENDLY_OFFSET;
 




More information about the asterisk-commits mailing list