Skip to content

Commit

Permalink
Fix remaining unused variable warnings
Browse files Browse the repository at this point in the history
and enable constructor argument reordered warnings, as they are also easy to
fix and quite numerous.

Continues work on #347.
  • Loading branch information
garfieldnate committed Mar 7, 2024
1 parent 52f8bef commit 729743d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
6 changes: 1 addition & 5 deletions Core/ClientSMLSWIG/Tcl/Tcl_sml_ClientInterface.i
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
static int ThreadEventProc(Tcl_Event *evPtr, int mask)
{
ThreadEvent *threadEventPtr = (ThreadEvent *)evPtr;
ThreadEventResult *resultPtr = threadEventPtr->resultPtr;
Tcl_Interp *interp = dispinterp;
int code;
char const* result;
Expand All @@ -77,8 +76,6 @@

// Check which thread we're on.
// I hope this is the thread I asked to be part of.
Tcl_ThreadId currentThread = Tcl_GetCurrentThread() ;

if (interp == NULL) {
code = TCL_ERROR;
result = "no target interp!";
Expand Down Expand Up @@ -110,7 +107,6 @@
int tcl_thread_send(Tcl_Interp* interp, Tcl_ThreadId id, Tcl_Obj* script)
{
ThreadEvent *threadEventPtr;
ThreadEventResult *resultPtr;
Tcl_ThreadId threadId = (Tcl_ThreadId) id;

// Cache the interpreter so we can find it again later
Expand All @@ -122,7 +118,7 @@

threadEventPtr = (ThreadEvent *) ckalloc(sizeof(ThreadEvent));
threadEventPtr->script = script;
resultPtr = threadEventPtr->resultPtr = NULL;
threadEventPtr->resultPtr = NULL;

/*
* Queue the event and poke the other thread's notifier.
Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ else:
# cflags.extend(['-Werror'])

# We're starting with something simple. We'll add more as we go.
cflags.append('-Wunused-variable')
cflags.extend(['-Wunused-variable', '-Wreorder-ctor'])

# warning doesn't exist in Apple's clang
if sys.platform != 'darwin':
Expand Down
2 changes: 1 addition & 1 deletion SoarCLI/soar_cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class InputThread : public soar_thread::Thread
}
bool readcmd(std::string& result)
{
int nestlvl, i, n;
int nestlvl, n;
std::string line;
std::stringstream cmd;

Expand Down
1 change: 1 addition & 0 deletions UnitTests/SoarUnitTests/FullTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ void FullTests_Parent::testRHSHandler()
no_agent_assertTrue(cppRhsHandlerReceived);

no_agent_assertTrue(m_pKernel->RemoveRhsFunction(callback_rhs1));
no_agent_assertTrue(m_pKernel->RemoveRhsFunction(callback_rhs_cpp));

// Re-add it without the bool that is getting popped off the stack
no_agent_assertTrue(m_pKernel->AddRhsFunction("test-rhs", Handlers::MyRhsFunctionHandler, 0));
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/TestExternalLibraryLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C"
// Soar calls this when the library is loaded
RHS_EXPORT const char *sml_InitLibrary(Kernel *pKernel, int argc, char **argv)
{
int callbackId = pKernel->AddRhsFunction("test", [](smlRhsEventId id, Agent *pAgent, char const *pFunctionName, char const *pArgument)
pKernel->AddRhsFunction("test", [](smlRhsEventId id, Agent *pAgent, char const *pFunctionName, char const *pArgument)
{ return "myLibTest"; });
return "";
}
Expand Down

0 comments on commit 729743d

Please sign in to comment.