Bläddra i källkod

Fixed deprecated conversion warning and added some comments.

git-svn-id: https://svn.microneil.com/svn/CodeDweller/trunk@19 d34b734f-a00e-4b39-a726-e4eeb87269ab
wx
madscientist 15 år sedan
förälder
incheckning
0d4e43d778
1 ändrade filer med 8 tillägg och 8 borttagningar
  1. 8
    8
      networking.cpp

+ 8
- 8
networking.cpp Visa fil

@@ -38,9 +38,9 @@ WSADATA WSSTartData;
// Error description handling for humans.

string Networking::DescriptiveError(string Msg, int Errno) { // Form a descriptive error w/ errno.
char* s = 0;
string s = ""; // Message string.

switch(Errno) {
switch(Errno) { // Assign the appropriate message.
case WSA_INVALID_HANDLE: s = "WSA_INVALID_HANDLE"; break;
case WSA_NOT_ENOUGH_MEMORY: s = "WSA_NOT_ENOUGH_MEMORY"; break;
case WSA_INVALID_PARAMETER: s = "WSA_INVALID_PARAMETER"; break;
@@ -141,13 +141,13 @@ string Networking::DescriptiveError(string Msg, int Errno) {
#endif
}

Msg.append(" ");
if(s) {
Msg.append(s);
Msg.append(" "); // Add a space to the existing message.
if(0 < s.length()) { // If we know the message for Errno
Msg.append(s); // then append it.
}
else {
ostringstream ErrNoMsg;
ErrNoMsg << " UNKNOWN ErrorNumber = " << Errno;
else { // If we don't know what Errno means
ostringstream ErrNoMsg; // then say so and pass on Errno as
ErrNoMsg << " UNKNOWN ErrorNumber = " << Errno; // well so someone can figure it out.
Msg.append(ErrNoMsg.str());
}
return Msg;

Laddar…
Avbryt
Spara