1
0
Fork 0

- airportinfo(): remove superfluous indices of threshold/stopway

- restore consistent coding style: no 2-space spaghetti code
  indentation, remove trailing spaces, no spaces after ( and before )
This commit is contained in:
mfranz 2008-09-23 20:06:40 +00:00
parent 82fcff36da
commit f2398fd983

View file

@ -555,24 +555,24 @@ static naRef f_airportinfo(naContext c, naRef me, int argc, naRef* args)
// set runway hash // set runway hash
naRef rwys = naNewHash(c); naRef rwys = naNewHash(c);
for (unsigned int r=0; r<apt->numRunways(); ++r) { for (unsigned int r=0; r<apt->numRunways(); ++r) {
FGRunway* rwy(apt->getRunwayByIndex(r)); FGRunway* rwy(apt->getRunwayByIndex(r));
naRef rwyid = naStr_fromdata(naNewString(c), naRef rwyid = naStr_fromdata(naNewString(c),
const_cast<char *>(rwy->ident().c_str()), const_cast<char *>(rwy->ident().c_str()),
rwy->ident().length()); rwy->ident().length());
naRef rwydata = naNewHash(c); naRef rwydata = naNewHash(c);
#define HASHSET(s,l,n) naHash_set(rwydata, naStr_fromdata(naNewString(c),s,l),n) #define HASHSET(s,l,n) naHash_set(rwydata, naStr_fromdata(naNewString(c),s,l),n)
HASHSET("id", 2, rwyid); HASHSET("id", 2, rwyid);
HASHSET("lat", 3, naNum(rwy->latitude())); HASHSET("lat", 3, naNum(rwy->latitude()));
HASHSET("lon", 3, naNum(rwy->longitude())); HASHSET("lon", 3, naNum(rwy->longitude()));
HASHSET("heading", 7, naNum(rwy->headingDeg())); HASHSET("heading", 7, naNum(rwy->headingDeg()));
HASHSET("length", 6, naNum(rwy->lengthM())); HASHSET("length", 6, naNum(rwy->lengthM()));
HASHSET("width", 5, naNum(rwy->widthM())); HASHSET("width", 5, naNum(rwy->widthM()));
HASHSET("threshold1", 10, naNum(rwy->_displ_thresh * SG_FEET_TO_METER)); HASHSET("threshold", 9, naNum(rwy->_displ_thresh * SG_FEET_TO_METER));
HASHSET("stopway1", 8, naNum(rwy->_stopway * SG_FEET_TO_METER)); HASHSET("stopway", 7, naNum(rwy->_stopway * SG_FEET_TO_METER));
#undef HASHSET #undef HASHSET
naHash_set(rwys, rwyid, rwydata); naHash_set(rwys, rwyid, rwydata);
} }
// set airport hash // set airport hash
@ -719,7 +719,7 @@ void FGNasalSys::loadPropertyScripts()
int j = 0; int j = 0;
SGPropertyNode *fn; SGPropertyNode *fn;
bool file_specified = false; bool file_specified = false;
while ( (fn = n->getChild("file", j)) != NULL ) { while((fn = n->getChild("file", j)) != NULL) {
file_specified = true; file_specified = true;
const char* file = fn->getStringValue(); const char* file = fn->getStringValue();
SGPath p(globals->get_fg_root()); SGPath p(globals->get_fg_root());