Commit 59ac148b authored by pkasting@chromium.org's avatar pkasting@chromium.org

Fix gcc 4.7 building problems.

This is being submitted on behalf of shanhan@google.com, original CL at https://chromiumcodereview.appspot.com/10537037/ .

BUG=None
TEST=Built successfully using GCC-4.7 under linux
Review URL: https://chromiumcodereview.appspot.com/10543080

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141286 0039d316-1c4b-4281-b951-d872f2087c98
parent f639faae
......@@ -91,9 +91,9 @@ void CallbackWithUnlimitedStorage(
SettingsStorageQuotaEnforcer::Limits GetLocalLimits() {
SettingsStorageQuotaEnforcer::Limits limits = {
api::storage::local::QUOTA_BYTES,
UINT_MAX,
UINT_MAX
static_cast<size_t>(api::storage::local::QUOTA_BYTES),
std::numeric_limits<size_t>::max(),
std::numeric_limits<size_t>::max()
};
return limits;
}
......
......@@ -82,10 +82,10 @@ GdkCursor* GetMozSpinningCursor() {
if (!moz_spinning_cursor) {
const GdkColor fg = { 0, 0, 0, 0 };
const GdkColor bg = { 65535, 65535, 65535, 65535 };
GdkPixmap* source =
gdk_bitmap_create_from_data(NULL, moz_spinning_bits, 32, 32);
GdkPixmap* mask =
gdk_bitmap_create_from_data(NULL, moz_spinning_mask_bits, 32, 32);
GdkPixmap* source = gdk_bitmap_create_from_data(
NULL, reinterpret_cast<const gchar*>(moz_spinning_bits), 32, 32);
GdkPixmap* mask = gdk_bitmap_create_from_data(
NULL, reinterpret_cast<const gchar*>(moz_spinning_mask_bits), 32, 32);
moz_spinning_cursor =
gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 2, 2);
g_object_unref(source);
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......@@ -18,15 +18,20 @@ namespace media {
#define FIX_SHIFT 12
#define FIX(x) ((x) * (1 << FIX_SHIFT))
// Define a convenient macro to do static cast.
#define INT16_FIX(x) static_cast<int16>(FIX(x))
SIMD_ALIGNED(const int16 ConvertRGBAToYUV_kTable[8 * 3]) = {
FIX(0.098), FIX(0.504), FIX(0.257), 0,
FIX(0.098), FIX(0.504), FIX(0.257), 0,
FIX(0.439), -FIX(0.291), -FIX(0.148), 0,
FIX(0.439), -FIX(0.291), -FIX(0.148), 0,
-FIX(0.071), -FIX(0.368), FIX(0.439), 0,
-FIX(0.071), -FIX(0.368), FIX(0.439), 0,
INT16_FIX(0.098), INT16_FIX(0.504), INT16_FIX(0.257), 0,
INT16_FIX(0.098), INT16_FIX(0.504), INT16_FIX(0.257), 0,
INT16_FIX(0.439), -INT16_FIX(0.291), -INT16_FIX(0.148), 0,
INT16_FIX(0.439), -INT16_FIX(0.291), -INT16_FIX(0.148), 0,
-INT16_FIX(0.071), -INT16_FIX(0.368), INT16_FIX(0.439), 0,
-INT16_FIX(0.071), -INT16_FIX(0.368), INT16_FIX(0.439), 0,
};
#undef INT16_FIX
// This is the final offset for the conversion from signed yuv values to
// unsigned values. It is arranged so that offset of 16 is applied to Y
// components and 128 is added to UV components for 2 pixels.
......
......@@ -31,10 +31,10 @@ GdkCursor* GetInlineCustomCursor(CustomCursorType type) {
if (!cursor) {
const GdkColor fg = { 0, 0, 0, 0 };
const GdkColor bg = { 65535, 65535, 65535, 65535 };
GdkPixmap* source = gdk_bitmap_create_from_data(NULL, custom.bits,
32, 32);
GdkPixmap* mask = gdk_bitmap_create_from_data(NULL, custom.mask_bits,
32, 32);
GdkPixmap* source = gdk_bitmap_create_from_data(
NULL, reinterpret_cast<const gchar*>(custom.bits), 32, 32);
GdkPixmap* mask = gdk_bitmap_create_from_data(
NULL, reinterpret_cast<const gchar*>(custom.mask_bits), 32, 32);
cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg,
custom.hot_x, custom.hot_y);
g_object_unref(source);
......
......@@ -32,7 +32,7 @@
*/
/* MOZ_CURSOR_VERTICAL_TEXT */
static const char moz_vertical_text_bits[] = {
static const uint8 moz_vertical_text_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
0x06, 0x60, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00,
0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
......@@ -45,7 +45,7 @@ static const char moz_vertical_text_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_vertical_text_mask_bits[] = {
static const uint8 moz_vertical_text_mask_bits[] = {
0x07, 0xe0, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00,
0xff, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0x0f, 0xf0, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00,
......@@ -59,7 +59,7 @@ static const char moz_vertical_text_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_CONTEXT_MENU */
static const char moz_menu_bits[] = {
static const uint8 moz_menu_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0xfd, 0x00, 0x00,
......@@ -72,7 +72,7 @@ static const char moz_menu_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_menu_mask_bits[] = {
static const uint8 moz_menu_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0xfd, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00,
......@@ -86,7 +86,7 @@ static const char moz_menu_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_COPY */
static const char moz_copy_bits[] = {
static const uint8 moz_copy_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00,
......@@ -99,7 +99,7 @@ static const char moz_copy_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_copy_mask_bits[] = {
static const uint8 moz_copy_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00,
......@@ -113,7 +113,7 @@ static const char moz_copy_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_ALIAS */
static const char moz_alias_bits[] = {
static const uint8 moz_alias_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00,
......@@ -126,7 +126,7 @@ static const char moz_alias_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_alias_mask_bits[] = {
static const uint8 moz_alias_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00,
......@@ -140,7 +140,7 @@ static const char moz_alias_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_ZOOM_IN */
static const char moz_zoom_in_bits[] = {
static const uint8 moz_zoom_in_bits[] = {
0xf0, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
0x62, 0x04, 0x00, 0x00, 0x61, 0x08, 0x00, 0x00, 0xf9, 0x09, 0x00, 0x00,
0xf9, 0x09, 0x00, 0x00, 0x61, 0x08, 0x00, 0x00, 0x62, 0x04, 0x00, 0x00,
......@@ -153,7 +153,7 @@ static const char moz_zoom_in_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_zoom_in_mask_bits[] = {
static const uint8 moz_zoom_in_mask_bits[] = {
0xf0, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
......@@ -167,7 +167,7 @@ static const char moz_zoom_in_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_ZOOM_OUT */
static const char moz_zoom_out_bits[] = {
static const uint8 moz_zoom_out_bits[] = {
0xf0, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
0x02, 0x04, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf9, 0x09, 0x00, 0x00,
0xf9, 0x09, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
......@@ -180,7 +180,7 @@ static const char moz_zoom_out_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_zoom_out_mask_bits[] = {
static const uint8 moz_zoom_out_mask_bits[] = {
0xf0, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
......@@ -194,7 +194,7 @@ static const char moz_zoom_out_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_HAND_GRAB */
static const char moz_hand_grab_bits[] = {
static const uint8 moz_hand_grab_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x60, 0x39, 0x00, 0x00, 0x90, 0x49, 0x00, 0x00, 0x90, 0x49, 0x01, 0x00,
0x20, 0xc9, 0x02, 0x00, 0x20, 0x49, 0x02, 0x00, 0x58, 0x40, 0x02, 0x00,
......@@ -207,7 +207,7 @@ static const char moz_hand_grab_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_hand_grab_mask_bits[] = {
static const uint8 moz_hand_grab_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x60, 0x3f, 0x00, 0x00,
0xf0, 0x7f, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0xf8, 0xff, 0x03, 0x00,
0xf0, 0xff, 0x07, 0x00, 0xf8, 0xff, 0x07, 0x00, 0xfc, 0xff, 0x07, 0x00,
......@@ -221,7 +221,7 @@ static const char moz_hand_grab_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* MOZ_CURSOR_HAND_GRABBING */
static const char moz_hand_grabbing_bits[] = {
static const uint8 moz_hand_grabbing_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x36, 0x00, 0x00, 0x20, 0xc9, 0x00, 0x00, 0x20, 0x40, 0x01, 0x00,
......@@ -234,7 +234,7 @@ static const char moz_hand_grabbing_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_hand_grabbing_mask_bits[] = {
static const uint8 moz_hand_grabbing_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x36, 0x00, 0x00,
0xe0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x03, 0x00,
......@@ -260,8 +260,8 @@ enum CustomCursorType {
typedef struct {
const char* name;
const char* bits;
const char* mask_bits;
const uint8* bits;
const uint8* mask_bits;
int hot_x;
int hot_y;
} CustomCursor;
......@@ -273,7 +273,7 @@ static const CustomCursor CustomCursors[] = {
{ "context-menu", moz_menu_bits, moz_menu_mask_bits, 2, 2 },
{ "zoom-in", moz_zoom_in_bits, moz_zoom_in_mask_bits, 6, 6 },
{ "zoom-out", moz_zoom_out_bits, moz_zoom_out_mask_bits, 6, 6 },
{ "vertical-text", moz_vertical_text_bits, moz_vertical_text_mask_bits, 8, 4 },
{ "vertical-text", moz_vertical_text_bits, moz_vertical_text_mask_bits, 8, 4},
{ "grab", moz_hand_grab_bits, moz_hand_grab_mask_bits, 10, 10 },
{ "grabbing", moz_hand_grabbing_bits, moz_hand_grabbing_mask_bits, 10, 10 }
};
......@@ -284,7 +284,7 @@ static const CustomCursor CustomCursors[] = {
// to as left_ptr_watch).
/* MOZ_CURSOR_SPINNING */
static const char moz_spinning_bits[] = {
static const uint8 moz_spinning_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00,
......@@ -297,7 +297,7 @@ static const char moz_spinning_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const char moz_spinning_mask_bits[] = {
static const uint8 moz_spinning_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x3b, 0x00, 0x00,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment