ISO C++ forbids variable length array 'buf'

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@281 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2010-02-06 18:08:47 +00:00
parent d706352d95
commit 7db92a4c36

View File

@@ -83,7 +83,7 @@ void gethotlist()
if (!fgets(line, sizeof(line), hl))
break;
if (1 == sscanf(line, "%x", &hotlist[maxhotlist+1]))
if (1 == sscanf(line, "%x", (unsigned int*)&hotlist[maxhotlist+1]))
{
if (hotlist[maxhotlist+1] >= 0x100 && hotlist[maxhotlist+1] <= 0x899)
{
@@ -4084,10 +4084,10 @@ void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, int color)
}
void FlipHorz(int x, int y, int w, int h)
{
unsigned char buf[w*4];
unsigned char *buf= new unsigned char[w*4];
unsigned char *p = lfb + x*4 + y * fix_screeninfo.line_length;
int w1,h1;
if(buf != NULL){
for (h1 = 0 ; h1 < h ; h1++)
{
memcpy(buf,p,w*4);
@@ -4097,13 +4097,15 @@ void FlipHorz(int x, int y, int w, int h)
}
p += fix_screeninfo.line_length;
}
delete [] buf;
}
}
void FlipVert(int x, int y, int w, int h)
{
unsigned char buf[w*4];
unsigned char *buf= new unsigned char[w*4];
unsigned char *p = lfb + x*4 + y * fix_screeninfo.line_length, *p1, *p2;
int h1;
if(buf != NULL){
for (h1 = 0 ; h1 < h/2 ; h1++)
{
p1 = (p+(h1*fix_screeninfo.line_length));
@@ -4112,6 +4114,8 @@ void FlipVert(int x, int y, int w, int h)
memcpy(p1,p2,w*4);
memcpy(p2,buf,w*4);
}
delete [] buf;
}
}
int ShapeCoord(int param, int curfontwidth, int curfontheight)