From a298f5c8b5a85e22a38305730597edad9004db15 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Tue, 14 Feb 2017 03:08:21 +0000 Subject: [PATCH] Extract CSharpTypePrinter.GetPrimitiveTypeWidth to re-use it in Java type printer. --- .../Generators/CSharp/CSharpTypePrinter.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index acfcafed..e5804523 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -479,11 +479,9 @@ namespace CppSharp.Generators.CSharp return type.Type.FullName; } - static string GetIntString(PrimitiveType primitive, ParserTargetInfo targetInfo) + public static void GetPrimitiveTypeWidth(PrimitiveType primitive, + ParserTargetInfo targetInfo, out uint width, out bool signed) { - bool signed; - uint width; - switch (primitive) { case PrimitiveType.Short: @@ -521,6 +519,14 @@ namespace CppSharp.Generators.CSharp default: throw new NotImplementedException(); } + } + + static string GetIntString(PrimitiveType primitive, ParserTargetInfo targetInfo) + { + uint width; + bool signed; + + GetPrimitiveTypeWidth(primitive, targetInfo, out width, out signed); switch (width) {