From d421856f97d07f10d5043cda484a7ae69d7b3670 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sun, 19 Oct 2014 22:30:05 +0200 Subject: [PATCH] Some changes for windows comptibility --- defines.h | 3 +++ osdopenvg.cc | 16 ++++++++-------- osdopenvg.h | 2 +- osdvector.h | 8 ++++---- surfacevector.cc | 8 ++++---- wselectlist.cc | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/defines.h b/defines.h index 3d975e5..960a5e9 100644 --- a/defines.h +++ b/defines.h @@ -51,6 +51,8 @@ long long getTimeMS(); #define STRCASESTR StrStrI /* #define STRTOULL _strtoui64 */ #define STRTOUL strtoul + #define STRTOKR strtok_l + #define CLOSESOCKET closesocket #define DEFAULT_TCP_WINDOWSIZE 2048 #define DEFAULT_TCP_WINDOWSIZENR 2 /*=2048*/ @@ -82,6 +84,7 @@ long long getTimeMS(); #define STRCASECMP strcasecmp #define STRCASESTR strcasestr #define STRTOUL strtoul + #define STRTOKR strtok_r #define CLOSESOCKET close // add here defines for plattform specific objects diff --git a/osdopenvg.cc b/osdopenvg.cc index 77f0b42..45cab21 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -386,14 +386,14 @@ void OsdOpenVG::initPaths() vguLine(current,0.f,0.f,1.f,0.f); // HorzLine - std_paths[HorzLine]=current; + std_paths[PIHorzLine]=current; current=vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,1.f,0.f, 0,0,VG_PATH_CAPABILITY_ALL); vguLine(current,0.f,0.f,0.f,1.f); // VertLine - std_paths[VertLine]=current; + std_paths[PIVertLine]=current; current=vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,1.f,0.f, @@ -401,23 +401,23 @@ void OsdOpenVG::initPaths() //vguRect(current,0.f,0.f,1.f,1.f); vguRect(current,0.f,0.f,1.f,1.f); // Rectabgle - std_paths[Rectangle]=current; + std_paths[PIRectangle]=current; current=vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,1.f,0.f, 0,0,0); vguEllipse(current,0.f,0.f,1.f,1.f); // Point - std_paths[Point]=current; + std_paths[PIPoint]=current; } void OsdOpenVG::destroyPaths() { - vgDestroyPath(std_paths[HorzLine]); - vgDestroyPath(std_paths[VertLine]); - vgDestroyPath(std_paths[Rectangle]); - vgDestroyPath(std_paths[Point]); + vgDestroyPath(std_paths[PIHorzLine]); + vgDestroyPath(std_paths[PIVertLine]); + vgDestroyPath(std_paths[PIRectangle]); + vgDestroyPath(std_paths[PIPoint]); } diff --git a/osdopenvg.h b/osdopenvg.h index c3f4dfa..e0a07bd 100644 --- a/osdopenvg.h +++ b/osdopenvg.h @@ -123,7 +123,7 @@ protected: void initPaths(); void destroyPaths(); - VGPath std_paths[Point+1]; + VGPath std_paths[PIPoint+1]; long long lastrendertime; void InternalRendering(); void getScreenSize(int &width, int &height); diff --git a/osdvector.h b/osdvector.h index 4e27ab4..0daae43 100644 --- a/osdvector.h +++ b/osdvector.h @@ -43,10 +43,10 @@ enum SVGCommandInstr { DrawImageLoading }; enum PathIndex { - HorzLine, - VertLine, - Rectangle, - Point + PIHorzLine, + PIVertLine, + PIRectangle, + PIPoint }; enum Corner{ diff --git a/surfacevector.cc b/surfacevector.cc index eb612cb..af23530 100644 --- a/surfacevector.cc +++ b/surfacevector.cc @@ -231,7 +231,7 @@ int SurfaceVector::fillblt(int x, int y, int width, int height, const DrawStyle& command_mutex.Lock(); removeCommands(x,y,width,height); // remove commands below the box unsigned int ref=osd->getStyleRef(c); - commands.push_back(SVGCommand::PaintPath(x,y,width,height,Rectangle,ref)); + commands.push_back(SVGCommand::PaintPath(x,y,width,height,PIRectangle,ref)); command_mutex.Unlock(); return 1; @@ -240,14 +240,14 @@ void SurfaceVector::drawHorzLine(int x1, int x2, int y, const DrawStyle& c) { command_mutex.Lock(); unsigned int ref=osd->getStyleRef(c); - commands.push_back(SVGCommand::PaintPath(x1,y,x2-x1,1,HorzLine,ref)); + commands.push_back(SVGCommand::PaintPath(x1,y,x2-x1,1,PIHorzLine,ref)); command_mutex.Unlock(); } void SurfaceVector::drawVertLine(int x, int y1, int y2, const DrawStyle& c){ command_mutex.Lock(); unsigned int ref=osd->getStyleRef(c); - commands.push_back(SVGCommand::PaintPath(x,y1,1,y2-y1,VertLine,ref)); + commands.push_back(SVGCommand::PaintPath(x,y1,1,y2-y1,PIVertLine,ref)); command_mutex.Unlock(); } @@ -286,7 +286,7 @@ void SurfaceVector::drawBitmap(int x, int y, const Bitmap& bm,const DisplayRegio void SurfaceVector::drawPoint(int x, int y, DrawStyle& c, bool fastdraw){ if (!fastdraw) command_mutex.Lock(); unsigned int ref=osd->getStyleRef(c); - commands.push_back(SVGCommand::PaintPath(x,y,1,1,Point,ref)); + commands.push_back(SVGCommand::PaintPath(x,y,1,1,PIPoint,ref)); if (!fastdraw) command_mutex.Unlock(); } void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour) diff --git a/wselectlist.cc b/wselectlist.cc index 7a08144..35dce91 100644 --- a/wselectlist.cc +++ b/wselectlist.cc @@ -182,12 +182,12 @@ void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, cons char* pointer; char* savepointer; - pointer = strtok_r(buffer, "\t\n", &savepointer); + pointer = STRTOKR(buffer, "\t\n", &savepointer); while(pointer) { drawText(pointer, xposmod + columns[currentColumn], ypos_mod + curline * fontHeight, width - columns[currentColumn], colour); - pointer = strtok_r(NULL, "\t\n", &savepointer); + pointer = STRTOKR(NULL, "\t\n", &savepointer); if (pointer) { char delimiter = text[pointer - buffer-1]; if (delimiter == '\t') currentColumn++; -- 2.39.2