mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-24 03:40:34 +05:00
fix more sprintf warnings
This commit is contained in:
parent
c622f39897
commit
1338cff45d
@ -349,7 +349,7 @@ namespace netgen
|
|||||||
|
|
||||||
for (j = 0; j < nprim->GetNSurfaces(); j++)
|
for (j = 0; j < nprim->GetNSurfaces(); j++)
|
||||||
{
|
{
|
||||||
sprintf (sname, "%s,%d", name, j);
|
snprintf (sname, size(sname), "%s,%d", name, j);
|
||||||
AddSurface (sname, &nprim->GetSurface(j));
|
AddSurface (sname, &nprim->GetSurface(j));
|
||||||
nprim -> SetSurfaceId (j, GetNSurf());
|
nprim -> SetSurfaceId (j, GetNSurf());
|
||||||
}
|
}
|
||||||
@ -633,7 +633,7 @@ namespace netgen
|
|||||||
static int cntsurfs = 0;
|
static int cntsurfs = 0;
|
||||||
cntsurfs++;
|
cntsurfs++;
|
||||||
char name[20];
|
char name[20];
|
||||||
sprintf (name, "nnsurf%d", cntsurfs);
|
snprintf (name, size(name), "nnsurf%d", cntsurfs);
|
||||||
AddSurface (name, surf);
|
AddSurface (name, surf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +42,11 @@ void WriteFluentFormat (const Mesh & mesh,
|
|||||||
outfile << "(0 \"Nodes:\")" << endl;
|
outfile << "(0 \"Nodes:\")" << endl;
|
||||||
|
|
||||||
//number of nodes:
|
//number of nodes:
|
||||||
sprintf(str,"(10 (0 1 %x 1))",np); //hexadecimal!!!
|
snprintf (str, size(str), "(10 (0 1 %x 1))",np); //hexadecimal!!!
|
||||||
outfile << str << endl;
|
outfile << str << endl;
|
||||||
|
|
||||||
//nodes of zone 1:
|
//nodes of zone 1:
|
||||||
sprintf(str,"(10 (7 1 %x 1)(",np); //hexadecimal!!!
|
snprintf (str, size(str), "(10 (7 1 %x 1)(",np); //hexadecimal!!!
|
||||||
outfile << str << endl;
|
outfile << str << endl;
|
||||||
for (i = 1; i <= np; i++)
|
for (i = 1; i <= np; i++)
|
||||||
{
|
{
|
||||||
@ -74,10 +74,10 @@ void WriteFluentFormat (const Mesh & mesh,
|
|||||||
|
|
||||||
int noverbface = 2*ne-nse/2;
|
int noverbface = 2*ne-nse/2;
|
||||||
|
|
||||||
sprintf(str,"(13 (0 1 %x 0))",(noverbface+nse)); //hexadecimal!!!
|
snprintf (str, size(str), "(13 (0 1 %x 0))",(noverbface+nse)); //hexadecimal!!!
|
||||||
outfile << str << endl;
|
outfile << str << endl;
|
||||||
|
|
||||||
sprintf(str,"(13 (4 1 %x 2 3)(",noverbface); //hexadecimal!!!
|
snprintf (str, size(str), "(13 (4 1 %x 2 3)(",noverbface); //hexadecimal!!!
|
||||||
outfile << str << endl;
|
outfile << str << endl;
|
||||||
|
|
||||||
const_cast<Mesh&> (mesh).BuildElementSearchTree();
|
const_cast<Mesh&> (mesh).BuildElementSearchTree();
|
||||||
@ -156,7 +156,7 @@ void WriteFluentFormat (const Mesh & mesh,
|
|||||||
}
|
}
|
||||||
outfile << "))" << endl;
|
outfile << "))" << endl;
|
||||||
|
|
||||||
sprintf(str,"(13 (2 %x %x 3 3)(",(noverbface+1),noverbface+nse); //hexadecimal!!!
|
snprintf (str, size(str), "(13 (2 %x %x 3 3)(",(noverbface+1),noverbface+nse); //hexadecimal!!!
|
||||||
outfile << str << endl;
|
outfile << str << endl;
|
||||||
|
|
||||||
for (i = 1; i <= surfaceelp.Size(); i++)
|
for (i = 1; i <= surfaceelp.Size(); i++)
|
||||||
@ -171,10 +171,10 @@ void WriteFluentFormat (const Mesh & mesh,
|
|||||||
|
|
||||||
outfile << "(0 \"Cells:\")" << endl;
|
outfile << "(0 \"Cells:\")" << endl;
|
||||||
|
|
||||||
sprintf(str,"(12 (0 1 %x 0))",ne); //hexadecimal!!!
|
snprintf (str, size(str), "(12 (0 1 %x 0))",ne); //hexadecimal!!!
|
||||||
outfile << str << endl;
|
outfile << str << endl;
|
||||||
|
|
||||||
sprintf(str,"(12 (1 1 %x 1 2))",ne); //hexadecimal!!!
|
snprintf (str, size(str), "(12 (1 1 %x 1 2))",ne); //hexadecimal!!!
|
||||||
outfile << str << endl << endl;
|
outfile << str << endl << endl;
|
||||||
|
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ namespace netgen
|
|||||||
const Point3d & p = mesh->Point(pi);
|
const Point3d & p = mesh->Point(pi);
|
||||||
glRasterPos3d (p.X(), p.Y(), p.Z());
|
glRasterPos3d (p.X(), p.Y(), p.Z());
|
||||||
|
|
||||||
sprintf (buf, "%d", int(pi));
|
snprintf (buf, size(buf), "%d", int(pi));
|
||||||
|
|
||||||
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
||||||
MyOpenGLText (buf);
|
MyOpenGLText (buf);
|
||||||
@ -434,7 +434,7 @@ namespace netgen
|
|||||||
const Point3d p = Center (p1, p2);
|
const Point3d p = Center (p1, p2);
|
||||||
glRasterPos3d (p.X(), p.Y(), p.Z());
|
glRasterPos3d (p.X(), p.Y(), p.Z());
|
||||||
|
|
||||||
sprintf (buf, "%d", seg.edgenr);
|
snprintf (buf, size(buf), "%d", seg.edgenr);
|
||||||
glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@ -449,7 +449,7 @@ namespace netgen
|
|||||||
const Point3d p = Center (p1, p2);
|
const Point3d p = Center (p1, p2);
|
||||||
glRasterPos3d (p.X(), p.Y(), p.Z());
|
glRasterPos3d (p.X(), p.Y(), p.Z());
|
||||||
|
|
||||||
sprintf (buf, "%d", i);
|
snprintf (buf, size(buf), "%d", i);
|
||||||
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
||||||
MyOpenGLText (buf);
|
MyOpenGLText (buf);
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
glRasterPos3d (p.X(), p.Y(), p.Z());
|
glRasterPos3d (p.X(), p.Y(), p.Z());
|
||||||
sprintf (buf, "%d", i);
|
snprintf (buf, size(buf), "%d", i);
|
||||||
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
||||||
MyOpenGLText (buf);
|
MyOpenGLText (buf);
|
||||||
}
|
}
|
||||||
@ -567,7 +567,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
glRasterPos3d (p.X(), p.Y(), p.Z());
|
glRasterPos3d (p.X(), p.Y(), p.Z());
|
||||||
sprintf (buf, "%d", i);
|
snprintf (buf, size(buf), "%d", i);
|
||||||
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
// glCallLists (strlen (buf), GL_UNSIGNED_BYTE, buf);
|
||||||
MyOpenGLText (buf);
|
MyOpenGLText (buf);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user