From: Constantin Kaplinsky Date: Wed, 28 Sep 2005 16:49:36 +0000 (+0000) Subject: Updated for building with the latest version of the Exception class which X-Git-Tag: v0.0.90~384^2~497 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4aaf63ba205d676e856cb909ee9f5d010480541b;p=tigervnc.git Updated for building with the latest version of the Exception class which does not include two-argument constructor any more. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@338 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/rfbplayer/FbsInputStream.cxx b/rfbplayer/FbsInputStream.cxx index a173beb3..539a0b5e 100644 --- a/rfbplayer/FbsInputStream.cxx +++ b/rfbplayer/FbsInputStream.cxx @@ -43,7 +43,7 @@ FbsInputStream::FbsInputStream(char* FileName) { char *msg = new char[12 + sizeof(FileName)]; strcpy(msg, "Can't open "); strcat(msg, FileName); - throw rfb::Exception(msg,"RfbPlayer Error"); + throw rfb::Exception(msg); } byte b[12]; @@ -53,7 +53,7 @@ FbsInputStream::FbsInputStream(char* FileName) { b[4] != '0' || b[5] != '0' || b[6] != '1' || b[7] != '.' || b[8] < '0' || b[8] > '9' || b[9] < '0' || b[9] > '9' || b[10] < '0' || b[10] > '9' || b[11] != '\n') { - throw rfb::Exception("Incorrect protocol version", "RfbPlayer Error"); + throw rfb::Exception("Incorrect protocol version"); } } @@ -98,7 +98,7 @@ int FbsInputStream::overrun(int itemSize, int nItems, bool wait=true) { // Perform backwardSeek (throws the special exception) if (seekBackwards) { - throw rfb::Exception("[REWIND]", "RfbPlayer"); + throw rfb::Exception("[REWIND]"); } // Save a tail of data @@ -179,9 +179,9 @@ bool FbsInputStream::readNByte(byte b[], int n) { int count = fread(b, 1, n - off, fbsFile); if (count < n) { if (ferror(fbsFile)) - throw rfb::Exception("Read error from session file", "RfbPlayer Error"); + throw rfb::Exception("Read error from session file"); if (feof(fbsFile)) - throw rfb::Exception("[End Of File]", "RfbPlayer Error"); + throw rfb::Exception("[End Of File]"); } off += count; } diff --git a/rfbplayer/PlayerOptions.cxx b/rfbplayer/PlayerOptions.cxx index 4494e264..5384c6ed 100644 --- a/rfbplayer/PlayerOptions.cxx +++ b/rfbplayer/PlayerOptions.cxx @@ -45,7 +45,7 @@ void PlayerOptions::readFromRegistry() { askPixelFormat = regKey.getBool(_T("AskPixelFormat"), DEFAULT_ASK_PF); if (pPF) delete pPF; } catch (rdr::Exception e) { - MessageBox(0, e.str(), e.type(), MB_OK | MB_ICONERROR); + MessageBox(0, e.str(), "RFB Player", MB_OK | MB_ICONERROR); } } @@ -63,7 +63,7 @@ void PlayerOptions::writeToRegistry() { regKey.setBool(_T("AutoPlay"), autoPlay); regKey.setBool(_T("AskPixelFormat"), askPixelFormat); } catch (rdr::Exception e) { - MessageBox(0, e.str(), e.type(), MB_OK | MB_ICONERROR); + MessageBox(0, e.str(), "RFB Player", MB_OK | MB_ICONERROR); } } diff --git a/rfbplayer/RfbProto.cxx b/rfbplayer/RfbProto.cxx index add2096d..5a7ff7f9 100644 --- a/rfbplayer/RfbProto.cxx +++ b/rfbplayer/RfbProto.cxx @@ -89,7 +89,7 @@ void RfbProto::processVersionMsg() bool done; if (!cp.readVersion(is, &done)) { state_ = RFBSTATE_INVALID; - throw rfb::Exception("reading version failed: wrong file format?", "RfbPlayer"); + throw rfb::Exception("reading version failed: wrong file format?"); } if (!done) return; @@ -99,7 +99,7 @@ void RfbProto::processVersionMsg() sprintf(msg,"File have unsupported RFB protocol version %d.%d", cp.majorVersion, cp.minorVersion); state_ = RFBSTATE_INVALID; - throw rfb::Exception(msg, "RfbPlayer Error"); + throw rfb::Exception(msg); } state_ = RFBSTATE_SECURITY; @@ -120,12 +120,11 @@ void RfbProto::processSecurityMsg() int reasonLen = is->readU32(); char *reason = new char[reasonLen]; is->readBytes(reason, reasonLen); - throw rfb::Exception(reason, "RfbPlayer"); + throw rfb::Exception(reason); } if (secType != secTypeNone) { - throw rfb::Exception("Wrong authentication type in the session file", - "RfbPlayer Error"); + throw rfb::Exception("Wrong authentication type in the session file"); } state_ = RFBSTATE_INITIALISATION; diff --git a/rfbplayer/rfbSessionReader.h b/rfbplayer/rfbSessionReader.h index 115b1d35..31985bc5 100644 --- a/rfbplayer/rfbSessionReader.h +++ b/rfbplayer/rfbSessionReader.h @@ -47,7 +47,7 @@ public: try { rfbSession->processMsg(); } catch (rdr::Exception e) { - MessageBox(0, e.str(), e.type(), MB_OK | MB_ICONERROR); + MessageBox(0, e.str(), "RFB Player", MB_OK | MB_ICONERROR); break; } } diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx index bd8fa072..0a928022 100644 --- a/rfbplayer/rfbplayer.cxx +++ b/rfbplayer/rfbplayer.cxx @@ -756,7 +756,7 @@ void RfbPlayer::processMsg() { char message[256] = "\0"; strcat(message, e.str()); strcat(message, "\nMaybe you force wrong the pixel format for this session"); - MessageBox(getMainHandle(), message, e.type(), MB_OK | MB_ICONERROR); + MessageBox(getMainHandle(), message, "RFB Player", MB_OK | MB_ICONERROR); sessionTerminateThread *terminate = new sessionTerminateThread(this); terminate->start(); return; @@ -835,7 +835,7 @@ void RfbPlayer::serverInit() { void RfbPlayer::setColourMapEntries(int first, int count, U16* rgbs) { vlog.debug("setColourMapEntries: first=%d, count=%d", first, count); - throw rdr::Exception("Can't handle SetColourMapEntries message", "RfbPlayer"); + throw rdr::Exception("Can't handle SetColourMapEntries message"); /* int i; for (i=0;isetColour(i+first, rgbs[i*3], rgbs[i*3+1], rgbs[i*3+2]); @@ -913,7 +913,7 @@ long RfbPlayer::calculateSessionTime(char *filename) { if (strcmp(e.str(), "[End Of File]") == 0) { return sessionFile.getTimeOffset(); } else { - MessageBox(getMainHandle(), e.str(), e.type(), MB_OK | MB_ICONERROR); + MessageBox(getMainHandle(), e.str(), "RFB Player", MB_OK | MB_ICONERROR); return 0; } } @@ -1262,7 +1262,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, char* cmdLine, int cmdSho try { player = new RfbPlayer(fileName, &playerOptions); } catch (rdr::Exception e) { - MessageBox(NULL, e.str(), e.type(), MB_OK | MB_ICONERROR); + MessageBox(NULL, e.str(), "RFB Player", MB_OK | MB_ICONERROR); delete player; return 0; } @@ -1281,7 +1281,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, char* cmdLine, int cmdSho try{ if (player) delete player; } catch (rdr::Exception e) { - MessageBox(NULL, e.str(), e.type(), MB_OK | MB_ICONERROR); + MessageBox(NULL, e.str(), "RFB Player", MB_OK | MB_ICONERROR); } return 0;