[Scummvm-cvs-logs] SF.net SVN: scummvm:[42283] tools/branches/gsoc2009-gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Jul 9 11:12:55 CEST 2009
Revision: 42283
http://scummvm.svn.sourceforge.net/scummvm/?rev=42283&view=rev
Author: fingolfin
Date: 2009-07-09 09:12:54 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
Fixed some warnings and formatting
Modified Paths:
--------------
tools/branches/gsoc2009-gui/compress.h
tools/branches/gsoc2009-gui/compress_gob.cpp
tools/branches/gsoc2009-gui/compress_tinsel.cpp
tools/branches/gsoc2009-gui/compress_touche.cpp
tools/branches/gsoc2009-gui/extract_gob_stk.cpp
tools/branches/gsoc2009-gui/extract_loom_tg16.cpp
tools/branches/gsoc2009-gui/extract_mm_apple.cpp
tools/branches/gsoc2009-gui/extract_mm_c64.cpp
tools/branches/gsoc2009-gui/extract_parallaction.cpp
tools/branches/gsoc2009-gui/extract_zak_c64.cpp
tools/branches/gsoc2009-gui/gui/pages.cpp
tools/branches/gsoc2009-gui/gui/tools.cpp
tools/branches/gsoc2009-gui/tool.cpp
tools/branches/gsoc2009-gui/utils/file.cpp
Modified: tools/branches/gsoc2009-gui/compress.h
===================================================================
--- tools/branches/gsoc2009-gui/compress.h 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/compress.h 2009-07-09 09:12:54 UTC (rev 42283)
@@ -39,11 +39,13 @@
*/
/* These are the defaults parameters for the Lame invocation */
-#define minBitrDef_str "24"
+#define minBitrDef 24
#define maxBitrDef_str "64"
#define algqualDef_str "2"
#define vbrqualDef_str "4"
+#define INT_STR(x) #x
+
/* The default for oggenc invocation is to use the --quality option only */
#define oggqualDef_str "3"
@@ -111,7 +113,6 @@
/* Integer definitions for the constants above */
-#define minBitrDef atoi(minBitrDef_str)
#define maxBitrDef atoi(maxBitrDef_str)
#define algqualDef atoi(algqualDef_str)
#define vbrqualDef atoi(vbrqualDef_str)
@@ -128,7 +129,7 @@
"(If one of these is specified, it must be the first parameter.)\n" \
\
"\nMP3 mode params:\n" \
- " -b <rate> <rate> is the target bitrate(ABR)/minimal bitrate(VBR) (default:" minBitrDef_str "%d)\n" \
+ " -b <rate> <rate> is the target bitrate(ABR)/minimal bitrate(VBR) (default:" INT_STR(minBitrDef) "%d)\n" \
" -B <rate> <rate> is the maximum VBR/ABR bitrate (default:%" maxBitrDef_str ")\n" \
" --vbr LAME uses the VBR mode (default)\n" \
" --abr LAME uses the ABR mode\n" \
Modified: tools/branches/gsoc2009-gui/compress_gob.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_gob.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/compress_gob.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -194,7 +194,7 @@
File src;
uint32 tmpSize;
- while(curChunk) {
+ while (curChunk) {
inpath->setFullName(curChunk->name);
src.open(*inpath, "rb");
Modified: tools/branches/gsoc2009-gui/compress_tinsel.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_tinsel.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/compress_tinsel.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -118,9 +118,9 @@
double k0 = 0, k1 = 0;
double d0 = 0, d1 = 0;
uint32 blockAlign, blockPos;
- uint16 chunkData;
- int16 chunkWord;
- uint8 headerByte, filterVal, chunkPos;
+ uint16 chunkData = 0;
+ int16 chunkWord = 0;
+ uint8 headerByte, filterVal, chunkPos = 0;
const double eVal = 1.032226562;
uint32 decodeLeft = 0, decodedCount = 0;
uint32 uncompressedSize;
@@ -259,13 +259,12 @@
inpath_smp = _inputPaths[0];
inpath_idx = inpath_smp;
inpath_idx.setExtension(".idx");
- } else if(_inputPaths.size() == 2) {
+ } else if (_inputPaths.size() == 2) {
inpath_smp = _inputPaths[0];
inpath_idx = _inputPaths[1];
} else {
error("At most two input files expected!");
}
- Filename &outpath = _outputPath;
_input_idx.open(inpath_idx, "rb");
_input_smp.open(inpath_smp, "rb");
Modified: tools/branches/gsoc2009-gui/compress_touche.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_touche.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/compress_touche.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -41,7 +41,7 @@
CompressTouche::CompressTouche(const std::string &name) : CompressionTool(name) {
_inputFromDirectory = true;
- const char *helptext = "\nUsage: %s [params] [-o outputfile TOUCHE.*] <inputdir>\n* differs with compression type.\n" kCompressionAudioHelp;
+// const char *helptext = "\nUsage: %s [params] [-o outputfile TOUCHE.*] <inputdir>\n* differs with compression type.\n" kCompressionAudioHelp;
}
uint32 CompressTouche::compress_sound_data_file(uint32 current_offset, File &output, File &input, uint32 *offs_table, uint32 *size_table, int len) {
Modified: tools/branches/gsoc2009-gui/extract_gob_stk.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_gob_stk.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/extract_gob_stk.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -93,7 +93,7 @@
uint16 numDataChunks = readUint16LE(stk);
// If we are run multiple times, free previous chunk list
- if(_chunks)
+ if (_chunks)
delete _chunks;
_chunks = new Chunk;
Chunk *curChunk = _chunks;
Modified: tools/branches/gsoc2009-gui/extract_loom_tg16.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_loom_tg16.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/extract_loom_tg16.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -1242,7 +1242,7 @@
Filename inpath(_inputPaths[0]);
Filename &outpath = _outputPath;
- if(outpath.empty())
+ if (outpath.empty())
// Standard output path
outpath.setFullPath("out/");
Modified: tools/branches/gsoc2009-gui/extract_mm_apple.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_apple.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/extract_mm_apple.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -58,7 +58,7 @@
Filename inpath2(_inputPaths[1]);
Filename &outpath = _outputPath;
- if(outpath.empty())
+ if (outpath.empty())
// Standard output path
outpath.setFullPath("out/");
Modified: tools/branches/gsoc2009-gui/extract_mm_c64.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_c64.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/extract_mm_c64.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -59,7 +59,7 @@
Filename inpath2(_inputPaths[1]);
Filename &outpath = _outputPath;
- if(outpath.empty())
+ if (outpath.empty())
// Standard output path
outpath.setFullPath("out/");
Modified: tools/branches/gsoc2009-gui/extract_parallaction.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_parallaction.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/extract_parallaction.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -297,7 +297,7 @@
}
void ExtractParallaction::parseExtraArguments() {
- if(_arguments[_arguments_parsed] == "--small") {
+ if (_arguments[_arguments_parsed] == "--small") {
_small = true;
++_arguments_parsed;
}
@@ -311,7 +311,7 @@
Filename inpath(_inputPaths[0]);
Filename &outpath = _outputPath;
- if(outpath.empty())
+ if (outpath.empty())
outpath.setFullPath("out/");
Archive arc(*this);
Modified: tools/branches/gsoc2009-gui/extract_zak_c64.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_zak_c64.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/extract_zak_c64.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -60,7 +60,7 @@
Filename inpath2(_inputPaths[1]);
Filename &outpath = _outputPath;
- if(outpath.empty())
+ if (outpath.empty())
// Standard output path
outpath.setFullPath("out/");
Modified: tools/branches/gsoc2009-gui/gui/pages.cpp
===================================================================
--- tools/branches/gsoc2009-gui/gui/pages.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/gui/pages.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -178,7 +178,7 @@
wxArrayString choices;
- if(_options.size()) {
+ if (!_options.empty()) {
sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("There are multiple possible tools for this input, please select the correct one.")));
choices = _options;
@@ -208,7 +208,7 @@
}
void ChooseToolPage::onNext(wxWindow *panel) {
- if(_configuration.advanced)
+ if (_configuration.advanced)
switchPage(new ChooseInPage(_topframe));
else
// TODO: Display extra input page
@@ -267,9 +267,9 @@
}
void ChooseInPage::save(wxWindow *panel) {
- wxWindow *outputWindow = panel->FindWindowByName(wxT("OutputPicker"));
- wxDirPickerCtrl *outDirWindow = dynamic_cast<wxDirPickerCtrl *>(outputWindow);
- wxFilePickerCtrl *outFileWindow = dynamic_cast<wxFilePickerCtrl *>(outputWindow);
+// wxWindow *outputWindow = panel->FindWindowByName(wxT("OutputPicker"));
+// wxDirPickerCtrl *outDirWindow = dynamic_cast<wxDirPickerCtrl *>(outputWindow);
+// wxFilePickerCtrl *outFileWindow = dynamic_cast<wxFilePickerCtrl *>(outputWindow);
_configuration.inputFilePaths.clear();
@@ -283,7 +283,7 @@
}
void ChooseInPage::onNext(wxWindow *panel) {
- if(_configuration.advanced)
+ if (_configuration.advanced)
// TODO: Display extra input page
switchPage(new ChooseOutPage(_topframe));
else
@@ -364,7 +364,7 @@
int i = 1;
for (ToolInputs::const_iterator iter = tool._inputs.begin(); iter != tool._inputs.end(); ++iter) {
- const ToolInput &input = *iter;
+// const ToolInput &input = *iter;
wxString windowName = wxT("InputPicker");
windowName << i;
@@ -931,7 +931,7 @@
}
bool ProcessPage::onIdle(wxPanel *panel) {
- if(!_thread)
+ if (!_thread)
return false;
{
@@ -943,7 +943,7 @@
}
// Check if thread finished
- if(_thread && _thread->_finished) {
+ if (_thread && _thread->_finished) {
// It's done, Wait deallocates resources
_thread->Wait();
delete _thread;
@@ -1018,7 +1018,7 @@
sizer->AddSpacer(15);
wxString text;
- if(_topframe->_configuration.selectedTool->_type == TOOLTYPE_COMPRESSION)
+ if (_topframe->_configuration.selectedTool->_type == TOOLTYPE_COMPRESSION)
text = wxT("You have finished the wizard! Your files should now be compressed.");
else
text = wxT("You have finished the wizard! Your files should now be extracted.");
Modified: tools/branches/gsoc2009-gui/gui/tools.cpp
===================================================================
--- tools/branches/gsoc2009-gui/gui/tools.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/gui/tools.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -302,12 +302,12 @@
void ToolGUI::run(const Configuration &conf) const {
_backend->_inputPaths.clear();
- for(wxArrayString::const_iterator iter = conf.inputFilePaths.begin(); iter != conf.inputFilePaths.end(); ++iter)
+ for (wxArrayString::const_iterator iter = conf.inputFilePaths.begin(); iter != conf.inputFilePaths.end(); ++iter)
_backend->_inputPaths.push_back((const char *)iter->mb_str());
_backend->_outputPath = std::string(conf.outputPath.mb_str());
CompressionTool *compression = dynamic_cast<CompressionTool *>(_backend);
- if(compression) {
+ if (compression) {
// mp3
compression->_mp3ABRBitrate = (const char *)conf.mp3ABRBitrate.mb_str();
compression->_mp3CompressionType = (const char *)conf.mp3CompressionType.mb_str();
Modified: tools/branches/gsoc2009-gui/tool.cpp
===================================================================
--- tools/branches/gsoc2009-gui/tool.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/tool.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -51,7 +51,7 @@
argv += 1;
_arguments.clear();
- for(int i = 0; i < argc; ++i)
+ for (int i = 0; i < argc; ++i)
_arguments.push_back(argv[i]);
_arguments_parsed = 0;
_argv = 0;
@@ -72,7 +72,7 @@
// Read input files from CLI
while (_arguments_parsed < _arguments.size()) {
std::string &in = _arguments[_arguments_parsed++];
- if(_inputFromDirectory) {
+ if (_inputFromDirectory) {
// Append '/' to input if it's not already done
// TODO: We need a way to detect a proper directory here!
size_t s = in.size();
Modified: tools/branches/gsoc2009-gui/utils/file.cpp
===================================================================
--- tools/branches/gsoc2009-gui/utils/file.cpp 2009-07-09 09:10:05 UTC (rev 42282)
+++ tools/branches/gsoc2009-gui/utils/file.cpp 2009-07-09 09:12:54 UTC (rev 42283)
@@ -35,7 +35,7 @@
}
File::~File() {
- if(_owned)
+ if (_owned)
close();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list