瀏覽代碼

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 年之前
父節點
當前提交
0d4e43d778
共有 1 個檔案被更改,包括 8 行新增8 行删除
  1. 8
    8
      networking.cpp

+ 8
- 8
networking.cpp 查看文件

@@ -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;

Loading…
取消
儲存