Browse Source

Minor formatting fixes.

pull/1514/head
Joao Matos 5 years ago committed by João Matos
parent
commit
7f0dc8aed4
  1. 6
      src/CppParser/Bootstrap/Bootstrap.cs
  2. 16
      src/Generator/Driver.cs
  3. 2
      src/Generator/Generators/C/CppMarshal.cs

6
src/CppParser/Bootstrap/Bootstrap.cs

@ -1352,12 +1352,14 @@ namespace CppSharp @@ -1352,12 +1352,14 @@ namespace CppSharp
WriteLine($"_S->{fieldName} = WalkTemplateArgument(S->{methodName}());");
else if (typeName.Contains("QualifiedType"))
WriteLine($"_S->{fieldName} = GetQualifiedType(S->{methodName}());");
else if (fieldName == "value" && @class.Bases.Exists(b => b.Class.Name.Contains("AP"))) {
else if (fieldName == "value" && @class.Bases.Exists(b => b.Class.Name.Contains("AP")))
{
// Use llvm::APInt or llvm::APFloat conversion methods
methodName = property.Type.IsPrimitiveType(PrimitiveType.ULongLong) ?
"getLimitedValue" : "convertToDouble";
WriteLine($"_S->{fieldName} = S->getValue().{methodName}();");
} else
}
else
WriteLine($"_S->{fieldName} = S->{methodName}();");
if (validMethodExists)

16
src/Generator/Driver.cs

@ -103,7 +103,7 @@ namespace CppSharp @@ -103,7 +103,7 @@ namespace CppSharp
break;
case ParserResultKind.FileNotFound:
Diagnostics.Error("File{0} not found: '{1}'",
(files.Count() > 1) ? "s" : "", string.Join(",", files));
(files.Count() > 1) ? "s" : "", string.Join(",", files));
hasParsingErrors = true;
break;
}
@ -349,13 +349,13 @@ namespace CppSharp @@ -349,13 +349,13 @@ namespace CppSharp
compilerOptions.Append(" /unsafe");
var compilerParameters = new CompilerParameters
{
GenerateExecutable = false,
TreatWarningsAsErrors = false,
OutputAssembly = assemblyFile,
GenerateInMemory = false,
CompilerOptions = compilerOptions.ToString()
};
{
GenerateExecutable = false,
TreatWarningsAsErrors = false,
OutputAssembly = assemblyFile,
GenerateInMemory = false,
CompilerOptions = compilerOptions.ToString()
};
if (module != Options.SystemModule)
compilerParameters.ReferencedAssemblies.Add(

2
src/Generator/Generators/C/CppMarshal.cs

@ -497,7 +497,9 @@ namespace CppSharp.Generators.Cpp @@ -497,7 +497,9 @@ namespace CppSharp.Generators.Cpp
// Use the original typedef name if available, otherwise just use the function pointer type
string cppTypeName;
if (!decl.IsSynthetized)
{
cppTypeName = "::" + typedef.Declaration.QualifiedOriginalName;
}
else
{
cppTypeName = decl.Type.Visit(typePrinter, quals);

Loading…
Cancel
Save