summaryrefslogtreecommitdiffstats
path: root/client/windows/platform_utils.cpp
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2009-10-16 00:21:43 +0200
committerYaniv Kamay <ykamay@redhat.com>2009-10-18 17:42:37 +0200
commitef213c66c19d265140e9a55519b174d34ff1f16b (patch)
tree0a8e58217f5757881d4d4798d1316dbb3809f37a /client/windows/platform_utils.cpp
parent308e4545cbf8d26d5d47ad6ab9f2c6e6e6648003 (diff)
downloadspice-ef213c66c19d265140e9a55519b174d34ff1f16b.tar.gz
spice-ef213c66c19d265140e9a55519b174d34ff1f16b.tar.xz
spice-ef213c66c19d265140e9a55519b174d34ff1f16b.zip
tunnel
Diffstat (limited to 'client/windows/platform_utils.cpp')
-rw-r--r--client/windows/platform_utils.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/client/windows/platform_utils.cpp b/client/windows/platform_utils.cpp
index 6b9049a0..9b809c87 100644
--- a/client/windows/platform_utils.cpp
+++ b/client/windows/platform_utils.cpp
@@ -90,7 +90,7 @@ HBITMAP get_alpha_bitmap_res(int id)
AutoDC auto_dc(create_compatible_dc());
BITMAPINFO dest_info;
- uint8_t *dest;
+ uint8_t* dest;
dest_info.bmiHeader.biSize = sizeof(dest_info.bmiHeader);
dest_info.bmiHeader.biWidth = src_info.bmWidth;
dest_info.bmiHeader.biHeight = -src_info.bmHeight;
@@ -102,7 +102,7 @@ HBITMAP get_alpha_bitmap_res(int id)
dest_info.bmiHeader.biClrUsed = 0;
dest_info.bmiHeader.biClrImportant = 0;
- HBITMAP ret = CreateDIBSection(auto_dc.get(), &dest_info, 0, (VOID **)&dest, NULL, 0);
+ HBITMAP ret = CreateDIBSection(auto_dc.get(), &dest_info, 0, (VOID**)&dest, NULL, 0);
if (!ret) {
THROW("create bitmap failed, %u", GetLastError());
}
@@ -139,7 +139,7 @@ const char* sys_err_to_str(int error)
msg = new char[BUF_SIZE];
_snprintf(msg, BUF_SIZE, "errno %d", error);
} else {
- char *new_line;
+ char* new_line;
if ((new_line = strrchr(msg, '\r'))) {
*new_line = 0;
}
@@ -149,3 +149,14 @@ const char* sys_err_to_str(int error)
return errors_map[error];
}
+int inet_aton(const char* ip, struct in_addr* in_addr)
+{
+ unsigned long addr = inet_addr(ip);
+
+ if (addr == INADDR_NONE) {
+ return 0;
+ }
+ in_addr->S_un.S_addr = addr;
+ return 1;
+}
+