Fixed several warnings on g++.

Originally committed to SVN as r2044.
This commit is contained in:
Rodrigo Braz Monteiro 2008-03-13 18:55:09 +00:00
parent 6e5f23c1cd
commit c248ca39f2
12 changed files with 32 additions and 37 deletions

View File

@ -2362,4 +2362,4 @@ void AudioDisplay::UpdateTimeEditCtrls() {
grid->editBox->StartTime->SetTime(curStartMS,true);
grid->editBox->EndTime->SetTime(curEndMS,true);
grid->editBox->Duration->SetTime(curEndMS-curStartMS,true);
}
}

View File

@ -34,9 +34,6 @@
//
#pragma once
///////////
// Headers
#include "audio_provider_convert.h"

View File

@ -119,7 +119,7 @@ public:
// Read header
file.Seek(0);
RIFFChunk header;
if (file.Read(&header, sizeof(header)) < sizeof(header)) throw _T("RIFF PCM WAV audio provider: file is too small to contain a RIFF header");
if (file.Read(&header, sizeof(header)) < (ssize_t) sizeof(header)) throw _T("RIFF PCM WAV audio provider: file is too small to contain a RIFF header");
// Check that it's good
if (strncmp(header.ch.type, "RIFF", 4)) throw _T("RIFF PCM WAV audio provider: File is not a RIFF file");
@ -141,7 +141,7 @@ public:
while (data_left) {
file.Seek(filepos);
ChunkHeader ch;
if (file.Read(&ch, sizeof(ch)) < sizeof(ch)) break;
if (file.Read(&ch, sizeof(ch)) < (ssize_t) sizeof(ch)) break;
// Update counters
data_left -= sizeof(ch);
@ -152,7 +152,7 @@ public:
got_fmt_header = true;
fmtChunk fmt;
if (file.Read(&fmt, sizeof(fmt)) < sizeof(fmt)) throw _T("RIFF PCM WAV audio provider: File ended before end of 'fmt ' chunk");
if (file.Read(&fmt, sizeof(fmt)) < (ssize_t) sizeof(fmt)) throw _T("RIFF PCM WAV audio provider: File ended before end of 'fmt ' chunk");
if (fmt.compression != 1) throw _T("RIFF PCM WAV audio provider: Can't use file, not PCM encoding");

View File

@ -157,13 +157,6 @@ public:
unsigned int overlap_offset = line_length / overlaps * 2; // FIXME: the result seems weird/wrong without this factor 2, but why?
// Raw sample data
short *raw_sample_data = NULL;
float *sample_data = NULL;
// Real and imaginary components of the output
float *out_r = NULL;
float *out_i = NULL;
FFT fft; // Use FFTW instead? A wavelet?
for (unsigned int overlap = 0; overlap < overlaps; ++overlap) {

View File

@ -38,7 +38,9 @@
#ifndef _AUTO4_RUBY_H
#define _AUTO4_RUBY_H
#ifdef _MSC_VER
#pragma warning(disable: 4311 4312)
#endif
#include "auto4_base.h"
#include <wx/thread.h>

View File

@ -238,7 +238,7 @@ void DialogDummyVideo::OnLengthChange(wxCommandEvent &evt)
void DialogDummyVideo::UpdateLengthDisplay()
{
double fpsval;
int lengthval;
int lengthval = 0;
if (!length_display) return;
if ((fps->GetValue().ToDouble(&fpsval)) && (lengthval = length->GetValue()) && fpsval > 0 && lengthval > 0) {
int tt = int(lengthval / fpsval * 1000); // frames / (frames/seconds) * 1000 = milliseconds

View File

@ -34,9 +34,6 @@
//
#pragma once
///////////
// Headers
#include "subtitle_format_dvd.h"
@ -102,7 +99,9 @@ void DVDSubtitleFormat::GetSubPictureList(std::vector<SubPicture> &pics) {
// Write lines
int i;
#ifdef _OPENMP
#pragma omp parallel for shared(diags,pics,provider) private(i)
#endif
for (i=0;i<count;i++) {
// Dialogue
AssDialogue *current = diags[i];
@ -111,7 +110,9 @@ void DVDSubtitleFormat::GetSubPictureList(std::vector<SubPicture> &pics) {
AegiVideoFrame dst;
dst.CopyFrom(srcFrame);
double time = (current->Start.GetMS()/1000.0 + current->End.GetMS()/1000.0)/2.0;
#ifdef _OPENMP
#pragma omp critical
#endif
{
provider->DrawSubtitles(dst,time);
}
@ -132,7 +133,7 @@ void DVDSubtitleFormat::GetSubPictureList(std::vector<SubPicture> &pics) {
for (int y=h;--y>=0;) {
bool hasData = false;
int lineStartX = 0;
int lineEndX;
int lineEndX = 0;
// Scan line
for (int x=w;--x>=0;) {

View File

@ -285,13 +285,13 @@ void GetWordBoundaries(const wxString text,IntPairVector &results,int start,int
/////////////////////
// String to integer
// wxString::ToLong() is slow and not as flexible
int StringToInt(const wxString &str,size_t start,size_t end) {
int StringToInt(const wxString &str,int start,int end) {
// Initialize to zero and get length if end set to -1
int sign = 1;
int value = 0;
if (end == -1) end = str.Length();
for (size_t pos=start;pos<end;pos++) {
for (int pos=start;pos<end;pos++) {
// Get value and check if it's a number
int val = (int)(str[pos]);
if (val == _T(' ') || val == _T('\t')) continue;
@ -309,7 +309,7 @@ int StringToInt(const wxString &str,size_t start,size_t end) {
/////////////////////////
// String to fixed point
int StringToFix(const wxString &str,size_t decimalPlaces,size_t start,size_t end) {
int StringToFix(const wxString &str,size_t decimalPlaces,int start,int end) {
// Parts of the number
int sign = 1;
int major = 0;
@ -319,7 +319,7 @@ int StringToFix(const wxString &str,size_t decimalPlaces,size_t start,size_t end
int *dst = &major;
size_t mCount = 0;
for (size_t pos=start;pos<end;pos++) {
for (int pos=start;pos<end;pos++) {
// Get value and check if it's a number
int val = (int)(str[pos]);
if (val == _T(' ') || val == _T('\t')) continue;

View File

@ -68,8 +68,8 @@ wxString PrettySize(int bytes);
wxMenuItem *AppendBitmapMenuItem (wxMenu* parentMenu,int id,wxString text,wxString help,wxBitmap bmp,int pos=-1);
int SmallestPowerOf2(int x);
void GetWordBoundaries(const wxString text,IntPairVector &results,int start=0,int end=-1);
int StringToInt(const wxString &str,size_t start=0,size_t end=-1);
int StringToFix(const wxString &str,size_t decimalPlaces,size_t start=0,size_t end=-1);
int StringToInt(const wxString &str,int start=0,int end=-1);
int StringToFix(const wxString &str,size_t decimalPlaces,int start=0,int end=-1);
wxIcon BitmapToIcon(wxBitmap bmp);

View File

@ -64,7 +64,9 @@ NumValidator::NumValidator(wxString* _valPtr,bool isfloat,bool issigned) {
////////////////////
// Copy constructor
NumValidator::NumValidator(const NumValidator &from) {
NumValidator::NumValidator(const NumValidator &from)
: wxValidator()
{
valPtr = from.valPtr;
isFloat = from.isFloat;
isSigned = from.isSigned;

View File

@ -308,7 +308,7 @@ void VideoContext::SetVideo(const wxString &filename) {
bool isAllKeyFrames = true;
for (unsigned int i=1; i<KeyFrames.GetCount(); i++) {
// Is the last keyframe not this keyframe -1?
if (KeyFrames[i-1] != (i-1)) {
if (KeyFrames[i-1] != (int)(i-1)) {
// It's not all keyframes, go ahead
isAllKeyFrames = false;
break;

View File

@ -208,8 +208,8 @@ void VisualToolVectorClip::PopulateFeatureList() {
// First point
if (isFirst) {
isFirst = false;
feat.x = cur->p1.x;
feat.y = cur->p1.y;
feat.x = (int)cur->p1.x;
feat.y = (int)cur->p1.y;
feat.type = DRAG_SMALL_CIRCLE;
feat.value = i;
feat.value2 = 0;
@ -218,8 +218,8 @@ void VisualToolVectorClip::PopulateFeatureList() {
// Line
if (cur->type == CURVE_LINE) {
feat.x = cur->p2.x;
feat.y = cur->p2.y;
feat.x = (int)cur->p2.x;
feat.y = (int)cur->p2.y;
feat.type = DRAG_SMALL_CIRCLE;
feat.value = i;
feat.value2 = 1;
@ -232,22 +232,22 @@ void VisualToolVectorClip::PopulateFeatureList() {
int size = features.size();
// Control points
feat.x = cur->p2.x;
feat.y = cur->p2.y;
feat.x = (int)cur->p2.x;
feat.y = (int)cur->p2.y;
feat.value = i;
feat.value2 = 1;
feat.brother[0] = size-1;
feat.type = DRAG_SMALL_SQUARE;
features.push_back(feat);
feat.x = cur->p3.x;
feat.y = cur->p3.y;
feat.x = (int)cur->p3.x;
feat.y = (int)cur->p3.y;
feat.value2 = 2;
feat.brother[0] = size+2;
features.push_back(feat);
// End point
feat.x = cur->p4.x;
feat.y = cur->p4.y;
feat.x = (int)cur->p4.x;
feat.y = (int)cur->p4.y;
feat.type = DRAG_SMALL_CIRCLE;
feat.value2 = 3;
features.push_back(feat);