From 3949ccec2427444d9394e25ddf044f075b67931b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 2 Dec 2012 12:36:11 -0800 Subject: [PATCH] Drop the position argument from ProcessParametersCallback since nothing needs it --- aegisub/src/ass_dialogue.h | 6 +++--- aegisub/src/ass_override.cpp | 20 ++++++++------------ aegisub/src/dialog_resample.cpp | 2 +- aegisub/src/dialog_style_editor.cpp | 2 +- aegisub/src/export_framerate.cpp | 2 +- aegisub/src/export_framerate.h | 3 +-- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/aegisub/src/ass_dialogue.h b/aegisub/src/ass_dialogue.h index c1b351195..7c8d51f0f 100644 --- a/aegisub/src/ass_dialogue.h +++ b/aegisub/src/ass_dialogue.h @@ -110,11 +110,11 @@ public: void AddTag(wxString const& tag); /// Type of callback function passed to ProcessParameters - typedef void (*ProcessParametersCallback)(wxString,int,AssOverrideParameter*,void *); + typedef void (*ProcessParametersCallback)(wxString const&, AssOverrideParameter *, void *); /// @brief Process parameters via callback - /// @param callback The callback function to call per tag paramer + /// @param callback The callback function to call per tag parameter /// @param userData User data to pass to callback function - void ProcessParameters(ProcessParametersCallback callback,void *userData); + void ProcessParameters(ProcessParametersCallback callback, void *userData); }; class AssDialogue : public AssEntry { diff --git a/aegisub/src/ass_override.cpp b/aegisub/src/ass_override.cpp index ea12c14c2..520550353 100644 --- a/aegisub/src/ass_override.cpp +++ b/aegisub/src/ass_override.cpp @@ -98,20 +98,16 @@ wxString AssDialogueBlockOverride::GetText() { return text; } -void AssDialogueBlockOverride::ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData) { - for (auto curTag : Tags) { - // Find parameters - for (size_t n = 0; n < curTag->Params.size(); ++n) { - AssOverrideParameter *curPar = curTag->Params[n]; +void AssDialogueBlockOverride::ProcessParameters(ProcessParametersCallback callback, void *userData) { + for (auto tag : Tags) { + for (auto par : tag->Params) { + if (par->GetType() == VARDATA_NONE || par->omitted) continue; - if (curPar->GetType() != VARDATA_NONE && !curPar->omitted) { - (*callback)(curTag->Name, n, curPar, userData); + callback(tag->Name, par, userData); - // Go recursive if it's a block parameter - if (curPar->GetType() == VARDATA_BLOCK) { - curPar->Get()->ProcessParameters(callback,userData); - } - } + // Go recursive if it's a block parameter + if (par->GetType() == VARDATA_BLOCK) + par->Get()->ProcessParameters(callback, userData); } } } diff --git a/aegisub/src/dialog_resample.cpp b/aegisub/src/dialog_resample.cpp index 25efc743e..a04fa301d 100644 --- a/aegisub/src/dialog_resample.cpp +++ b/aegisub/src/dialog_resample.cpp @@ -153,7 +153,7 @@ namespace { double ar; }; - void resample_tags(wxString name, int n, AssOverrideParameter *cur, void *ud) { + void resample_tags(wxString const& name, AssOverrideParameter *cur, void *ud) { resample_state *state = static_cast(ud); double resizer = 1.0; diff --git a/aegisub/src/dialog_style_editor.cpp b/aegisub/src/dialog_style_editor.cpp index 99b87f696..bad215a15 100644 --- a/aegisub/src/dialog_style_editor.cpp +++ b/aegisub/src/dialog_style_editor.cpp @@ -74,7 +74,7 @@ class StyleRenamer { wxString new_name; /// Process a single override parameter to check if it's \r with this style name - static void ProcessTag(wxString tag, int, AssOverrideParameter* param, void *userData) { + static void ProcessTag(wxString const& tag, AssOverrideParameter* param, void *userData) { StyleRenamer *self = static_cast(userData); if (tag == "\\r" && param->GetType() == VARDATA_TEXT && param->Get() == self->source_name) { if (self->do_replace) diff --git a/aegisub/src/export_framerate.cpp b/aegisub/src/export_framerate.cpp index 46bba42b5..c017d8c82 100644 --- a/aegisub/src/export_framerate.cpp +++ b/aegisub/src/export_framerate.cpp @@ -168,7 +168,7 @@ int FORCEINLINE trunc_cs(int time) { return (time / 10) * 10; } -void AssTransformFramerateFilter::TransformTimeTags(wxString name,int n,AssOverrideParameter *curParam,void *curData) { +void AssTransformFramerateFilter::TransformTimeTags(wxString const& name, AssOverrideParameter *curParam, void *curData) { VariableDataType type = curParam->GetType(); if (type != VARDATA_INT && type != VARDATA_FLOAT) return; diff --git a/aegisub/src/export_framerate.h b/aegisub/src/export_framerate.h index 96bf6e144..391c812b3 100644 --- a/aegisub/src/export_framerate.h +++ b/aegisub/src/export_framerate.h @@ -41,7 +41,6 @@ class wxCheckBox; class wxRadioButton; class wxTextCtrl; -/// DOCME /// @class AssTransformFramerateFilter /// @brief Transform subtitle times, including those in override tags, from an input framerate to an output framerate class AssTransformFramerateFilter : public AssExportFilter { @@ -73,7 +72,7 @@ class AssTransformFramerateFilter : public AssExportFilter { /// @param name Name of the tag /// @param curParam Current parameter being processed /// @param userdata Filter instance - static void TransformTimeTags(wxString name,int,AssOverrideParameter *curParam,void *userdata); + static void TransformTimeTags(wxString const& name, AssOverrideParameter *curParam, void *userdata); /// @brief Convert a time from the input frame rate to the output frame rate /// @param time Time in ms to convert