From 50b87a49d4e6c86034cc824760362046bec196ba Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Thu, 27 Jan 2022 02:17:28 +0600 Subject: [PATCH] Fix bunch of warnings from code analysis (#321) Warnings produced complain that re-throw did not properly capture stack trace. Given that these rethrow just to please compiler, I think it is better fix that. --- Source/Tools/GapiCodegen/CallbackGen.cs | 2 +- Source/Tools/GapiCodegen/VirtualMethod.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Tools/GapiCodegen/CallbackGen.cs b/Source/Tools/GapiCodegen/CallbackGen.cs index df733b6f2..9673b7174 100644 --- a/Source/Tools/GapiCodegen/CallbackGen.cs +++ b/Source/Tools/GapiCodegen/CallbackGen.cs @@ -246,7 +246,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (e, " + (fatal ? "true" : "false") + ");"); if (fatal) { sw.WriteLine ("\t\t\t\t// NOTREACHED: Above call does not return."); - sw.WriteLine ("\t\t\t\tthrow e;"); + sw.WriteLine ("\t\t\t\tthrow;"); } else if (retval.MarshalType == "bool") { sw.WriteLine ("\t\t\t\treturn false;"); } diff --git a/Source/Tools/GapiCodegen/VirtualMethod.cs b/Source/Tools/GapiCodegen/VirtualMethod.cs index 901ad02bd..79f82f8a0 100644 --- a/Source/Tools/GapiCodegen/VirtualMethod.cs +++ b/Source/Tools/GapiCodegen/VirtualMethod.cs @@ -117,7 +117,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (e, " + (fatal ? "true" : "false") + ");"); if (fatal) { sw.WriteLine ("\t\t\t\t// NOTREACHED: above call does not return."); - sw.WriteLine ("\t\t\t\tthrow e;"); + sw.WriteLine ("\t\t\t\tthrow;"); } if (call.HasDisposeParam) {