Small fixes around that were causing warnings to be issued on gcc

Originally committed to SVN as r766.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-11 03:18:14 +00:00
parent 6636b56a52
commit 20f7e80ec2
10 changed files with 21 additions and 25 deletions

View file

@ -884,8 +884,8 @@ void AssDialogueBlockDrawing::MultiplyCoords(double x,double y) {
if (cur.IsNumber()) {
// Multiply it
cur.ToLong(&temp);
if (isX) temp = temp*x + 0.5;
else temp = temp*y + 0.5;
if (isX) temp = long int(temp*x + 0.5);
else temp = long int(temp*y + 0.5);
// Write back to list
final += wxString::Format(_T("%i "),temp);

View file

@ -153,7 +153,6 @@ void AssFile::Save(wxString _filename,bool setfilename,bool addToRecent,const wx
}
wxString extension = _filename.substr(i+1);
extension.Lower();
bool success = false;
// Get writer
SubtitleFormat *writer = SubtitleFormat::GetWriter(_filename);
@ -447,10 +446,8 @@ AssFile::AssFile (AssFile &from) {
filename = from.filename;
loaded = from.loaded;
Modified = from.Modified;
int version = 1;
// Copy lines
int lasttime = -1;
for (list<AssEntry*>::iterator cur=from.Line.begin();cur!=from.Line.end();cur++) {
Line.push_back((*cur)->Clone());
}
@ -465,7 +462,7 @@ void AssFile::InsertStyle (AssStyle *style) {
AssEntry *curEntry;
list<AssEntry*>::iterator lastStyle = Line.end();
list<AssEntry*>::iterator cur;
int lasttime;
int lasttime = -1;
wxString lastGroup;
// Look for insert position

View file

@ -672,6 +672,7 @@ end_tokenizing:
newparam->SetBlock(temp);
break;
}
default: break;
}
// Get next actual parameter

View file

@ -84,8 +84,8 @@ void AssTime::ParseASS (const wxString _text) {
if (!temp.ToDouble(&ts_raw)) throw 0;
// Split into seconds and fraction
ts = ts_raw;
tms = (ts_raw-ts)*1000+0.5;
ts = (long int)(ts_raw);
tms = (long int)((ts_raw-ts)*1000+0.5);
}
// Something went wrong, don't change anything

View file

@ -1020,7 +1020,7 @@ void SubtitlesGrid::JoinAsKaraoke(int n1,int n2) {
// Collect data
AssDialogue *cur;
int start,end;
int firststart;
int firststart = 0;
int lastend = -1;
int len1,len2;
for (int i=n1;i<=n2;i++) {
@ -1154,7 +1154,7 @@ void SubtitlesGrid::SplitLine(int n,int pos,int mode) {
// Modify time
if (mode == 1) {
double splitPos = double(pos)/orig.Length();
int splitTime = (n1->End.GetMS() - n1->Start.GetMS())*splitPos + n1->Start.GetMS();
int splitTime = (int)((n1->End.GetMS() - n1->Start.GetMS())*splitPos) + n1->Start.GetMS();
n1->End.SetMS(splitTime);
n2->Start.SetMS(splitTime);
}

View file

@ -119,8 +119,8 @@ void TXTSubtitleFormat::ReadFile(wxString filename,wxString encoding) { using na
// Read actor data
if (!isComment && separator != _T("")) {
if (value[0] != _T(' ') && value[0] != _T('\t')) {
size_t pos = value.Find(separator);
if (pos != -1) {
int pos = value.Find(separator);
if (pos != wxNOT_FOUND) {
actor = value.Left(pos);
actor.Trim(false);
actor.Trim(true);

View file

@ -107,7 +107,7 @@ wxArrayString MySpellThesaurus::GetLanguageList() {
// For each idxtionary match, see if it can find the corresponding .dat
for (unsigned int i=0;i<idx.Count();i++) {
wxString curdat = idx[i].Left(MAX(0,idx[i].Length()-4)) + _T(".dat");
wxString curdat = idx[i].Left(MAX(0,signed(idx[i].Length())-4)) + _T(".dat");
for (unsigned int j=0;j<dat.Count();j++) {
// Found match
if (curdat == dat[j]) {

View file

@ -69,6 +69,7 @@ void VariableData::DeleteValue () {
case VARDATA_BOOL: delete value_bool; break;
case VARDATA_COLOUR: delete value_colour; break;
case VARDATA_BLOCK: delete value_block; break;
default: break;
}
type = VARDATA_NONE;
value = NULL;

View file

@ -152,12 +152,12 @@ void FrameRate::Load(wxString filename) {
for (int i = 0; i <= lstart - lposition - 2; i++)
AddFrame(floor(currenttime+(i*1000) / AverageFrameRate));
AddFrame((int)(floor(currenttime+(i*1000) / AverageFrameRate)));
currenttime += ((lstart - lposition - 1)*1000) / AverageFrameRate;
for (int i = 0; i <= lend - lstart; i++)
AddFrame(floor(currenttime+(i*1000) / lfps));
AddFrame((int)(floor(currenttime+(i*1000) / lfps)));
currenttime += ((lend - lstart + 1)*1000) / lfps;
@ -275,8 +275,8 @@ int FrameRate::PFrameAtTime(int ms,bool useceil) {
// Get for constant frame rate
if (FrameRateType == CFR || Frame.size() == 0) {
double value = double(ms) * AverageFrameRate / 1000.0;
if (useceil) return ceil(value);
else return floor(value);
if (useceil) return (int)ceil(value);
else return (int)floor(value);
}
// Get for variable frame rate
@ -318,8 +318,8 @@ int FrameRate::PFrameAtTime(int ms,bool useceil) {
// After VFR range
else {
if (useceil) return last_frame + ceil((ms-last_time) * AverageFrameRate / 1000);
else return last_frame + floor((ms-last_time) * AverageFrameRate / 1000);
if (useceil) return (int)(last_frame + ceil((ms-last_time) * AverageFrameRate / 1000));
else return (int)(last_frame + floor((ms-last_time) * AverageFrameRate / 1000));
}
}
return -1;
@ -337,7 +337,7 @@ int FrameRate::PTimeAtFrame(int frame) {
// Constant frame rate
if (FrameRateType == CFR || Frame.size() == 0) {
return floor(double(frame) / AverageFrameRate * 1000.0);
return (int)floor(double(frame) / AverageFrameRate * 1000.0);
}
// Variable frame rate
@ -346,7 +346,7 @@ int FrameRate::PTimeAtFrame(int frame) {
if (frame < (signed) Frame.size()) return Frame.at(frame);
// Otherwise, calculate it
else return floor(Frame.back() + double(frame-Frame.size()+1) / AverageFrameRate * 1000.0);
else return (int)floor(Frame.back() + double(frame-Frame.size()+1) / AverageFrameRate * 1000.0);
}
// Unknown frame rate type
@ -429,7 +429,7 @@ double FrameRate::GetCommonFPS() {
curDist = Frame[i]-Frame[i-1];
// See if it's close enough to the last
if ((abs(curDist - lastDist) < 2 || i-1 == sectionStart) && i != Frame.size()-1) {
if ((abs(curDist - lastDist) < 2 || i-1 == (unsigned) sectionStart) && i != Frame.size()-1) {
lastDist = curDist;
continue;
}

View file

@ -34,9 +34,6 @@
//
#pragma once
//////////////
// Headers
#include <wx/wxprec.h>