Eliminate most clang warnings

Originally committed to SVN as r6183.
This commit is contained in:
Thomas Goyne 2011-12-28 21:27:22 +00:00
parent 0eeb1d18fc
commit 68b2ae8275
10 changed files with 24 additions and 35 deletions

View file

@ -88,11 +88,6 @@ namespace {
lua_pushinteger(L, n); lua_pushinteger(L, n);
} }
inline void push_value(lua_State *L, double n)
{
lua_pushnumber(L, n);
}
template<class T> template<class T>
inline void set_field(lua_State *L, const char *name, T value) inline void set_field(lua_State *L, const char *name, T value)
{ {

View file

@ -333,7 +333,7 @@ namespace Automation4 {
FloatEdit(lua_State *L) FloatEdit(lua_State *L)
: Edit(L) : Edit(L)
, value(get_field(L, "value", 0)) , value(get_field(L, "value", 0.0))
{ {
// TODO: spin button support // TODO: spin button support
} }

View file

@ -163,7 +163,9 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent, AssFile *ass)
CenterOnParent(); CenterOnParent();
// Run dummy event to update label // Run dummy event to update label
Update(); wxCommandEvent evt;
evt.SetInt(-1);
OnRadio(evt);
} }
@ -296,15 +298,8 @@ void DialogFontsCollector::OnBrowse(wxCommandEvent &event) {
/// @param event /// @param event
/// ///
void DialogFontsCollector::OnRadio(wxCommandEvent &event) { void DialogFontsCollector::OnRadio(wxCommandEvent &event) {
Update(event.GetInt()); int value = event.GetInt();
}
/// @brief Update controls
/// @param value
///
void DialogFontsCollector::Update(int value) {
// Enable buttons // Enable buttons
CloseButton->Enable(true); CloseButton->Enable(true);
StartButton->Enable(true); StartButton->Enable(true);

View file

@ -138,7 +138,6 @@ class DialogFontsCollector : public wxDialog {
void OnBrowse(wxCommandEvent &event); void OnBrowse(wxCommandEvent &event);
void OnRadio(wxCommandEvent &event); void OnRadio(wxCommandEvent &event);
void OnAddText(wxCommandEvent &event); void OnAddText(wxCommandEvent &event);
void Update(int value=-1);
public: public:
DialogFontsCollector(wxWindow *parent, AssFile *subs); DialogFontsCollector(wxWindow *parent, AssFile *subs);

View file

@ -328,14 +328,14 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
OnSize(evt); OnSize(evt);
c->selectionController->AddSelectionListener(this); c->selectionController->AddSelectionListener(this);
file_changed_slot = c->ass->AddCommitListener(&SubsEditBox::Update, this); file_changed_slot = c->ass->AddCommitListener(&SubsEditBox::OnCommit, this);
context->videoController->AddTimecodesListener(&SubsEditBox::UpdateFrameTiming, this); context->videoController->AddTimecodesListener(&SubsEditBox::UpdateFrameTiming, this);
} }
SubsEditBox::~SubsEditBox() { SubsEditBox::~SubsEditBox() {
c->selectionController->RemoveSelectionListener(this); c->selectionController->RemoveSelectionListener(this);
} }
void SubsEditBox::Update(int type) { void SubsEditBox::OnCommit(int type) {
wxEventBlocker blocker(this); wxEventBlocker blocker(this);
if (type == AssFile::COMMIT_NEW || type & AssFile::COMMIT_STYLES) { if (type == AssFile::COMMIT_NEW || type & AssFile::COMMIT_STYLES) {
@ -419,7 +419,7 @@ void SubsEditBox::OnActiveLineChanged(AssDialogue *new_line) {
line = new_line; line = new_line;
commitId = -1; commitId = -1;
Update(AssFile::COMMIT_DIAG_FULL); OnCommit(AssFile::COMMIT_DIAG_FULL);
/// @todo VideoContext should be doing this /// @todo VideoContext should be doing this
if (c->videoController->IsLoaded()) { if (c->videoController->IsLoaded()) {

View file

@ -193,7 +193,7 @@ class SubsEditBox : public wxPanel, protected SelectionListener<AssDialogue> {
/// @brief Reload the current line from the file /// @brief Reload the current line from the file
/// @param type AssFile::CommitType /// @param type AssFile::CommitType
void Update(int type); void OnCommit(int type);
/// Regenerate the contents of the actor dropdown list /// Regenerate the contents of the actor dropdown list
void PopulateActorList(); void PopulateActorList();

View file

@ -233,7 +233,7 @@ enum {
STYLE_KARAOKE_VARIABLE STYLE_KARAOKE_VARIABLE
}; };
void SubsTextEditCtrl::SetStyle(int id, wxFont &font, std::string const& name) { void SubsTextEditCtrl::SetSyntaxStyle(int id, wxFont &font, std::string const& name) {
StyleSetFont(id, font); StyleSetFont(id, font);
StyleSetBold(id, OPT_GET("Colour/Subtitle/Syntax/Bold/" + name)->GetBool()); StyleSetBold(id, OPT_GET("Colour/Subtitle/Syntax/Bold/" + name)->GetBool());
StyleSetForeground(id, lagi_wxColour(OPT_GET("Colour/Subtitle/Syntax/" + name)->GetColour())); StyleSetForeground(id, lagi_wxColour(OPT_GET("Colour/Subtitle/Syntax/" + name)->GetColour()));
@ -249,17 +249,17 @@ void SubsTextEditCtrl::SetStyles() {
if (!fontname.empty()) font.SetFaceName(fontname); if (!fontname.empty()) font.SetFaceName(fontname);
font.SetPointSize(OPT_GET("Subtitle/Edit Box/Font Size")->GetInt()); font.SetPointSize(OPT_GET("Subtitle/Edit Box/Font Size")->GetInt());
SetStyle(STYLE_NORMAL, font, "Normal"); SetSyntaxStyle(STYLE_NORMAL, font, "Normal");
SetStyle(STYLE_COMMENT, font, "Comment"); SetSyntaxStyle(STYLE_COMMENT, font, "Comment");
SetStyle(STYLE_DRAWING, font, "Drawing"); SetSyntaxStyle(STYLE_DRAWING, font, "Drawing");
SetStyle(STYLE_OVERRIDE, font, "Brackets"); SetSyntaxStyle(STYLE_OVERRIDE, font, "Brackets");
SetStyle(STYLE_PUNCTUATION, font, "Slashes"); SetSyntaxStyle(STYLE_PUNCTUATION, font, "Slashes");
SetStyle(STYLE_TAG, font, "Tags"); SetSyntaxStyle(STYLE_TAG, font, "Tags");
SetStyle(STYLE_ERROR, font, "Error"); SetSyntaxStyle(STYLE_ERROR, font, "Error");
SetStyle(STYLE_PARAMETER, font, "Parameters"); SetSyntaxStyle(STYLE_PARAMETER, font, "Parameters");
SetStyle(STYLE_LINE_BREAK, font, "Line Break"); SetSyntaxStyle(STYLE_LINE_BREAK, font, "Line Break");
SetStyle(STYLE_KARAOKE_TEMPLATE, font, "Karaoke Template"); SetSyntaxStyle(STYLE_KARAOKE_TEMPLATE, font, "Karaoke Template");
SetStyle(STYLE_KARAOKE_VARIABLE, font, "Karaoke Variable"); SetSyntaxStyle(STYLE_KARAOKE_VARIABLE, font, "Karaoke Variable");
// Misspelling indicator // Misspelling indicator
IndicatorSetStyle(0,wxSTC_INDIC_SQUIGGLE); IndicatorSetStyle(0,wxSTC_INDIC_SQUIGGLE);

View file

@ -88,7 +88,7 @@ class SubsTextEditCtrl : public ScintillaTextCtrl {
void OnSetThesLanguage(wxCommandEvent &event); void OnSetThesLanguage(wxCommandEvent &event);
void OnLoseFocus(wxFocusEvent &event); void OnLoseFocus(wxFocusEvent &event);
void SetStyle(int id, wxFont &font, std::string const& name); void SetSyntaxStyle(int id, wxFont &font, std::string const& name);
void Subscribe(std::string const& name); void Subscribe(std::string const& name);
void StyleSpellCheck(); void StyleSpellCheck();

View file

@ -321,7 +321,7 @@ void SubtitlesGrid::DeleteLines(wxArrayInt target, bool flagModified) {
} }
// Add default line if file was wiped // Add default line if file was wiped
if (GetRows() == deleted) { if ((size_t)GetRows() == deleted) {
AssDialogue *def = new AssDialogue; AssDialogue *def = new AssDialogue;
++before_first; ++before_first;
context->ass->Line.insert(before_first, def); context->ass->Line.insert(before_first, def);

View file

@ -490,7 +490,7 @@ void VisualToolBase::GetLineRotation(AssDialogue *diag, float &rx, float &ry, fl
ry = tag->front()->Get<float>(ry); ry = tag->front()->Get<float>(ry);
if (param_vec tag = find_tag(diag, "\\frz")) if (param_vec tag = find_tag(diag, "\\frz"))
rz = tag->front()->Get<float>(rz); rz = tag->front()->Get<float>(rz);
else if (tag = find_tag(diag, "\\fr")) else if ((tag = find_tag(diag, "\\fr")))
rz = tag->front()->Get<float>(rz); rz = tag->front()->Get<float>(rz);
} }