On Fri, 2008-07-04 at 14:59 +0100, Gordon Sim wrote: > Alan Conway wrote: > > On Fri, 2008-07-04 at 13:14 +0000, [EMAIL PROTECTED] wrote: > >> Author: gsim > >> Date: Fri Jul 4 06:14:06 2008 > >> New Revision: 674040 > >> > >> URL: http://svn.apache.org/viewvc?rev=674040&view=rev > >> Log: > >> Allow default values for packed structs to be overridden (currently used > >> for message.transfer.accept-mode) > >> > >> > >> Modified: > >> incubator/qpid/trunk/qpid/cpp/rubygen/framing.0-10/structs.rb > >> > >> Modified: incubator/qpid/trunk/qpid/cpp/rubygen/framing.0-10/structs.rb > >> URL: > >> http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/rubygen/framing.0-10/structs.rb?rev=674040&r1=674039&r2=674040&view=diff > >> ============================================================================== > >> --- incubator/qpid/trunk/qpid/cpp/rubygen/framing.0-10/structs.rb > >> (original) > >> +++ incubator/qpid/trunk/qpid/cpp/rubygen/framing.0-10/structs.rb Fri Jul > >> 4 06:14:06 2008 > >> @@ -48,7 +48,7 @@ > >> > >> def default_initialisation(s) > >> params = s.fields.select {|f| ValueTypes.include?(f.cpptype.name) || > >> (!is_packed(s) && f.type_ == "bit")} > >> - strings = params.collect {|f| "#{f.cppname}(0)"} > >> + strings = params.collect {|f| "#{f.cppname}(#{f.default_value})"} > >> strings << "flags(0)" if (is_packed(s)) > >> if strings.empty? > >> return "" > > > > > > This fix will result in things like: > > > > Foo() : fooString(std::string()) {} > > No, I don't think it will. Explicit initialisation is only used for the > various int types.
You're quite right. A nice simple fix. Cheers, Alan.
