]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a couple of 64-bit warnings identified by GCC.
authorThorstenB <brehmt@gmail.com>
Sun, 25 Nov 2012 23:23:10 +0000 (00:23 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 25 Nov 2012 23:23:10 +0000 (00:23 +0100)
PositionedID is of "int64_t", which depends on platform: apparently it is
"long long int" for Mac (requiring %lld format), but it is "long int" for
64bit Linux (requiring %ld). To avoid a "compiler warning fix commit
war" ;-) use a type cast to the longest common type (long long int).

src/AIModel/AIFlightPlanCreate.cxx
src/AIModel/AIFlightPlanCreatePushBack.cxx

index 388516ffa27954978850226e2ad8db695330e1e6..b19099d6fd9ecb13d267ad45400c8de7060fa86e 100644 (file)
@@ -311,7 +311,7 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
     //cerr << "Building taxi route" << endl;
     while (taxiRoute.next(&node)) {
         char buffer[10];
-        snprintf(buffer, 10, "%lld", node);
+        snprintf(buffer, 10, "%lld", (long long int) node);
         FGTaxiNode *tn =
             apt->getDynamics()->getGroundNetwork()->findNode(node);
         FGAIWaypoint *wpt =
@@ -416,7 +416,7 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
     for (int i = 0; i < size - 2; i++) {
         taxiRoute.next(&node);
         char buffer[10];
-        snprintf(buffer, 10, "%lld", node);
+        snprintf(buffer, 10, "%lld",  (long long int) node);
         FGTaxiNode *tn = gn->findNode(node);
         FGAIWaypoint *wpt =
             createOnGround(ac, buffer, tn->geod(), apt->getElevation(),
index 976463ccf74867e0396afe658fd41495627a4677..eeecfe70b8aa7dbe21cad1b8ddcf96570cedb0cd 100644 (file)
@@ -98,7 +98,7 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
         while (route.next(&node))
         {
             char buffer[10];
-            snprintf (buffer, 10, "%lld", node);
+            snprintf (buffer, 10, "%lld",  (long long int) node);
             FGTaxiNode *tn = groundNet->findNode(node);
             FGAIWaypoint *wpt = createOnGround(ac, string(buffer), tn->geod(), dep->getElevation(), vTaxiBackward);