From 32b52e80411d5bf23fc6add0a5ec67a24690c847 Mon Sep 17 00:00:00 2001 From: Joshua Olson <0joshua.olson1@gmail.com> Date: Wed, 26 Aug 2015 14:21:04 -0600 Subject: Fixed misspelled local variable for code clarity Specifically, tar(g)et_fps --- main/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main') diff --git a/main/main.cpp b/main/main.cpp index 19ee1c115f..acc122233a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1454,9 +1454,9 @@ bool Main::iteration() { OS::get_singleton()->delay_usec( OS::get_singleton()->get_frame_delay()*1000 ); } - int taret_fps = OS::get_singleton()->get_target_fps(); - if (taret_fps>0) { - uint64_t time_step = 1000000L/taret_fps; + int target_fps = OS::get_singleton()->get_target_fps(); + if (target_fps>0) { + uint64_t time_step = 1000000L/target_fps; target_ticks += time_step; uint64_t current_ticks = OS::get_singleton()->get_ticks_usec(); if (current_ticksdelay_usec(target_ticks-current_ticks); -- cgit v1.2.3 From 692216b86ab97db91e7ff3903ffc9ac8e37433f6 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Wed, 16 Sep 2015 15:51:19 -0500 Subject: ran cppcheck, fixed cases where array index is used before limits check --- main/main.cpp | 86 +++++++++++++++++++++++++---------------------------------- 1 file changed, 37 insertions(+), 49 deletions(-) (limited to 'main') diff --git a/main/main.cpp b/main/main.cpp index 84f7c3a88e..19ee5c7970 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1006,61 +1006,49 @@ bool Main::start() { bool export_debug=false; List args = OS::get_singleton()->get_cmdline_args(); for (int i=0;i_custom_level=args[i+1]; + } else if (args[i]=="-test") { + test=args[i+1]; + } else if (args[i]=="-optimize") { + optimize=args[i+1]; + } else if (args[i]=="-optimize_preset") { + optimize_preset=args[i+1]; + } else if (args[i]=="-export") { + editor=true; //needs editor + _export_platform=args[i+1]; + } else if (args[i]=="-export_debug") { + editor=true; //needs editor + _export_platform=args[i+1]; + export_debug=true; + } else if (args[i]=="-import") { + editor=true; //needs editor + _import=args[i+1]; + } else if (args[i]=="-import_script") { + editor=true; //needs editor + _import_script=args[i+1]; + } else if (args[i]=="-dumpstrings") { + editor=true; //needs editor + dumpstrings=args[i+1]; + } i++; - }else if (args[i]=="-nodocbase") { - + } + //parameters that do not have an argument to the right + if (args[i]=="-nodocbase") { doc_base=false; - } else if ((args[i]=="-script" || args[i]=="-s") && i <(args.size()-1)) { - - script=args[i+1]; - i++; - } else if ((args[i]=="-level" || args[i]=="-l") && i <(args.size()-1)) { - - OS::get_singleton()->_custom_level=args[i+1]; - i++; - } else if (args[i]=="-test" && i <(args.size()-1)) { - test=args[i+1]; - i++; - } else if (args[i]=="-optimize" && i <(args.size()-1)) { - optimize=args[i+1]; - i++; - } else if (args[i]=="-optimize_preset" && i <(args.size()-1)) { - optimize_preset=args[i+1]; - i++; - } else if (args[i]=="-export" && i <(args.size()-1)) { - editor=true; //needs editor - _export_platform=args[i+1]; - i++; - } else if (args[i]=="-export_debug" && i <(args.size()-1)) { - editor=true; //needs editor - _export_platform=args[i+1]; - export_debug=true; - i++; - } else if (args[i]=="-import" && i <(args.size()-1)) { - editor=true; //needs editor - _import=args[i+1]; - i++; - } else if (args[i]=="-import_script" && i <(args.size()-1)) { - editor=true; //needs editor - _import_script=args[i+1]; - i++; - } else if (args[i]=="-noquit" ) { + } else if (args[i]=="-noquit") { noquit=true; - } else if (args[i]=="-dumpstrings" && i <(args.size()-1)) { - editor=true; //needs editor - dumpstrings=args[i+1]; - i++; - } else if (args[i]=="-editor" || args[i]=="-e") { - editor=true; } else if (args[i]=="-convert_old") { convert_old=true; + } else if (args[i]=="-editor" || args[i]=="-e") { + editor=true; } else if (args[i].length() && args[i][0] != '-' && game_path == "") { - game_path=args[i]; } } -- cgit v1.2.3