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);
}
inline void push_value(lua_State *L, double n)
{
lua_pushnumber(L, n);
}
template<class T>
inline void set_field(lua_State *L, const char *name, T value)
{

View File

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

View File

@ -163,7 +163,9 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent, AssFile *ass)
CenterOnParent();
// 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
///
void DialogFontsCollector::OnRadio(wxCommandEvent &event) {
Update(event.GetInt());
}
int value = event.GetInt();
/// @brief Update controls
/// @param value
///
void DialogFontsCollector::Update(int value) {
// Enable buttons
CloseButton->Enable(true);
StartButton->Enable(true);

View File

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

View File

@ -328,14 +328,14 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
OnSize(evt);
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);
}
SubsEditBox::~SubsEditBox() {
c->selectionController->RemoveSelectionListener(this);
}
void SubsEditBox::Update(int type) {
void SubsEditBox::OnCommit(int type) {
wxEventBlocker blocker(this);
if (type == AssFile::COMMIT_NEW || type & AssFile::COMMIT_STYLES) {
@ -419,7 +419,7 @@ void SubsEditBox::OnActiveLineChanged(AssDialogue *new_line) {
line = new_line;
commitId = -1;
Update(AssFile::COMMIT_DIAG_FULL);
OnCommit(AssFile::COMMIT_DIAG_FULL);
/// @todo VideoContext should be doing this
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
/// @param type AssFile::CommitType
void Update(int type);
void OnCommit(int type);
/// Regenerate the contents of the actor dropdown list
void PopulateActorList();

View File

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

View File

@ -88,7 +88,7 @@ class SubsTextEditCtrl : public ScintillaTextCtrl {
void OnSetThesLanguage(wxCommandEvent &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 StyleSpellCheck();

View File

@ -321,7 +321,7 @@ void SubtitlesGrid::DeleteLines(wxArrayInt target, bool flagModified) {
}
// Add default line if file was wiped
if (GetRows() == deleted) {
if ((size_t)GetRows() == deleted) {
AssDialogue *def = new AssDialogue;
++before_first;
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);
if (param_vec tag = find_tag(diag, "\\frz"))
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);
}