integrated changes from main repository

This commit is contained in:
Guenter Obiltschnig
2007-01-04 08:01:43 +00:00
parent 431807f25e
commit 3941965bce
6 changed files with 36 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
// //
// Format.h // Format.h
// //
// $Id: //poco/1.3/Foundation/include/Poco/Format.h#2 $ // $Id: //poco/1.3/Foundation/include/Poco/Format.h#3 $
// //
// Library: Foundation // Library: Foundation
// Package: Core // Package: Core
@@ -109,7 +109,7 @@ std::string Foundation_API format(const std::string& fmt, const Any& value);
/// * l argument is long (d, i), unsigned long (o, u, x, X) or long double (e, E, f, g, G) /// * l argument is long (d, i), unsigned long (o, u, x, X) or long double (e, E, f, g, G)
/// * L argument is long long (d, i), unsigned long long (o, u, x, X) /// * L argument is long long (d, i), unsigned long long (o, u, x, X)
/// * h argument is short (d, i), unsigned short (o, u, x, X) or float (e, E, f, g, G) /// * h argument is short (d, i), unsigned short (o, u, x, X) or float (e, E, f, g, G)
/// * * argument is any signed or unsigned integer (d, i, o, x, X) /// * ? argument is any signed or unsigned int, short, long, or 64-bit integer (d, i, o, x, X)
/// ///
/// The width argument is a nonnegative decimal integer controlling the minimum number of characters printed. /// The width argument is a nonnegative decimal integer controlling the minimum number of characters printed.
/// If the number of characters in the output value is less than the specified width, blanks or /// If the number of characters in the output value is less than the specified width, blanks or

View File

@@ -1,7 +1,7 @@
// //
// Format.cpp // Format.cpp
// //
// $Id: //poco/1.3/Foundation/src/Format.cpp#2 $ // $Id: //poco/1.3/Foundation/src/Format.cpp#3 $
// //
// Library: Foundation // Library: Foundation
// Package: Core // Package: Core
@@ -113,7 +113,7 @@ namespace
case 'l': case 'l':
case 'h': case 'h':
case 'L': case 'L':
case '*': mod = *itFmt++; break; case '?': mod = *itFmt++; break;
} }
} }
return mod; return mod;
@@ -186,7 +186,7 @@ namespace
case 'l': str << AnyCast<long>(*itVal++); break; case 'l': str << AnyCast<long>(*itVal++); break;
case 'L': str << AnyCast<Int64>(*itVal++); break; case 'L': str << AnyCast<Int64>(*itVal++); break;
case 'h': str << AnyCast<short>(*itVal++); break; case 'h': str << AnyCast<short>(*itVal++); break;
case '*': writeAnyInt(str, *itVal++); break; case '?': writeAnyInt(str, *itVal++); break;
default: str << AnyCast<int>(*itVal++); break; default: str << AnyCast<int>(*itVal++); break;
} }
break; break;
@@ -199,7 +199,7 @@ namespace
case 'l': str << AnyCast<unsigned long>(*itVal++); break; case 'l': str << AnyCast<unsigned long>(*itVal++); break;
case 'L': str << AnyCast<UInt64>(*itVal++); break; case 'L': str << AnyCast<UInt64>(*itVal++); break;
case 'h': str << AnyCast<unsigned short>(*itVal++); break; case 'h': str << AnyCast<unsigned short>(*itVal++); break;
case '*': writeAnyInt(str, *itVal++); break; case '?': writeAnyInt(str, *itVal++); break;
default: str << AnyCast<unsigned>(*itVal++); break; default: str << AnyCast<unsigned>(*itVal++); break;
} }
break; break;

View File

@@ -1,7 +1,7 @@
// //
// FormatTest.cpp // FormatTest.cpp
// //
// $Id: //poco/1.3/Foundation/testsuite/src/FormatTest.cpp#2 $ // $Id: //poco/1.3/Foundation/testsuite/src/FormatTest.cpp#3 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// All rights reserved. // All rights reserved.
@@ -214,55 +214,55 @@ void FormatTest::testInt()
void FormatTest::testAnyInt() void FormatTest::testAnyInt()
{ {
char c = 42; char c = 42;
std::string s(format("%*i", c)); std::string s(format("%?i", c));
assert (s == "42"); assert (s == "42");
signed char sc = -42; signed char sc = -42;
s = format("%*i", sc); s = format("%?i", sc);
assert (s == "-42"); assert (s == "-42");
unsigned char uc = 65; unsigned char uc = 65;
s = format("%*i", uc); s = format("%?i", uc);
assert (s == "65"); assert (s == "65");
short ss = -134; short ss = -134;
s = format("%*i", ss); s = format("%?i", ss);
assert (s == "-134"); assert (s == "-134");
unsigned short us = 200; unsigned short us = 200;
s = format("%*i", us); s = format("%?i", us);
assert (s == "200"); assert (s == "200");
int i = -12345; int i = -12345;
s = format("%*i", i); s = format("%?i", i);
assert (s == "-12345"); assert (s == "-12345");
unsigned ui = 12345; unsigned ui = 12345;
s = format("%*i", ui); s = format("%?i", ui);
assert (s == "12345"); assert (s == "12345");
long l = -54321; long l = -54321;
s = format("%*i", l); s = format("%?i", l);
assert (s == "-54321"); assert (s == "-54321");
unsigned long ul = 54321; unsigned long ul = 54321;
s = format("%*i", ul); s = format("%?i", ul);
assert (s == "54321"); assert (s == "54321");
Int64 i64 = -12345678; Int64 i64 = -12345678;
s = format("%*i", i64); s = format("%?i", i64);
assert (s == "-12345678"); assert (s == "-12345678");
UInt64 ui64 = 12345678; UInt64 ui64 = 12345678;
s = format("%*i", ui64); s = format("%?i", ui64);
assert (s == "12345678"); assert (s == "12345678");
ss = 0x42; ss = 0x42;
s = format("%*x", ss); s = format("%?x", ss);
assert (s == "42"); assert (s == "42");
ss = 042; ss = 042;
s = format("%*o", ss); s = format("%?o", ss);
assert (s == "42"); assert (s == "42");
} }

View File

@@ -1,7 +1,7 @@
// //
// IPAddress.cpp // IPAddress.cpp
// //
// $Id: //poco/1.3/Net/src/IPAddress.cpp#1 $ // $Id: //poco/1.3/Net/src/IPAddress.cpp#2 $
// //
// Library: Net // Library: Net
// Package: NetCore // Package: NetCore
@@ -300,7 +300,7 @@ public:
} }
} }
if (i > 0) result.append(":"); if (i > 0) result.append(":");
if (i < 8) result.append(NumberFormatter::formatHex(words[i++])); if (i < 8) result.append(NumberFormatter::formatHex(ntohs(words[i++])));
} }
return result; return result;
} }

View File

@@ -1,7 +1,7 @@
// //
// SocketNotifier.cpp // SocketNotifier.cpp
// //
// $Id: //poco/1.3/Net/src/SocketNotifier.cpp#1 $ // $Id: //poco/1.3/Net/src/SocketNotifier.cpp#2 $
// //
// Library: Net // Library: Net
// Package: Reactor // Package: Reactor
@@ -87,9 +87,20 @@ void SocketNotifier::removeObserver(SocketReactor* pReactor, const Poco::Abstrac
void SocketNotifier::dispatch(SocketNotification* pNotification) void SocketNotifier::dispatch(SocketNotification* pNotification)
{ {
static Socket nullSocket;
pNotification->setSocket(_socket); pNotification->setSocket(_socket);
pNotification->duplicate(); pNotification->duplicate();
_nc.postNotification(pNotification); try
{
_nc.postNotification(pNotification);
}
catch (...)
{
pNotification->setSocket(nullSocket);
throw;
}
pNotification->setSocket(nullSocket);
} }

View File

@@ -1 +1 @@
1.3-20061227 (2006-12-27) 1.3-20070104-ssl (2007-01-04)