aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-04 21:54:09 +1000
committerDavid Walter Seikel2012-02-04 21:54:09 +1000
commit146960e05e180eba27d61d2e8f7a311736880e81 (patch)
tree80300d499b69e5ff8ade114d7035deae10f34727 /LuaSL/src
parentCooment a problem with typecasting strings to integers. (diff)
downloadSledjHamr-146960e05e180eba27d61d2e8f7a311736880e81.zip
SledjHamr-146960e05e180eba27d61d2e8f7a311736880e81.tar.gz
SledjHamr-146960e05e180eba27d61d2e8f7a311736880e81.tar.bz2
SledjHamr-146960e05e180eba27d61d2e8f7a311736880e81.tar.xz
Set variables to a proper value if otherwised unitialized.
Diffstat (limited to 'LuaSL/src')
-rw-r--r--LuaSL/src/LuaSL_compile.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index a9375d9..f3fddef 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -2280,8 +2280,18 @@ static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content
2280 outputText(file, &(content->value.identifierValue->name), !(LSL_NOIGNORE & content->toKen->flags)); 2280 outputText(file, &(content->value.identifierValue->name), !(LSL_NOIGNORE & content->toKen->flags));
2281 if (OM_LUA == mode) 2281 if (OM_LUA == mode)
2282 { 2282 {
2283 // TODO - should output a default value depending on type. 2283 switch (content->basicType)
2284 fprintf(file, " = nil"); 2284 {
2285 case OT_bool : fprintf(file, " = false"); break;
2286 case OT_integer : fprintf(file, " = 0"); break;
2287 case OT_float : fprintf(file, " = 0.0"); break;
2288 case OT_key : fprintf(file, " = _LSL.NULL_KEY"); break;
2289 case OT_list : fprintf(file, " = {}"); break;
2290 case OT_rotation : fprintf(file, " = _LSL.ZERO_ROTATION"); break;
2291 case OT_string : fprintf(file, " = \"\""); break;
2292 case OT_vector : fprintf(file, " = _LSL.ZERO_VECTOR"); break;
2293 default : fprintf(file, " = nil"); break;
2294 }
2285 } 2295 }
2286 } 2296 }
2287 else 2297 else