Skip to content

Commit

Permalink
Compile warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sammyfreg committed Nov 16, 2023
1 parent d31e952 commit 0c2b841
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Build/netImgui.sharpmake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public override void ConfigureAll(Configuration conf, NetImguiTarget target)
}

// Test compiling netImgui with the Disabled Define
[Sharpmake.Generate] public class ProjectNetImgui_Disabled : ProjectNetImgui {
[Sharpmake.Generate] public class ProjectNetImgui_Disabled : ProjectNetImgui
{
public ProjectNetImgui_Disabled() : base(NetImguiTarget.GetPath(ProjectImgui.sDefaultPath)) { Name = "NetImguiLib (Disabled)"; }

public override void ConfigureAll(Configuration conf, NetImguiTarget target)
Expand Down
2 changes: 1 addition & 1 deletion Build/shared.sharpmake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public virtual void ConfigureAll(Configuration conf, NetImguiTarget target)
conf.Output = mIsExe ? Project.Configuration.OutputType.Exe : Project.Configuration.OutputType.Lib;

conf.IncludePaths.Add(NetImguiTarget.GetPath(ProjectImgui.sDefaultPath) + @"\backends");

conf.IncludePaths.Add(NetImguiTarget.GetPath(@"\Code\Client"));
if ( target.Compiler == Compiler.Clang ){
conf.Options.Add(Options.Vc.General.PlatformToolset.ClangCL);
conf.AdditionalCompilerOptions.Add("-Wno-unused-command-line-argument"); //Note: Latest Clang doesn't support '/MP' (multiprocessor build) option, creating a compile error
Expand Down
3 changes: 2 additions & 1 deletion Code/Client/Private/NetImgui_Api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ static inline void AddKeyAnalogEvent(const Client::ClientInfo& client, const Cmd
#if IMGUI_VERSION_NUM < 18700
IM_UNUSED(client); IM_UNUSED(pCmdInput); IM_UNUSED(netimguiKey); IM_UNUSED(imguiKey);
#else
int indexAnalog = ImMin(netimguiKey - CmdInput::kAnalog_First, CmdInput::kAnalog_Count-1);
int indexAnalog = netimguiKey - CmdInput::kAnalog_First;
indexAnalog = indexAnalog >= CmdInput::kAnalog_Count ? CmdInput::kAnalog_Count - 1 : indexAnalog;
float analogValue = pCmdInput->mInputAnalog[indexAnalog];
bool bChanged = (pCmdInput->mInputDownMask[valIndex] ^ client.mPreviousInputState.mInputDownMask[valIndex]) & valMask;
bChanged |= abs(client.mPreviousInputState.mInputAnalog[indexAnalog] - analogValue) > 0.001f;
Expand Down
4 changes: 2 additions & 2 deletions Code/Client/Private/NetImgui_Shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#ifndef NETIMGUI_INTERNAL_INCLUDE
#define NETIMGUI_INTERNAL_INCLUDE 1
#include "../NetImgui_Api.h"
#include "NetImgui_Api.h"
#undef NETIMGUI_INTERNAL_INCLUDE
#else
#include "../NetImgui_Api.h"
#include "NetImgui_Api.h"
#endif

#if NETIMGUI_ENABLED
Expand Down
1 change: 1 addition & 0 deletions Code/Client/Private/NetImgui_WarningDisable.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
//
// Deactivate a few warnings to allow internal netImgui code to compile
// with 'Warning as error' and '-Wall' compile actions enabled
Expand Down
1 change: 1 addition & 0 deletions Code/Client/Private/NetImgui_WarningDisableImgui.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
//
// Deactivate a few warnings to allow Imgui header includes,
// without generating warnings in '-Wall' compile actions enabled
Expand Down
1 change: 1 addition & 0 deletions Code/Client/Private/NetImgui_WarningDisableStd.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
//
// Deactivate a few more warnings to allow standard header includes,
// without generating warnings in '-Wall' compile actions enabled
Expand Down
2 changes: 2 additions & 0 deletions Code/Client/Private/NetImgui_WarningReenable.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#pragma once

//=================================================================================================
// Clang
//=================================================================================================
Expand Down

0 comments on commit 0c2b841

Please sign in to comment.