]> source.dussan.org Git - tigervnc.git/commitdiff
Updated for building with the latest version of the Exception class which
authorConstantin Kaplinsky <const@tightvnc.com>
Wed, 28 Sep 2005 16:49:36 +0000 (16:49 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Wed, 28 Sep 2005 16:49:36 +0000 (16:49 +0000)
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

rfbplayer/FbsInputStream.cxx
rfbplayer/PlayerOptions.cxx
rfbplayer/RfbProto.cxx
rfbplayer/rfbSessionReader.h
rfbplayer/rfbplayer.cxx

index a173beb3b79b62e7d6fdf13158f1bb687b04fce9..539a0b5e150de02ad794822651cf352eb536f008 100644 (file)
@@ -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;
   }
index 4494e2649f1f406a1c719d6865cfd30af981311f..5384c6edce825cd394696e832428866ba10c79ba 100644 (file)
@@ -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);
   }
 }
 
index add2096dc5eba10bc66ff44e2cd9014bde8b9c8d..5a7ff7f9579577500d9d33d5b39c68dcd221c736 100644 (file)
@@ -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;
index 115b1d35d9509ac75f911c41c1d81435e93cd397..31985bc50b7ee40c90b947bfb1f84efe55b2a351 100644 (file)
@@ -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;
       }
     }
index bd8fa072457be3a54d1592893693696f6599854d..0a928022f7b74c4dd09a7007cee85c6a458f4a9a 100644 (file)
@@ -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;i<count;i++) {
     buffer->setColour(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;