Update of /cvsroot/qtcsharp/Bugtussle/src/Writers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18599
Modified Files:
CWriter.cs
Log Message:
Workaround for a gcc bug.
Index: CWriter.cs
===================================================================
RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/CWriter.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CWriter.cs 1 Oct 2004 11:33:31 -0000 1.10
--- CWriter.cs 13 Oct 2004 16:28:51 -0000 1.11
***************
*** 18,21 ****
--- 18,27 ----
}
+ public enum VariableGetter
+ {
+ Yes,
+ No
+ }
+
/*!
***************
*** 775,779 ****
cw.WriteLine( "{0};", invocation );
else
! WriteFunctionReturn( method, invocation );
cw.Indent--;
--- 781,785 ----
cw.WriteLine( "{0};", invocation );
else
! WriteFunctionReturn( method, invocation, VariableGetter.No );
cw.Indent--;
***************
*** 783,787 ****
! private void WriteFunctionReturn( Method method, StringBuilder invocation )
{
if ( Function.IsValueRetFunction( method ) )
--- 789,793 ----
! private void WriteFunctionReturn( Method method, StringBuilder invocation, VariableGetter isVarGetter )
{
if ( Function.IsValueRetFunction( method ) )
***************
*** 791,798 ****
cw.WriteLine( "returnValue = {0};", invocation );
cw.Indent--;
! cw.WriteLine( "else" );
! cw.Indent++;
! cw.WriteLine( "{0};", invocation ); // ignore return value
! cw.Indent--;
}
else
--- 797,807 ----
cw.WriteLine( "returnValue = {0};", invocation );
cw.Indent--;
! if ( isVarGetter == VariableGetter.No )
! {
! cw.WriteLine( "else" );
! cw.Indent++;
! cw.WriteLine( "{0};", invocation ); // ignore return value
! cw.Indent--;
! }
}
else
***************
*** 1068,1072 ****
//cw.WriteLine("{2}{3}overrideHook.{0}(this{1});",
! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Data{1});",
m.UniqueName,
paramstr,
--- 1077,1081 ----
//cw.WriteLine("{2}{3}overrideHook.{0}(this{1});",
! cw.WriteLine( "{2}{3}overrideHook.{0}((void*)overrideHook.{0}Data{1});", // (void*) because of a gcc bug
m.UniqueName,
paramstr,
***************
*** 1665,1669 ****
cw.WriteLine( "{0};", invocation );
else
! WriteFunctionReturn( method, invocation );
cw.Indent--;
cw.WriteLine( "}" );
--- 1674,1678 ----
cw.WriteLine( "{0};", invocation );
else
! WriteFunctionReturn( method, invocation, VariableGetter.No );
cw.Indent--;
cw.WriteLine( "}" );
***************
*** 1711,1715 ****
invocation.AppendFormat( "{0}::", v.Container.GetFullTypeName() );
invocation.Append( TypeReferenceToString( v.Name, v.Type, ParameterStyle.CtoCXXInvocation, ns ) );
! WriteFunctionReturn( method, invocation );
cw.Indent--;
cw.WriteLine( "}" );
--- 1720,1724 ----
invocation.AppendFormat( "{0}::", v.Container.GetFullTypeName() );
invocation.Append( TypeReferenceToString( v.Name, v.Type, ParameterStyle.CtoCXXInvocation, ns ) );
! WriteFunctionReturn( method, invocation, VariableGetter.Yes );
cw.Indent--;
cw.WriteLine( "}" );
|