Fix a few gcc warnings

Originally committed to SVN as r4722.
This commit is contained in:
Thomas Goyne 2010-08-02 20:25:29 +00:00
parent ce97d995b4
commit 46be23073e
9 changed files with 17 additions and 19 deletions

View file

@ -156,26 +156,26 @@ void line_iterator<OutputType>::getline(std::string &str) {
union { union {
int32_t chr; int32_t chr;
char buf[4]; char buf[4];
}; } u;
for (;;) { for (;;) {
chr = 0; u.chr = 0;
#ifdef _WIN32 #ifdef _WIN32
std::streamsize read = stream->rdbuf()->_Sgetn_s(buf, 4, width); std::streamsize read = stream->rdbuf()->_Sgetn_s(u.buf, 4, width);
#else #else
std::streamsize read = stream->rdbuf()->sgetn(buf, width); std::streamsize read = stream->rdbuf()->sgetn(u.buf, width);
#endif #endif
if (read < (std::streamsize)width) { if (read < (std::streamsize)width) {
for (int i = 0; i < read; i++) { for (int i = 0; i < read; i++) {
str += buf[i]; str += u.buf[i];
} }
stream->setstate(std::ios::eofbit); stream->setstate(std::ios::eofbit);
return; return;
} }
if (chr == cr) continue; if (u.chr == cr) continue;
if (chr == lf) return; if (u.chr == lf) return;
for (int i = 0; i < read; i++) { for (int i = 0; i < read; i++) {
str += buf[i]; str += u.buf[i];
} }
} }
} }

View file

@ -69,8 +69,8 @@ namespace std {
/// @brief AssFile constructor /// @brief AssFile constructor
AssFile::AssFile () AssFile::AssFile ()
: loaded(false) : commitId(-1)
, commitId(-1) , loaded(false)
{ {
} }

View file

@ -124,8 +124,8 @@ void AssDialogueBlockOverride::ProcessParameters(AssDialogueBlockOverride::Proce
} }
AssOverrideParamProto::AssOverrideParamProto(VariableDataType type,int opt,ASS_ParameterClass classi) AssOverrideParamProto::AssOverrideParamProto(VariableDataType type,int opt,ASS_ParameterClass classi)
: type(type) : optional(opt)
, optional(opt) , type(type)
, classification(classi) , classification(classi)
{ {
} }

View file

@ -174,7 +174,8 @@ AssStyle::AssStyle()
} }
AssStyle::AssStyle(const AssStyle& s) AssStyle::AssStyle(const AssStyle& s)
: name(s.name) : AssEntry(s)
, name(s.name)
, font(s.font) , font(s.font)
, fontsize(s.fontsize) , fontsize(s.fontsize)
, primary(s.primary) , primary(s.primary)

View file

@ -391,7 +391,6 @@ void AlsaPlayer::async_write_handler(snd_async_handler_t *pcm_callback)
void *buf = malloc(player->period * player->bpf); void *buf = malloc(player->period * player->bpf);
while (frames >= player->period) { while (frames >= player->period) {
unsigned long start = player->cur_frame;
player->provider->GetAudioWithVolume(buf, player->cur_frame, player->period, player->volume); player->provider->GetAudioWithVolume(buf, player->cur_frame, player->period, player->volume);
int err = snd_pcm_writei(player->pcm_handle, buf, player->period); int err = snd_pcm_writei(player->pcm_handle, buf, player->period);
if(err == -EPIPE) { if(err == -EPIPE) {

View file

@ -67,7 +67,6 @@ void AssFixStylesFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog) {
wxArrayString styles = subs->GetStyles(); wxArrayString styles = subs->GetStyles();
std::for_each(styles.begin(), styles.end(), std::mem_fun_ref(&wxString::MakeLower)); std::for_each(styles.begin(), styles.end(), std::mem_fun_ref(&wxString::MakeLower));
styles.Sort(); styles.Sort();
size_t n = styles.Count();
for (entryIter cur=subs->Line.begin();cur!=subs->Line.end();cur++) { for (entryIter cur=subs->Line.begin();cur!=subs->Line.end();cur++) {
AssDialogue *diag = dynamic_cast<AssDialogue*>(*cur); AssDialogue *diag = dynamic_cast<AssDialogue*>(*cur);

View file

@ -252,8 +252,6 @@ int AssTransformFramerateFilter::ConvertTime(int time) {
int newEnd = Input->TimeAtFrame(frame + 1); int newEnd = Input->TimeAtFrame(frame + 1);
int newDur = newEnd - newStart; int newDur = newEnd - newStart;
int dongs = Input->FrameAtTime(newStart + newDur * dist, agi::vfr::END);
return newStart + newDur * dist; return newStart + newDur * dist;
} }

View file

@ -61,10 +61,10 @@
/// ///
SubtitlesPreview::SubtitlesPreview(wxWindow *parent,int id,wxPoint pos,wxSize size,int winStyle,wxColour col) SubtitlesPreview::SubtitlesPreview(wxWindow *parent,int id,wxPoint pos,wxSize size,int winStyle,wxColour col)
: wxWindow(parent,id,pos,size,winStyle) : wxWindow(parent,id,pos,size,winStyle)
, style(new AssStyle)
, backColour(col) , backColour(col)
, subFile(new AssFile) , subFile(new AssFile)
, line(new AssDialogue) , line(new AssDialogue)
, style(new AssStyle)
{ {
line->Text = "{\\q2}preview"; line->Text = "{\\q2}preview";

View file

@ -54,12 +54,13 @@
/// @param filename The filename to open /// @param filename The filename to open
YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(wxString fname) YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(wxString fname)
: sf(NULL) : sf(NULL)
, inited(false)
, w (0) , w (0)
, h (0) , h (0)
, num_frames(-1)
, cur_fn(-1) , cur_fn(-1)
, pixfmt(Y4M_PIXFMT_NONE) , pixfmt(Y4M_PIXFMT_NONE)
, imode(Y4M_ILACE_NOTSET) , imode(Y4M_ILACE_NOTSET)
, num_frames(-1)
{ {
fps_rat.num = -1; fps_rat.num = -1;
fps_rat.den = 1; fps_rat.den = 1;