Commit fcf87ad8 authored by hkrishna's avatar hkrishna

warning fixes for tools directory

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23642 18c085ea-50e0-402c-830e-de6fd14e8384
parent fc0c7875
......@@ -513,7 +513,7 @@ ClipEditor::keyPressEvent(QKeyEvent *kev)
else
{
datasets[caseindex]->selectedShape++;
if (datasets[caseindex]->selectedShape >= datasets[caseindex]->shapes.size())
if (datasets[caseindex]->selectedShape >= (int)datasets[caseindex]->shapes.size())
datasets[caseindex]->selectedShape = 0;
cerr << "Selected subshape: ";
if (datasets[caseindex]->selectedShape==0)
......@@ -531,7 +531,7 @@ ClipEditor::keyPressEvent(QKeyEvent *kev)
else
{
if (datasets[caseindex]->selectedShape > 0 &&
datasets[caseindex]->selectedShape < datasets[caseindex]->shapes.size())
datasets[caseindex]->selectedShape < (int)datasets[caseindex]->shapes.size())
{
if (datasets[caseindex]->shapes[datasets[caseindex]->selectedShape].shapeType == ST_POINT)
{
......@@ -572,7 +572,7 @@ ClipEditor::keyPressEvent(QKeyEvent *kev)
else
{
if (datasets[caseindex]->selectedShape > 0 &&
datasets[caseindex]->selectedShape < datasets[caseindex]->shapes.size())
datasets[caseindex]->selectedShape < (int)datasets[caseindex]->shapes.size())
{
datasets[caseindex]->shapes[datasets[caseindex]->selectedShape].Invert();
}
......@@ -601,11 +601,11 @@ ClipEditor::keyPressEvent(QKeyEvent *kev)
else
{
if (datasets[caseindex]->selectedShape > 0 &&
datasets[caseindex]->selectedShape < datasets[caseindex]->shapes.size())
datasets[caseindex]->selectedShape < (int)datasets[caseindex]->shapes.size())
{
cerr << "Deleting shape\n";
std::vector<Shape> &shapes = datasets[caseindex]->shapes;
for (int i=datasets[caseindex]->selectedShape; i<shapes.size(); i++)
for (size_t i=datasets[caseindex]->selectedShape; i<shapes.size(); i++)
{
shapes[i] = shapes[i+1];
}
......@@ -777,7 +777,7 @@ void
ClipEditor::LoadFromFile()
{
char fname[200];
const char *lower, *upper;
const char *lower = NULL, *upper = NULL; ///TODO: check sometimes uninitialized warning
switch (shapetype)
{
case ST_HEX: lower="Hex"; upper="HEX"; break;
......@@ -796,6 +796,7 @@ ClipEditor::LoadFromFile()
case ST_POLY8: lower="Poly8"; upper="POLY8"; break;
default: cerr << "Error\n"; break;
}
(void) upper;
sprintf(fname, "ClipCases%s.C", lower);
ifstream in(fname, ios::in);
......@@ -886,7 +887,7 @@ ClipEditor::LoadFromFile()
in >> buff;
in.getline(buff,200);
for (int j=1; j<d->shapes.size(); j++)
for (size_t j=1; j<d->shapes.size(); j++)
{
ShapeType st;
int nv;
......@@ -1016,7 +1017,7 @@ ClipEditor::SaveToFile()
}
char fname[200];
const char *lower, *upper;
const char *lower = NULL, *upper = NULL; ///TODO: check on fix for uninitialized pointer
switch (shapetype)
{
case ST_HEX: lower="Hex"; upper="HEX"; break;
......@@ -1035,6 +1036,7 @@ ClipEditor::SaveToFile()
case ST_POLY8: lower="Poly8"; upper="POLY8"; break;
default: cerr << "Error\n"; break;
}
(void) upper;
sprintf(fname, "ClipCases%s.C", lower);
ifstream in(fname, ios::in);
......@@ -1056,7 +1058,7 @@ ClipEditor::SaveToFile()
{
char cmd[256];
sprintf(cmd, "cp %s %s", fname, bakname);
system(cmd);
int result = system(cmd); (void) result;
cerr << "backed up "<<fname<<" to " << bakname << endl;
backedup = true;
}
......@@ -1116,7 +1118,7 @@ ClipEditor::SaveToFile()
for (int c2=0; c2<c; c2++)
{
DataSet *d = datasets[c2];
for (int i=1; i<d->shapes.size(); i++)
for (size_t i=1; i<d->shapes.size(); i++)
{
Shape *s = &(d->shapes[i]);
index += 2 + s->nverts;
......@@ -1159,7 +1161,7 @@ ClipEditor::SaveToFile()
}
int ptcounter = 0;
for (int i=1; i<d->shapes.size(); i++)
for (size_t i=1; i<d->shapes.size(); i++)
{
Shape *s = &(d->shapes[i]);
if (s->shapeType == ST_POINT)
......@@ -1187,7 +1189,7 @@ ClipEditor::SaveToFile()
for (int pass = 0; pass <= 1 ; pass++)
{
for (int i=1; i<d->shapes.size(); i++)
for (size_t i=1; i<d->shapes.size(); i++)
{
Shape *s = &(d->shapes[i]);
if (s->color != pass)
......
......@@ -70,7 +70,7 @@ DataSet::DataSet(ShapeType st, int sc)
void
DataSet::DrawPolyData(Vector &up, Vector &right)
{
if (selectedShape > shapes.size())
if (selectedShape > (int)shapes.size())
selectedShape = 0;
if (selectedShape > 0)
......@@ -80,7 +80,7 @@ DataSet::DrawPolyData(Vector &up, Vector &right)
}
else
{
for (int i=0; i<shapes.size(); i++)
for (size_t i=0; i<shapes.size(); i++)
{
shapes[i].DrawPolyData(up, right);
}
......@@ -93,7 +93,7 @@ DataSet::ReInit()
if (copyOfDataset)
{
shapes.resize(copyOfDataset->shapes.size());
for (int i=1; i<copyOfDataset->shapes.size(); i++)
for (size_t i=1; i<copyOfDataset->shapes.size(); i++)
{
shapes[i] = Shape(&copyOfDataset->shapes[i],
transformNumber,
......@@ -102,7 +102,7 @@ DataSet::ReInit()
}
}
for (int i=1; i<shapes.size(); i++)
for (size_t i=1; i<shapes.size(); i++)
{
shapes[i].parentShape = &shapes[0];
shapes[i].Init();
......
......@@ -1276,11 +1276,11 @@ DrawCharacters(int nstr, char *str[],
// Each character is made up of multiple triangles. Add the
// triangles to the output one at a time.
//
int ntri = nice_triangle_ntriangles[ch];
int ntri = nice_triangle_ntriangles[(int)ch];
unsigned char *xptr =
&nice_triangle_x_index[(int)nice_triangle_start[ch]];
&nice_triangle_x_index[(int)nice_triangle_start[(int)ch]];
unsigned char *yptr =
&nice_triangle_y_index[(int)nice_triangle_start[ch]];
&nice_triangle_y_index[(int)nice_triangle_start[(int)ch]];
for (int j = 0 ; j < ntri ; j++)
{
Vector pt0 = ((nice_font_x[xptr[3*j+0]] + char_base_x) *right +
......@@ -1298,7 +1298,7 @@ DrawCharacters(int nstr, char *str[],
glVertex3f(pt2.x, pt2.y, pt2.z);
}
double scale_factor = 1.1;
char_base_x += (scale_factor * nice_triangle_spacing[ch]);
char_base_x += (scale_factor * nice_triangle_spacing[(int)ch]);
}
}
}
......
......@@ -416,7 +416,7 @@ ludcmp(Matrix *a, int *indx, float *d)
{
float vv[4]; /* implicit scale for each row */
float big, dum, sum, tmp;
int i, imax, j, k;
int i, imax = 0, j, k; /// TODO: check on fix for uninitialized imax var
*d = 1.0f;
for (i=0; i<4; i++) {
......
......@@ -565,7 +565,7 @@ Shape::Init()
zc[i] = .5;
int index = (n - 'p') + 1;
int found = 0;
for (int s=0; s<dataset->shapes.size() && found<index; s++)
for (size_t s=0; s<dataset->shapes.size() && found<index; s++)
{
if (dataset->shapes[s].shapeType == ST_POINT)
{
......@@ -785,7 +785,7 @@ Shape::DrawPolyData(Vector &up, Vector &right)
char ci2 = parentNodes[tris[i][2]];
bool duplicate = false;
for (int s=1; s<dataset->shapes.size() && !duplicate; s++)
for (size_t s=1; s<dataset->shapes.size() && !duplicate; s++)
{
if (&dataset->shapes[s] == this)
continue;
......@@ -845,7 +845,7 @@ Shape::DrawPolyData(Vector &up, Vector &right)
char ci3 = parentNodes[quads[i][3]];
bool duplicate = false;
for (int s=1; s<dataset->shapes.size() && !duplicate; s++)
for (size_t s=1; s<dataset->shapes.size() && !duplicate; s++)
{
if (&dataset->shapes[s] == this)
continue;
......
......@@ -141,7 +141,7 @@ FillOptionsFromCommandline(DBOptionsAttributes *opts)
cerr << endl;
stringVector enumValues = opts->GetEnumStrings(name);
if (PAR_Rank() == 0)
for (int k=0; k<enumValues.size(); k++)
for (size_t k=0; k<enumValues.size(); k++)
cerr << " ("<<k<<" = "<<enumValues[k]<<")\n";
if (PAR_Rank() == 0)
cerr << " (integer, default="<<opts->GetEnum(name)<<"):\n";
......@@ -429,7 +429,7 @@ int main(int argc, char *argv[])
int target_chunks = -1;
bool outputZonal = false;
long long target_zones = -1;
EngineDatabasePluginInfo *edpir = NULL;
//EngineDatabasePluginInfo *edpir = NULL;
if (argc > 4)
{
for (int i = 4 ; i < argc ; i++)
......@@ -524,7 +524,7 @@ int main(int argc, char *argv[])
{
if (PAR_Rank() == 0)
cerr << "Could not open file " << argv[1] << ". Tried using plugins ";
for (int i = 0 ; i < pluginList.size() ; i++)
for (size_t i = 0 ; i < pluginList.size() ; i++)
{
if (PAR_Rank() == 0)
{
......@@ -606,7 +606,7 @@ int main(int argc, char *argv[])
// Assume MetaData for timestep 0 is sufficient for what we need here
//
const avtDatabaseMetaData *md = db->GetMetaData(0);
const avtMeshMetaData *mmd = NULL;
//const avtMeshMetaData *mmd = NULL;
string meshname = "";
if (md->GetNumMeshes() >= 1)
{
......
......@@ -133,14 +133,14 @@ ImageObject::Write(const char *filename)
// Check the extension.
bool retval = true;
int len = (int) strlen(filename);
int writeType = 0;
if(len > 4)
{
const char *ext = filename + len - 4;
if(strcmp(ext, ".ppm") == 0)
writeType = 1;
}
//int len = (int) strlen(filename);
//int writeType = 0;
//if(len > 4)
//{
//const char *ext = filename + len - 4;
//if(strcmp(ext, ".ppm") == 0)
// writeType = 1;
//}
FILE *ppm = fopen(filename, "wb");
retval = (ppm != NULL);
......@@ -181,22 +181,23 @@ ImageObject::Read(const char *filename)
{
FILE *ppm = fopen(filename, "rb");
bool retval = (ppm != NULL);
char* result = NULL; (void) result;
if(ppm)
{
char line[1000];
// Figure out the header and write it to the file.
fgets(line, 1000, ppm);
fgets(line, 1000, ppm);
result = fgets(line, 1000, ppm);
result = fgets(line, 1000, ppm);
if(line[0] == '#')
fgets(line, 1000, ppm);
result = fgets(line, 1000, ppm);
sscanf(line, "%d %d\n", &w, &h);
fgets(line, 1000, ppm);
result = fgets(line, 1000, ppm);
if(pixels != 0)
delete [] pixels;
depth = 3;
pixels = new unsigned char[w * h * 3];
fread(pixels, 3 * w * h, 1, ppm);
size_t res = fread(pixels, 3 * w * h, 1, ppm); (void) res;
fclose(ppm);
}
return retval;
......
......@@ -68,7 +68,7 @@ struct ViewportInfo
coordinates[2] = coordinates[3] = 1.f;
opacity = 1.;
opaqueMode = M_OPAQUE;
transparentColor[0] = transparentColor[0] = transparentColor[0] = 255;
transparentColor[0] = transparentColor[1] = transparentColor[2] = 255;
hasDropShadow = false;
file = 0;
}
......@@ -80,17 +80,18 @@ struct ViewportInfo
void ReadParameters(FILE *f)
{
fscanf(f, "%s\n", imageName);
fscanf(f, "%g %g %g %g\n", &coordinates[0], &coordinates[1],
int result = 0; (void) result;
result = fscanf(f, "%s\n", imageName);
result = fscanf(f, "%g %g %g %g\n", &coordinates[0], &coordinates[1],
&coordinates[2], &coordinates[3]);
fscanf(f, "%d\n", &opaqueMode);
fscanf(f, "%g\n", &opacity);
result = fscanf(f, "%d\n", &opaqueMode);
result = fscanf(f, "%g\n", &opacity);
int tmp[3];
fscanf(f, "%d %d %d\n", &tmp[0], &tmp[1], &tmp[2]);
result = fscanf(f, "%d %d %d\n", &tmp[0], &tmp[1], &tmp[2]);
transparentColor[0] = (unsigned char)tmp[0];
transparentColor[1] = (unsigned char)tmp[1];
transparentColor[2] = (unsigned char)tmp[2];
fscanf(f, "%d\n", &tmp[0]);
result = fscanf(f, "%d\n", &tmp[0]);
hasDropShadow = tmp[0] > 0;
}
......@@ -143,19 +144,20 @@ struct CompositeParameters
{
bool retval = false;
FILE *f = fopen(filename, "rt");
int result = 0; (void) result;
if(f != 0)
{
fscanf(f, "%d\n", &nViewports);
fscanf(f, "%d %d\n", &outputSize[0], &outputSize[1]);
result = fscanf(f, "%d\n", &nViewports);
result = fscanf(f, "%d %d\n", &outputSize[0], &outputSize[1]);
int tmp[3];
fscanf(f, "%d %d %d\n", &tmp[0], &tmp[1], &tmp[2]);
result = fscanf(f, "%d %d %d\n", &tmp[0], &tmp[1], &tmp[2]);
outputBackground[0] = (unsigned char)tmp[0];
outputBackground[1] = (unsigned char)tmp[1];
outputBackground[2] = (unsigned char)tmp[2];
fscanf(f, "%s\n", outputFile);
fscanf(f, "%s\n", backgroundFile);
fscanf(f, "%g %g\n", &shadowOffsetX, &shadowOffsetY);
fscanf(f, "%g\n", &shadowBlurRadius);
result = fscanf(f, "%s\n", outputFile);
result = fscanf(f, "%s\n", backgroundFile);
result = fscanf(f, "%g %g\n", &shadowOffsetX, &shadowOffsetY);
result = fscanf(f, "%g\n", &shadowBlurRadius);
viewports = new ViewportInfo*[nViewports];
for(int i = 0; i < nViewports; ++i)
......@@ -218,7 +220,7 @@ CreateDropShadowMask(const ViewportInfo *vpInfo, int offx, int offy, int r)
// Create the blur image
float *blur = new float[rx2 * rx2];
float root2 = sqrt(2.);
//float root2 = sqrt(2.);
float blurSum = 0.;
for (int i=0; i<rx2; i++)
{
......
......@@ -850,8 +850,8 @@ Transition_Ripple(const TransitionOptions &options, ImageObject *image1, ImageOb
float hW = float(image1->Width()) / 2.f + 1.;
float hH = float(image1->Height()) / 2.f + 1.;
float imageRad = sqrt(hW * hW + hH * hH);
float currentRad = t * imageRad;
unsigned char black[3] = {0,0,0};
//float currentRad = t * imageRad;
//unsigned char black[3] = {0,0,0};
for(int y = 0; y < image1->Height(); ++y)
{
......
......@@ -148,7 +148,7 @@ MultiCurveProcessor::ProcessBatchFile(const char *fileName, const char *dataFile
cerr << "Saving images with the base file name " << saveFile << endl;
cerr << "Data file: " << openFile << endl;
cerr << "Creating plots of variables:" << endl;
for (int i = 0; i < plotVars.size(); i++)
for (size_t i = 0; i < plotVars.size(); i++)
cerr << " " << plotVars[i] << endl;
//
......@@ -157,7 +157,7 @@ MultiCurveProcessor::ProcessBatchFile(const char *fileName, const char *dataFile
if (openFile != "")
{
commandList.push_back(COMMAND_OPEN_DATABASE);
for (int i = 0; i < plotVars.size(); i++)
for (size_t i = 0; i < plotVars.size(); i++)
{
commandList.push_back(COMMAND_CREATE_PLOT);
commandList.push_back(COMMAND_FINISH_PLOT);
......@@ -695,7 +695,7 @@ MultiCurveProcessor::execCommand()
//
// Execute the next command, if there is one.
//
if (iCommand >= commandList.size())
if (iCommand >= (int)commandList.size())
{
disconnect(sync, SIGNAL(synchronized()),
this, SLOT(execCommand()));
......
......@@ -115,7 +115,7 @@ QvisColorButton::QvisColorButton(QWidget *parent, const void *data) :
QvisColorButton::~QvisColorButton()
{
// Remove the "this" pointer from the vector.
int index;
int index = -1;
bool notFound = true;
for(size_t i = 0; i < buttons.size() && notFound; ++i)
{
......@@ -464,7 +464,7 @@ QvisColorButton::popupPressed()
// Show the popup menu.
popup->move(menuX, menuY);
popup->show();
setDown(false);
setDown(FALSE);
}
}
......
......@@ -340,7 +340,7 @@ void
QvisColorManagerWidget::setEntry(int index, const QString &name,
const QColor &color, int opacity)
{
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
ColorEntry *entry = colorEntries[index];
QString tempName(" ");
......@@ -384,7 +384,7 @@ QvisColorManagerWidget::setEntry(int index, const QString &name,
void
QvisColorManagerWidget::setAttributeName(int index, const QString &name)
{
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
QString tempName(" ");
tempName += name;
......@@ -414,7 +414,7 @@ QvisColorManagerWidget::setAttributeName(int index, const QString &name)
void
QvisColorManagerWidget::setColor(int index, const QColor &color)
{
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
colorEntries[index]->colorBox->setButtonColor(color);
colorEntries[index]->opacitySlider->setGradientColor(color);
......@@ -441,7 +441,7 @@ QvisColorManagerWidget::setColor(int index, const QColor &color)
void
QvisColorManagerWidget::setOpacity(int index, int opacity)
{
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
colorEntries[index]->opacitySlider->setValue(opacity);
}
......@@ -553,7 +553,7 @@ QvisColorManagerWidget::name(int index) const
{
QString retval;
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
retval = colorEntries[index]->nameLabel->text();
}
......@@ -582,7 +582,7 @@ QvisColorManagerWidget::color(int index) const
{
QColor retval(0,0,0);
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
retval = colorEntries[index]->colorBox->buttonColor();
}
......@@ -611,7 +611,7 @@ QvisColorManagerWidget::opacity(const int index) const
{
int retval = 255;
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
{
retval = colorEntries[index]->opacitySlider->value();
}
......@@ -646,7 +646,7 @@ QvisColorManagerWidget::selectedColor(const QColor &color,
int index = (int)((long)userData);
// Change the gradient color of the opacity slider.
if(index >= 0 && index < colorEntries.size())
if(index >= 0 && index < (int)colorEntries.size())
colorEntries[index]->opacitySlider->setGradientColor(color);
// emit the colorChanged signal.
......
......@@ -454,7 +454,7 @@ void
QvisOpacitySlider::drawSliderGroove(QPainter *p, int x, int y, int w, int,
int c)
{
qDrawWinPanel(p, x, y + c - 2, w, 4, palette(), true);
qDrawWinPanel(p, x, y + c - 2, w, 4, palette(), TRUE);
p->setPen(palette().color(QPalette::Shadow));
p->drawLine(x+1, y + c - 1, x + w - 3, y + c - 1);
}
......
......@@ -78,12 +78,13 @@ MCVMain(int argc, char *argv[])
char **argv2 = new char*[5];
argv2[0] = argv[0];
int argc2 = 1;
char nowin_str[] = "-nowin";
for (int i = 0; i < argc; i++)
{
if (strcmp(argv[i], "-G") == 0)
{
nowin = true;
argv2[argc2++] = "-nowin";
argv2[argc2++] = nowin_str;
}
else if (strcmp(argv[i], "-f") == 0)
{
......
......@@ -144,7 +144,7 @@ int i,j,sxf,syf,sxb,syb;
struct mbinfo *mbi;
{
int imin,jmin,iminf,jminf,iminr,jminr;
int imint,jmint,iminb,jminb;
int imint = -1,jmint,iminb,jminb;
int imintf,jmintf,iminbf,jminbf;
int imintr,jmintr,iminbr,jminbr;
int var,v0;
......@@ -152,8 +152,8 @@ struct mbinfo *mbi;
int dmcfield,dmcfieldf,dmcfieldr,dmcfieldi;
int tsel,bsel,tself,bself,tselr,bselr;
unsigned char *mb;
int imins[2][2],jmins[2][2];
int imindp,jmindp,imindmv,jmindmv,dmc_dp,vmc_dp;
int imins[2][2] = {{-1,-1},{-1,-1}},jmins[2][2] = {{-1, -1}, {-1, -1}};
int imindp = -1,jmindp = -1 ,imindmv = -1,jmindmv = -1,dmc_dp,vmc_dp;
mb = cur + i + width*j;
......@@ -490,11 +490,11 @@ int secondfield,ipflag;
{
int w2;
unsigned char *mb, *toporg, *topref, *botorg, *botref;
int var,vmc,v0,dmc,dmcfieldi,dmc8i;
int var,vmc,v0,/*dmc = -1 ,*/dmcfieldi,dmc8i;
int imin,jmin,imin8u,jmin8u,imin8l,jmin8l,dmcfield,dmc8,sel,sel8u,sel8l;
int iminf,jminf,imin8uf,jmin8uf,imin8lf,jmin8lf,dmcfieldf,dmc8f,self,sel8uf,sel8lf;
int iminr,jminr,imin8ur,jmin8ur,imin8lr,jmin8lr,dmcfieldr,dmc8r,selr,sel8ur,sel8lr;
int imins,jmins,ds,imindmv,jmindmv,vmc_dp,dmc_dp;
int imins,jmins,ds,imindmv = -1,jmindmv = -1,vmc_dp,dmc_dp; /* TODO: check on unitialized variables */
w2 = width<<1;
......@@ -543,7 +543,7 @@ int secondfield,ipflag;
{
/* Dual Prime prediction */
mbi->motion_type = MC_DMV;
dmc = dmc_dp; /* L1 metric */
//dmc = dmc_dp; /* L1 metric */
vmc = vmc_dp; /* we already calculated L2 error for Dual */
}
......@@ -984,7 +984,7 @@ int *dmcp,*vmcp;
{
int pref,ppred,delta_x,delta_y;
int is,js,it,jt,ib,jb,it0,jt0,ib0,jb0;
int imins,jmins,imint,jmint,iminb,jminb,imindmv,jmindmv;
int imins = -1,jmins = -1,imint = -1,jmint = -1,iminb = -1,jminb = -1,imindmv = -1,jmindmv = -1 ; /* TODO: check on fix for unintialized variables */
int vmc,local_dist;
/* Calculate Dual Prime distortions for 9 delta candidates
......@@ -1144,7 +1144,7 @@ int *dmcp,*vmcp;
{
unsigned char *sameref, *oppref;
int io0,jo0,io,jo,delta_x,delta_y,mvxs,mvys,mvxo0,mvyo0;
int imino,jmino,imindmv,jmindmv,vmc_dp,local_dist;
int imino = -1,jmino = -1 ,imindmv,jmindmv,vmc_dp,local_dist; /* TODO: uninitialized warning errors fixed with -1 (needs check) */
/* Calculate Dual Prime distortions for 9 delta candidates */
/* Note: only for P pictures! */
......
......@@ -168,12 +168,13 @@ char *fname;
int h,m,s,f;
FILE *fd;
char line[256];
char *commentBegin = NULL;
int len = 0;
//char *commentBegin = NULL;
//int len = 0;
static double ratetab[8]=
{24000.0/1001.0,24.0,25.0,30000.0/1001.0,30.0,50.0,60000.0/1001.0,60.0};
extern int r,Xi,Xb,Xp,d0i,d0p,d0b; /* rate control */
extern double avg_act; /* rate control */
char* result = NULL; (void) result;
if (!(fd = fopen(fname,"r")))
{
......@@ -181,11 +182,11 @@ char *fname;
error(errortext);
}
fgets(id_string,254,fd);
result = fgets(id_string,254,fd);
#ifndef WIN32
fgets(line,254,fd); sscanf(line,"%s",tplorg);
result = fgets(line,254,fd); sscanf(line,"%s",tplorg);
#else
fgets(line,254,fd);
result = fgets(line,254,fd);
commentBegin = strstr(line, "/*");
len = strlen(line) - strlen(commentBegin);
strncpy(tplorg, line, len);
......@@ -193,13 +194,13 @@ char *fname;
len--;
tplorg[len] = '\0';
#endif
fgets(line,254,fd); sscanf(line,"%s",tplref);
fgets(line,254,fd); sscanf(line,"%s",iqname);
fgets(line,254,fd); sscanf(line,"%s",niqname);
result = fgets(line,254,fd); sscanf(line,"%s",tplref);
result = fgets(line,254,fd); sscanf(line,"%s",iqname);
result = fgets(line,254,fd); sscanf(line,"%s",niqname);
#ifndef WIN32
fgets(line,254,fd); sscanf(line,"%s",statname);
result = fgets(line,254,fd); sscanf(line,"%s",statname);
#else
fgets(line,254,fd);
result = fgets(line,254,fd);
commentBegin = strstr(line, "/*");
len = strlen(line) - strlen(commentBegin);
strncpy(statname, line, len);
......@@ -207,59 +208,59 @@ char *fname;
len--;
statname[len] = '\0';
#endif
fgets(line,254,fd); sscanf(line,"%d",&inputtype);
fgets(line,254,fd); sscanf(line,"%d",&nframes);
fgets(line,254,fd); sscanf(line,"%d",&frame0);
fgets(line,254,fd); sscanf(line,"%d:%d:%d:%d",&h,&m,&s,&f);
fgets(line,254,fd); sscanf(line,"%d",&N);
fgets(line,254,fd); sscanf(line,"%d",&M);
fgets(line,254,fd); sscanf(line,"%d",&mpeg1);
fgets(line,254,fd); sscanf(line,"%d",&fieldpic);
fgets(line,254,fd); sscanf(line,"%d",&horizontal_size);
fgets(line,254,fd); sscanf(line,"%d",&vertical_size);
fgets(line,254,fd); sscanf(line,"%d",&aspectratio);
fgets(line,254,fd); sscanf(line,"%d",&frame_rate_code);
fgets(line,254,fd); sscanf(line,"%lf",&bit_rate);
fgets(line,254,fd); sscanf(line,"%d",&vbv_buffer_size);
fgets(line,254,fd); sscanf(line,"%d",&low_delay);
fgets(line,254,fd); sscanf(line,"%d",&constrparms);
fgets(line,254,fd); sscanf(line,"%d",&profile);
fgets(line,254,fd); sscanf(line,"%d",&level);
fgets(line,254,fd); sscanf(line,"%d",&prog_seq);
fgets(line,254,fd); sscanf(line,"%d",&chroma_format);
fgets(line,254,fd); sscanf(line,"%d",&video_format);
fgets(line,254,fd); sscanf(line,"%d",&color_primaries);
fgets(line,254,fd); sscanf(line,"%d",&transfer_characteristics);
fgets(line,254,fd); sscanf(line,"%d",&matrix_coefficients);
fgets(line,254,fd); sscanf(line,"%d",&display_horizontal_size);
fgets(line,254,fd); sscanf(line,"%d",&display_vertical_size);
fgets(line,254,fd); sscanf(line,"%d",&dc_prec);
fgets(line,254,fd); sscanf(line,"%d",&topfirst);
fgets(line,254,fd); sscanf(line,"%d %d %d",
frame_pred_dct_tab,frame_pred_dct_tab+1,frame_pred_dct_tab+2);
result = fgets(line,254,fd); sscanf(line,"%d",&inputtype);
result = fgets(line,254,fd); sscanf(line,"%d",&nframes);
result = fgets(line,254,fd); sscanf(line,"%d",&frame0);
result = fgets(line,254,fd); sscanf(line,"%d:%d:%d:%d",&h,&m,&s,&f);
result = fgets(line,254,fd); sscanf(line,"%d",&N);
result = fgets(line,254,fd); sscanf(line,"%d",&M);
result = fgets(line,254,fd); sscanf(line,"%d",&mpeg1);
result = fgets(line,254,fd); sscanf(line,"%d",&fieldpic);
result = fgets(line,