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->StartTime->SetTime(curStartMS,true);
grid->editBox->EndTime->SetTime(curEndMS,true); grid->editBox->EndTime->SetTime(curEndMS,true);
grid->editBox->Duration->SetTime(curEndMS-curStartMS,true); grid->editBox->Duration->SetTime(curEndMS-curStartMS,true);
} }

View file

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

View file

@ -119,7 +119,7 @@ public:
// Read header // Read header
file.Seek(0); file.Seek(0);
RIFFChunk header; 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 // 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"); 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) { while (data_left) {
file.Seek(filepos); file.Seek(filepos);
ChunkHeader ch; ChunkHeader ch;
if (file.Read(&ch, sizeof(ch)) < sizeof(ch)) break; if (file.Read(&ch, sizeof(ch)) < (ssize_t) sizeof(ch)) break;
// Update counters // Update counters
data_left -= sizeof(ch); data_left -= sizeof(ch);
@ -152,7 +152,7 @@ public:
got_fmt_header = true; got_fmt_header = true;
fmtChunk fmt; 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"); 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? 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? FFT fft; // Use FFTW instead? A wavelet?
for (unsigned int overlap = 0; overlap < overlaps; ++overlap) { for (unsigned int overlap = 0; overlap < overlaps; ++overlap) {

View file

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

View file

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

View file

@ -34,9 +34,6 @@
// //
#pragma once
/////////// ///////////
// Headers // Headers
#include "subtitle_format_dvd.h" #include "subtitle_format_dvd.h"
@ -102,7 +99,9 @@ void DVDSubtitleFormat::GetSubPictureList(std::vector<SubPicture> &pics) {
// Write lines // Write lines
int i; int i;
#ifdef _OPENMP
#pragma omp parallel for shared(diags,pics,provider) private(i) #pragma omp parallel for shared(diags,pics,provider) private(i)
#endif
for (i=0;i<count;i++) { for (i=0;i<count;i++) {
// Dialogue // Dialogue
AssDialogue *current = diags[i]; AssDialogue *current = diags[i];
@ -111,7 +110,9 @@ void DVDSubtitleFormat::GetSubPictureList(std::vector<SubPicture> &pics) {
AegiVideoFrame dst; AegiVideoFrame dst;
dst.CopyFrom(srcFrame); dst.CopyFrom(srcFrame);
double time = (current->Start.GetMS()/1000.0 + current->End.GetMS()/1000.0)/2.0; double time = (current->Start.GetMS()/1000.0 + current->End.GetMS()/1000.0)/2.0;
#ifdef _OPENMP
#pragma omp critical #pragma omp critical
#endif
{ {
provider->DrawSubtitles(dst,time); provider->DrawSubtitles(dst,time);
} }
@ -132,7 +133,7 @@ void DVDSubtitleFormat::GetSubPictureList(std::vector<SubPicture> &pics) {
for (int y=h;--y>=0;) { for (int y=h;--y>=0;) {
bool hasData = false; bool hasData = false;
int lineStartX = 0; int lineStartX = 0;
int lineEndX; int lineEndX = 0;
// Scan line // Scan line
for (int x=w;--x>=0;) { 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 // String to integer
// wxString::ToLong() is slow and not as flexible // 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 // Initialize to zero and get length if end set to -1
int sign = 1; int sign = 1;
int value = 0; int value = 0;
if (end == -1) end = str.Length(); 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 // Get value and check if it's a number
int val = (int)(str[pos]); int val = (int)(str[pos]);
if (val == _T(' ') || val == _T('\t')) continue; 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 // 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 // Parts of the number
int sign = 1; int sign = 1;
int major = 0; int major = 0;
@ -319,7 +319,7 @@ int StringToFix(const wxString &str,size_t decimalPlaces,size_t start,size_t end
int *dst = &major; int *dst = &major;
size_t mCount = 0; 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 // Get value and check if it's a number
int val = (int)(str[pos]); int val = (int)(str[pos]);
if (val == _T(' ') || val == _T('\t')) continue; 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); wxMenuItem *AppendBitmapMenuItem (wxMenu* parentMenu,int id,wxString text,wxString help,wxBitmap bmp,int pos=-1);
int SmallestPowerOf2(int x); int SmallestPowerOf2(int x);
void GetWordBoundaries(const wxString text,IntPairVector &results,int start=0,int end=-1); 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 StringToInt(const wxString &str,int start=0,int end=-1);
int StringToFix(const wxString &str,size_t decimalPlaces,size_t start=0,size_t end=-1); int StringToFix(const wxString &str,size_t decimalPlaces,int start=0,int end=-1);
wxIcon BitmapToIcon(wxBitmap bmp); wxIcon BitmapToIcon(wxBitmap bmp);

View file

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

View file

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

View file

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