[Spice-commits] 6 commits - client/common.h client/windows common/bitops.h common/canvas_utils.c common/lines.c common/lz_config.h common/pixman_utils.c common/quic_config.h common/rect.h common/ssl_verify.c common/ssl_verify.h
Arnon Gilboa
agilboa at kemper.freedesktop.org
Thu May 12 05:23:27 PDT 2011
client/common.h | 2 ++
client/windows/main.cpp | 6 +++---
client/windows/redc.rc | 8 ++++----
client/windows/redc.vcproj | 12 ++++++++++--
client/windows/stdint.h | 2 +-
common/bitops.h | 6 ++++--
common/canvas_utils.c | 2 +-
common/lines.c | 3 +--
common/lz_config.h | 11 +----------
common/pixman_utils.c | 6 +++---
common/quic_config.h | 16 +++-------------
common/rect.h | 14 +++++++-------
common/ssl_verify.c | 5 +++--
common/ssl_verify.h | 5 +++++
14 files changed, 48 insertions(+), 50 deletions(-)
New commits:
commit 483d13ce611686c37d766e0a38fdf9aae1d39fe5
Author: Arnon Gilboa <agilboa at redhat.com>
Date: Thu May 12 15:09:12 2011 +0300
common: use INLINE instead of inline
needed for spice/common files used by the client, server & qxl driver.
in windows _inline works for both c/c++, while inline is c++ only.
compiling the client with mixed c/c++ code required this define.
diff --git a/common/bitops.h b/common/bitops.h
index 666d82d..4823662 100644
--- a/common/bitops.h
+++ b/common/bitops.h
@@ -21,12 +21,14 @@
#ifndef BITOPS_H
#define BITOPS_H
+#include <spice/macros.h>
+
#ifdef __cplusplus
extern "C" {
#endif
#ifdef WIN32
-static inline int spice_bit_find_msb(uint32_t val)
+static INLINE int spice_bit_find_msb(uint32_t val)
{
uint32_t r;
__asm {
@@ -74,7 +76,7 @@ static inline int spice_bit_find_msb(unsigned int val)
#endif
-static inline int spice_bit_next_pow2(unsigned int val)
+static INLINE int spice_bit_next_pow2(unsigned int val)
{
if ((val & (val - 1)) == 0) {
return val;
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 604f589..55b7159 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -100,7 +100,7 @@ spice_pixman_image_get_format(pixman_image_t *image)
CANVAS_ERROR("Unknown pixman image type");
}
-static inline pixman_image_t *__surface_create_stride(pixman_format_code_t format, int width, int height,
+static INLINE pixman_image_t *__surface_create_stride(pixman_format_code_t format, int width, int height,
int stride)
{
uint8_t *data;
diff --git a/common/lines.c b/common/lines.c
index baf1ce9..8731fb7 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -84,8 +84,7 @@ typedef struct lineGC *GCPtr;
#define miWideDash spice_canvas_wide_dash_line
#define miWideLine spice_canvas_wide_line
-static int inline
-ICEIL (double x)
+static INLINE int ICEIL (double x)
{
int _cTmp = (int)x;
return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp + 1;
diff --git a/common/lz_config.h b/common/lz_config.h
index 439f413..d8675a8 100644
--- a/common/lz_config.h
+++ b/common/lz_config.h
@@ -25,24 +25,15 @@
#include <spice/macros.h>
#ifdef __GNUC__
-
#include <string.h>
-
-#define INLINE inline
-
#else
-
#ifdef QXLDD
#include <windef.h>
#include "os_dep.h"
-#define INLINE _inline
-
#else
#include <stddef.h>
#include <string.h>
-
-#define INLINE inline
#endif // QXLDD
-
#endif //__GNUC__
+
#endif //__LZ_CONFIG_H
diff --git a/common/pixman_utils.c b/common/pixman_utils.c
index 9f3f1de..612ddd8 100644
--- a/common/pixman_utils.c
+++ b/common/pixman_utils.c
@@ -1037,7 +1037,7 @@ pixman_image_t *spice_bitmap_try_as_pixman(int src_format,
#define UINT32_FROM_LE(x) (x)
#endif
-static inline uint32_t rgb_16_555_to_32(uint16_t color)
+static INLINE uint32_t rgb_16_555_to_32(uint16_t color)
{
uint32_t ret;
@@ -1048,7 +1048,7 @@ static inline uint32_t rgb_16_555_to_32(uint16_t color)
return ret;
}
-static inline uint16_t rgb_32_to_16_555(uint32_t color)
+static INLINE uint16_t rgb_32_to_16_555(uint32_t color)
{
return
(((color) >> 3) & 0x001f) |
@@ -1310,7 +1310,7 @@ static void bitmap_4be_16_to_16_555(uint8_t* dest, int dest_stride,
}
}
-static inline int test_bit_be(void* addr, int bit)
+static INLINE int test_bit_be(void* addr, int bit)
{
return !!(((uint8_t*)addr)[bit >> 3] & (0x80 >> (bit & 0x07)));
}
diff --git a/common/quic_config.h b/common/quic_config.h
index da5e51c..2a87f20 100644
--- a/common/quic_config.h
+++ b/common/quic_config.h
@@ -20,36 +20,26 @@
#define __QUIC_CONFIG_H
#include <spice/types.h>
+#include <spice/macros.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __GNUC__
-
#include <string.h>
-
-#define INLINE inline
-
#define MEMCLEAR(ptr, size) memset(ptr, 0, size)
-
#else
-
#ifdef QXLDD
#include <windef.h>
#include "os_dep.h"
-#define INLINE _inline
#define MEMCLEAR(ptr, size) RtlZeroMemory(ptr, size)
#else
#include <stddef.h>
#include <string.h>
-
-#define INLINE inline
#define MEMCLEAR(ptr, size) memset(ptr, 0, size)
-#endif
-
-
-#endif
+#endif // QXLDD
+#endif //__GNUC__
#ifdef __cplusplus
}
diff --git a/common/rect.h b/common/rect.h
index 6d7c446..360cb9d 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -26,7 +26,7 @@
extern "C" {
#endif
-static inline void rect_sect(SpiceRect* r, const SpiceRect* bounds)
+static INLINE void rect_sect(SpiceRect* r, const SpiceRect* bounds)
{
r->left = MAX(r->left, bounds->left);
r->right = MIN(r->right, bounds->right);
@@ -37,7 +37,7 @@ static inline void rect_sect(SpiceRect* r, const SpiceRect* bounds)
r->bottom = MAX(r->top, r->bottom);
}
-static inline void rect_offset(SpiceRect* r, int dx, int dy)
+static INLINE void rect_offset(SpiceRect* r, int dx, int dy)
{
r->left += dx;
r->right += dx;
@@ -45,24 +45,24 @@ static inline void rect_offset(SpiceRect* r, int dx, int dy)
r->bottom += dy;
}
-static inline int rect_is_empty(const SpiceRect* r)
+static INLINE int rect_is_empty(const SpiceRect* r)
{
return r->top == r->bottom || r->left == r->right;
}
-static inline int rect_intersects(const SpiceRect* r1, const SpiceRect* r2)
+static INLINE int rect_intersects(const SpiceRect* r1, const SpiceRect* r2)
{
return r1->left < r2->right && r1->right > r2->left &&
r1->top < r2->bottom && r1->bottom > r2->top;
}
-static inline int rect_is_equal(const SpiceRect *r1, const SpiceRect *r2)
+static INLINE int rect_is_equal(const SpiceRect *r1, const SpiceRect *r2)
{
return r1->top == r2->top && r1->left == r2->left &&
r1->bottom == r2->bottom && r1->right == r2->right;
}
-static inline void rect_union(SpiceRect *dest, const SpiceRect *r)
+static INLINE void rect_union(SpiceRect *dest, const SpiceRect *r)
{
dest->top = MIN(dest->top, r->top);
dest->left = MIN(dest->left, r->left);
@@ -70,7 +70,7 @@ static inline void rect_union(SpiceRect *dest, const SpiceRect *r)
dest->right = MAX(dest->right, r->right);
}
-static inline int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2)
+static INLINE int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2)
{
return r1->right - r1->left == r2->right - r2->left &&
r1->bottom - r1->top == r2->bottom - r2->top;
commit 8776562115ab22b76e30eed3379122477ed00372
Author: Arnon Gilboa <agilboa at redhat.com>
Date: Thu May 12 12:12:36 2011 +0300
client/windows: undef SIZE_MAX in stdint.h
eliminating redefinition warning
diff --git a/client/windows/stdint.h b/client/windows/stdint.h
index 45b133e..768ca03 100644
--- a/client/windows/stdint.h
+++ b/client/windows/stdint.h
@@ -293,7 +293,7 @@ typedef unsigned long long uintmax_t;
#define SIG_ATOMIC_MAX INT32_MAX
-
+#undef SIZE_MAX
#define SIZE_MAX UINT32_MAX
commit ba426a3a4cbc3599eeee720052831b06d65a5a2a
Author: Arnon Gilboa <agilboa at redhat.com>
Date: Thu May 12 12:12:09 2011 +0300
common: fix ssl_verify windows build errors
diff --git a/common/ssl_verify.c b/common/ssl_verify.c
index 5e3722e..603d0f3 100644
--- a/common/ssl_verify.c
+++ b/common/ssl_verify.c
@@ -31,7 +31,7 @@
#include <ctype.h>
#ifndef SPICE_DEBUG
-# define SPICE_DEBUG(format, args...)
+# define SPICE_DEBUG(format, ...)
#endif
#ifdef WIN32
@@ -165,6 +165,7 @@ static int verify_hostname(X509* cert, const char *hostname)
struct in_addr addr;
int addr_len = 0;
int cn_match = 0;
+ X509_NAME* subject;
if (!cert) {
SPICE_DEBUG("warning: no cert!");
@@ -227,7 +228,7 @@ static int verify_hostname(X509* cert, const char *hostname)
}
/* extracting commonNames */
- X509_NAME* subject = X509_get_subject_name(cert);
+ subject = X509_get_subject_name(cert);
if (subject) {
int pos = -1;
X509_NAME_ENTRY* cn_entry;
diff --git a/common/ssl_verify.h b/common/ssl_verify.h
index f0b97d8..8235c13 100644
--- a/common/ssl_verify.h
+++ b/common/ssl_verify.h
@@ -19,6 +19,11 @@
#ifndef SSL_VERIFY_H
#define SSL_VERIFY_H
+#ifdef WIN32
+#include <windows.h>
+#include <wincrypt.h>
+#endif
+
#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
commit ccddcdb82a5269f0950db9cc28993087884a5a1d
Author: Arnon Gilboa <agilboa at redhat.com>
Date: Thu May 12 12:11:29 2011 +0300
client/windows: add common\ssl_verify.c/h to project
disable WarnAsError, due to c/c++ warnings
diff --git a/client/windows/redc.vcproj b/client/windows/redc.vcproj
index 87d018c..17032f7 100644
--- a/client/windows/redc.vcproj
+++ b/client/windows/redc.vcproj
@@ -57,7 +57,7 @@
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="common.h"
WarningLevel="3"
- WarnAsError="true"
+ WarnAsError="false"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
@@ -225,7 +225,7 @@
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
- WarnAsError="true"
+ WarnAsError="false"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
@@ -633,6 +633,10 @@
>
</File>
<File
+ RelativePath="..\..\common\ssl_verify.c"
+ >
+ </File>
+ <File
RelativePath="..\threads.cpp"
>
</File>
@@ -863,6 +867,10 @@
>
</File>
<File
+ RelativePath="..\..\common\ssl_verify.h"
+ >
+ </File>
+ <File
RelativePath="..\threads.h"
>
</File>
commit 4ea4d4dc357d7bbc30979b36b80a7671736b07f5
Author: Arnon Gilboa <agilboa at redhat.com>
Date: Thu May 12 12:10:33 2011 +0300
client/windows: inc version to 0,9,0,0
diff --git a/client/windows/redc.rc b/client/windows/redc.rc
index 6c717df..5f08539 100644
--- a/client/windows/redc.rc
+++ b/client/windows/redc.rc
@@ -60,8 +60,8 @@ ALT_IMAGE_RES_ID BITMAP "sticky_alt.bmp"
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,5,0,0
- PRODUCTVERSION 0,5,0,0
+ FILEVERSION 0,9,0,0
+ PRODUCTVERSION 0,9,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -78,12 +78,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Red Hat Inc."
VALUE "FileDescription", "Spice client"
- VALUE "FileVersion", "0, 5, 0, 0"
+ VALUE "FileVersion", "0, 9, 0, 0"
VALUE "InternalName", "spicec"
VALUE "LegalCopyright", "Copyright (c) 2009 Red Hat, Inc. and/or its affiliates"
VALUE "OriginalFilename", "spicec.exe"
VALUE "ProductName", "Red Hat Spice"
- VALUE "ProductVersion", "0, 5, 0, 0"
+ VALUE "ProductVersion", "0, 9, 0, 0"
END
END
BLOCK "VarFileInfo"
commit d3577b27720b7418c98c888b8ca917c7efa37057
Author: Arnon Gilboa <agilboa at redhat.com>
Date: Thu May 12 12:09:51 2011 +0300
client/windows: init PACKAGE_VERSION
in windows, we set PACKAGE_VERSION to the binary version
since we don't have config.h as generated by linux configure
diff --git a/client/common.h b/client/common.h
index 30fbf79..8b4e39d 100644
--- a/client/common.h
+++ b/client/common.h
@@ -62,6 +62,8 @@
#define strcasecmp stricmp
+extern const char* PACKAGE_VERSION;
+
#else
#include <unistd.h>
#include <X11/X.h>
diff --git a/client/windows/main.cpp b/client/windows/main.cpp
index 5d6f85b..6204498 100644
--- a/client/windows/main.cpp
+++ b/client/windows/main.cpp
@@ -41,7 +41,7 @@ static void init_winsock()
}
}
-const char* version_string = "???";
+const char* PACKAGE_VERSION = "???";
static char _version_string[40];
static void init_version_string()
@@ -66,7 +66,7 @@ static void init_version_string()
(int)(file_info->dwFileVersionMS & 0x0ffff),
(int)(file_info->dwFileVersionLS >> 16),
(int)(file_info->dwFileVersionLS & 0x0ffff));
- version_string = _version_string;
+ PACKAGE_VERSION = _version_string;
}
int WINAPI WinMain(HINSTANCE hInstance,
@@ -82,7 +82,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
init_version_string();
pthread_win32_process_attach_np();
init_winsock();
- exit_val = Application::main(__argc, __argv, version_string);
+ exit_val = Application::main(__argc, __argv, PACKAGE_VERSION);
LOG_INFO("Spice client terminated (exitcode = %d)", exit_val);
} catch (Exception& e) {
LOG_ERROR("unhandle exception: %s", e.what());
More information about the Spice-commits
mailing list