← Back to team overview

kicad-developers team mailing list archive

[PATCH] Fix shadowed variable

 

Hi,

Here's a very simple patch to silence a warning in python_scripting.cpp.

Cheers,

John
From 44b26b52c37f1a3f48eaa7af8a5702acf4b37119 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Fri, 10 Mar 2017 02:59:36 +0800
Subject: [PATCH] Fix shadowed variable in python_scripting.cpp

---
 pcbnew/swig/python_scripting.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pcbnew/swig/python_scripting.cpp b/pcbnew/swig/python_scripting.cpp
index af57668de..0ffc9aff6 100644
--- a/pcbnew/swig/python_scripting.cpp
+++ b/pcbnew/swig/python_scripting.cpp
@@ -188,13 +188,13 @@ bool pcbnewInitPythonScripting( const char * aUserScriptingPath )
 
     // load pcbnew inside python, and load all the user plugins, TODO: add system wide plugins
     {
-        char cmd[1024];
+        char loadCmd[1024];
         PyLOCK lock;
-        snprintf( cmd, sizeof(cmd), "import sys, traceback\n"
+        snprintf( loadCmd, sizeof(loadCmd), "import sys, traceback\n"
                       "sys.path.append(\".\")\n"
                       "import pcbnew\n"
                       "pcbnew.LoadPlugins(\"%s\")", aUserScriptingPath );
-        PyRun_SimpleString( cmd );
+        PyRun_SimpleString( loadCmd );
     }
 
     return true;
-- 
2.12.0


Follow ups