From 46be23073e8f530e39892f51c885d8c44aeb437d Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 2 Aug 2010 20:25:29 +0000 Subject: [PATCH] Fix a few gcc warnings Originally committed to SVN as r4722. --- .../include/libaegisub/line_iterator.h | 16 ++++++++-------- aegisub/src/ass_file.cpp | 4 ++-- aegisub/src/ass_override.cpp | 4 ++-- aegisub/src/ass_style.cpp | 3 ++- aegisub/src/audio_player_alsa.cpp | 1 - aegisub/src/export_fixstyle.cpp | 1 - aegisub/src/export_framerate.cpp | 2 -- aegisub/src/subs_preview.cpp | 2 +- aegisub/src/video_provider_yuv4mpeg.cpp | 3 ++- 9 files changed, 17 insertions(+), 19 deletions(-) diff --git a/aegisub/libaegisub/include/libaegisub/line_iterator.h b/aegisub/libaegisub/include/libaegisub/line_iterator.h index 5a8f6570c..9f67b9810 100644 --- a/aegisub/libaegisub/include/libaegisub/line_iterator.h +++ b/aegisub/libaegisub/include/libaegisub/line_iterator.h @@ -156,26 +156,26 @@ void line_iterator::getline(std::string &str) { union { int32_t chr; char buf[4]; - }; + } u; for (;;) { - chr = 0; + u.chr = 0; #ifdef _WIN32 - std::streamsize read = stream->rdbuf()->_Sgetn_s(buf, 4, width); + std::streamsize read = stream->rdbuf()->_Sgetn_s(u.buf, 4, width); #else - std::streamsize read = stream->rdbuf()->sgetn(buf, width); + std::streamsize read = stream->rdbuf()->sgetn(u.buf, width); #endif if (read < (std::streamsize)width) { for (int i = 0; i < read; i++) { - str += buf[i]; + str += u.buf[i]; } stream->setstate(std::ios::eofbit); return; } - if (chr == cr) continue; - if (chr == lf) return; + if (u.chr == cr) continue; + if (u.chr == lf) return; for (int i = 0; i < read; i++) { - str += buf[i]; + str += u.buf[i]; } } } diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 875231ef9..578938739 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -69,8 +69,8 @@ namespace std { /// @brief AssFile constructor AssFile::AssFile () -: loaded(false) -, commitId(-1) +: commitId(-1) +, loaded(false) { } diff --git a/aegisub/src/ass_override.cpp b/aegisub/src/ass_override.cpp index d95d1899f..41faf50f4 100644 --- a/aegisub/src/ass_override.cpp +++ b/aegisub/src/ass_override.cpp @@ -124,8 +124,8 @@ void AssDialogueBlockOverride::ProcessParameters(AssDialogueBlockOverride::Proce } AssOverrideParamProto::AssOverrideParamProto(VariableDataType type,int opt,ASS_ParameterClass classi) -: type(type) -, optional(opt) +: optional(opt) +, type(type) , classification(classi) { } diff --git a/aegisub/src/ass_style.cpp b/aegisub/src/ass_style.cpp index 5c47fb050..6f0cad425 100644 --- a/aegisub/src/ass_style.cpp +++ b/aegisub/src/ass_style.cpp @@ -174,7 +174,8 @@ AssStyle::AssStyle() } AssStyle::AssStyle(const AssStyle& s) -: name(s.name) +: AssEntry(s) +, name(s.name) , font(s.font) , fontsize(s.fontsize) , primary(s.primary) diff --git a/aegisub/src/audio_player_alsa.cpp b/aegisub/src/audio_player_alsa.cpp index 68726ec31..ae5ab6c9d 100644 --- a/aegisub/src/audio_player_alsa.cpp +++ b/aegisub/src/audio_player_alsa.cpp @@ -391,7 +391,6 @@ void AlsaPlayer::async_write_handler(snd_async_handler_t *pcm_callback) void *buf = malloc(player->period * player->bpf); while (frames >= player->period) { - unsigned long start = player->cur_frame; player->provider->GetAudioWithVolume(buf, player->cur_frame, player->period, player->volume); int err = snd_pcm_writei(player->pcm_handle, buf, player->period); if(err == -EPIPE) { diff --git a/aegisub/src/export_fixstyle.cpp b/aegisub/src/export_fixstyle.cpp index 241c50a3f..25171d55b 100644 --- a/aegisub/src/export_fixstyle.cpp +++ b/aegisub/src/export_fixstyle.cpp @@ -67,7 +67,6 @@ void AssFixStylesFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog) { wxArrayString styles = subs->GetStyles(); std::for_each(styles.begin(), styles.end(), std::mem_fun_ref(&wxString::MakeLower)); styles.Sort(); - size_t n = styles.Count(); for (entryIter cur=subs->Line.begin();cur!=subs->Line.end();cur++) { AssDialogue *diag = dynamic_cast(*cur); diff --git a/aegisub/src/export_framerate.cpp b/aegisub/src/export_framerate.cpp index 47e03a132..ca88ae3c9 100644 --- a/aegisub/src/export_framerate.cpp +++ b/aegisub/src/export_framerate.cpp @@ -252,8 +252,6 @@ int AssTransformFramerateFilter::ConvertTime(int time) { int newEnd = Input->TimeAtFrame(frame + 1); int newDur = newEnd - newStart; - int dongs = Input->FrameAtTime(newStart + newDur * dist, agi::vfr::END); - return newStart + newDur * dist; } diff --git a/aegisub/src/subs_preview.cpp b/aegisub/src/subs_preview.cpp index 4b17e9085..714f6e649 100644 --- a/aegisub/src/subs_preview.cpp +++ b/aegisub/src/subs_preview.cpp @@ -61,10 +61,10 @@ /// SubtitlesPreview::SubtitlesPreview(wxWindow *parent,int id,wxPoint pos,wxSize size,int winStyle,wxColour col) : wxWindow(parent,id,pos,size,winStyle) +, style(new AssStyle) , backColour(col) , subFile(new AssFile) , line(new AssDialogue) -, style(new AssStyle) { line->Text = "{\\q2}preview"; diff --git a/aegisub/src/video_provider_yuv4mpeg.cpp b/aegisub/src/video_provider_yuv4mpeg.cpp index 8754cc373..b873b4468 100644 --- a/aegisub/src/video_provider_yuv4mpeg.cpp +++ b/aegisub/src/video_provider_yuv4mpeg.cpp @@ -54,12 +54,13 @@ /// @param filename The filename to open YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(wxString fname) : sf(NULL) +, inited(false) , w (0) , h (0) +, num_frames(-1) , cur_fn(-1) , pixfmt(Y4M_PIXFMT_NONE) , imode(Y4M_ILACE_NOTSET) -, num_frames(-1) { fps_rat.num = -1; fps_rat.den = 1;