Ver código fonte

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 14 anos atrás
pai
commit
0d4e43d778
1 arquivos alterados com 8 adições e 8 exclusões
  1. 8
    8
      networking.cpp

+ 8
- 8
networking.cpp Ver arquivo

// Error description handling for humans. // Error description handling for humans.


string Networking::DescriptiveError(string Msg, int Errno) { // Form a descriptive error w/ errno. 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_INVALID_HANDLE: s = "WSA_INVALID_HANDLE"; break;
case WSA_NOT_ENOUGH_MEMORY: s = "WSA_NOT_ENOUGH_MEMORY"; break; case WSA_NOT_ENOUGH_MEMORY: s = "WSA_NOT_ENOUGH_MEMORY"; break;
case WSA_INVALID_PARAMETER: s = "WSA_INVALID_PARAMETER"; break; case WSA_INVALID_PARAMETER: s = "WSA_INVALID_PARAMETER"; break;
#endif #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()); Msg.append(ErrNoMsg.str());
} }
return Msg; return Msg;

Carregando…
Cancelar
Salvar