From: mfranz Date: Thu, 10 Jul 2008 11:36:10 +0000 (+0000) Subject: return attribute mask as unsigned X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c9dccf4841dde03ac75001a6fa8453027d31f497;p=flightgear.git return attribute mask as unsigned --- diff --git a/src/Scripting/nasal-props.cxx b/src/Scripting/nasal-props.cxx index 3133d32ac..daffcd111 100644 --- a/src/Scripting/nasal-props.cxx +++ b/src/Scripting/nasal-props.cxx @@ -77,17 +77,17 @@ static naRef f_getType(naContext c, naRef me, int argc, naRef* args) static naRef f_getAttribute(naContext c, naRef me, int argc, naRef* args) { NODEARG(); - if(naVec_size(argv) == 0) return naNum((*node)->getAttributes()); + if(naVec_size(argv) == 0) return naNum(unsigned((*node)->getAttributes())); naRef val = naVec_get(argv, 0); char *a = naStr_data(val); SGPropertyNode::Attribute attr; if(!a) a = ""; - if(!strcmp(a, "children")) return naNum((*node)->nChildren()); + if(!strcmp(a, "last")) return naNum(SGPropertyNode::LAST_USED_ATTRIBUTE); + else if(!strcmp(a, "children")) return naNum((*node)->nChildren()); else if(!strcmp(a, "listeners")) return naNum((*node)->nListeners()); else if(!strcmp(a, "references")) return naNum(node->getNumRefs()); else if(!strcmp(a, "tied")) return naNum((*node)->isTied()); else if(!strcmp(a, "alias")) return naNum((*node)->isAlias()); - else if(!strcmp(a, "last")) return naNum(SGPropertyNode::LAST_USED_ATTRIBUTE); else if(!strcmp(a, "readable")) attr = SGPropertyNode::READ; else if(!strcmp(a, "writable")) attr = SGPropertyNode::WRITE; else if(!strcmp(a, "archive")) attr = SGPropertyNode::ARCHIVE;