Hi All.

please find below a diff to fix the clang build for
games/flightgear/base.

Ok? Comments?

Rafael Sadowski

Index: patches/patch-src_FDM_JSBSim_FGFDMExec_cpp
===================================================================
RCS file: patches/patch-src_FDM_JSBSim_FGFDMExec_cpp
diff -N patches/patch-src_FDM_JSBSim_FGFDMExec_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_FDM_JSBSim_FGFDMExec_cpp  20 Aug 2017 21:35:13 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+fix clang error:
+ordered comparison between pointer and zero
+
+Index: src/FDM/JSBSim/FGFDMExec.cpp
+--- src/FDM/JSBSim/FGFDMExec.cpp.orig
++++ src/FDM/JSBSim/FGFDMExec.cpp
+@@ -211,7 +211,7 @@ FGFDMExec::~FGFDMExec()
+   
+   SetGroundCallback(0);
+ 
+-  if (FDMctr > 0) (*FDMctr)--;
++  if (FDMctr) (*FDMctr)--;
+ 
+   Debug(1);
+ }
Index: patches/patch-src_FDM_JSBSim_input_output_FGInputSocket_cpp
===================================================================
RCS file: patches/patch-src_FDM_JSBSim_input_output_FGInputSocket_cpp
diff -N patches/patch-src_FDM_JSBSim_input_output_FGInputSocket_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_FDM_JSBSim_input_output_FGInputSocket_cpp 20 Aug 2017 
21:35:13 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+fix clang error:
+ordered comparison between pointer and zero
+
+Index: src/FDM/JSBSim/input_output/FGInputSocket.cpp
+--- src/FDM/JSBSim/input_output/FGInputSocket.cpp.orig
++++ src/FDM/JSBSim/input_output/FGInputSocket.cpp
+@@ -192,7 +192,7 @@ void FGInputSocket::Read(bool Holding)
+           } else {
+             socket->Reply("Must be in HOLD to search properties\n");
+           }
+-        } else if (node > 0) {
++        } else if (node) {
+           ostringstream buf;
+           buf << argument << " = " << setw(12) << setprecision(6) << 
node->getDoubleValue() << endl;
+           socket->Reply(buf.str());
Index: patches/patch-src_Network_native_ctrls_cxx
===================================================================
RCS file: patches/patch-src_Network_native_ctrls_cxx
diff -N patches/patch-src_Network_native_ctrls_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_Network_native_ctrls_cxx  20 Aug 2017 21:35:13 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+fix clang error:
+ordered comparison between pointer and zero
+
+Index: src/Network/native_ctrls.cxx
+--- src/Network/native_ctrls.cxx.orig
++++ src/Network/native_ctrls.cxx
+@@ -428,8 +428,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_fre
+ //    node->setDoubleValue( net->brake_right );
+ 
+     node = fgGetNode( "/controls/switches", true );
+-    node->setBoolValue( "master-bat", net->master_bat > 0 );
+-    node->setBoolValue( "master-alt", net->master_alt > 0);
++    node->setBoolValue( "master-bat", net->master_bat != nullptr );
++    node->setBoolValue( "master-alt", net->master_alt != nullptr );
+     node->setBoolValue( "master-avionics", net->master_avionics > 0);
+     
+     node = fgGetNode( "/environment", true );

Reply via email to