Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 83476 Details for
Bug 128200
sdl-gui fails with "dereferencing type-punned pointer breaks strict aliasing"
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Diff file to get sdl-gui to compile with GCC-4.1.
sdl-gui-0.10.3-gcc4.diff (text/plain), 11.22 KB, created by
Robert Marmorstein
on 2006-03-30 21:38:37 UTC
(
hide
)
Description:
Diff file to get sdl-gui to compile with GCC-4.1.
Filename:
MIME Type:
Creator:
Robert Marmorstein
Created:
2006-03-30 21:38:37 UTC
Size:
11.22 KB
patch
obsolete
>diff -Naur SDL_gui-0.10.3.old/src/AbstractButton.cc SDL_gui-0.10.3/src/AbstractButton.cc >--- SDL_gui-0.10.3.old/src/AbstractButton.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/AbstractButton.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -75,5 +75,8 @@ > > void GUI_AbstractButton::SetClick(GUI_Callback *callback) > { >- GUI_ObjectKeep((GUI_Object **) &click, callback); >+ GUI_Object * temp; >+ temp = (GUI_Object *)click; >+ GUI_ObjectKeep(&temp, callback); >+ click = (GUI_Callback *)temp; > } >diff -Naur SDL_gui-0.10.3.old/src/Button.cc SDL_gui-0.10.3/src/Button.cc >--- SDL_gui-0.10.3.old/src/Button.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Button.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -54,26 +54,50 @@ > > void GUI_Button::SetNormalImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &normal, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)normal; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ normal = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ normal = (GUI_Surface *)temp; > } > > void GUI_Button::SetHighlightImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &highlight, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)highlight; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ highlight = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ highlight = (GUI_Surface *)temp; > } > > void GUI_Button::SetPressedImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &pressed, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)pressed; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ pressed = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ pressed = (GUI_Surface *)temp; > } > > void GUI_Button::SetDisabledImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &disabled, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)disabled; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ disabled = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ disabled = (GUI_Surface *)temp; > } > > extern "C" >diff -Naur SDL_gui-0.10.3.old/src/Container.cc SDL_gui-0.10.3/src/Container.cc >--- SDL_gui-0.10.3.old/src/Container.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Container.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -165,8 +165,14 @@ > > void GUI_Container::SetBackground(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &background, surface)) >+ GUI_Object* temp; >+ temp = (GUI_Object *)background; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ background = (GUI_Surface*)temp; > MarkChanged(); >+ } >+ else >+ background = (GUI_Surface*)temp; > } > > void GUI_Container::SetBackgroundColor(SDL_Color c) >diff -Naur SDL_gui-0.10.3.old/src/Drawable.cc SDL_gui-0.10.3/src/Drawable.cc >--- SDL_gui-0.10.3.old/src/Drawable.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Drawable.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -229,7 +229,10 @@ > > void GUI_Drawable::SetStatusCallback(GUI_Callback *callback) > { >- GUI_ObjectKeep((GUI_Object **) &status_callback, callback); >+ GUI_Object* temp; >+ temp = (GUI_Object *)status_callback; >+ GUI_ObjectKeep(&temp, callback); >+ status_callback = (GUI_Callback *)temp; > } > > int GUI_Drawable::GetFlagDelta(void) >diff -Naur SDL_gui-0.10.3.old/src/Label.cc SDL_gui-0.10.3/src/Label.cc >--- SDL_gui-0.10.3.old/src/Label.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Label.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -77,8 +77,14 @@ > > void GUI_Label::SetFont(GUI_Font *afont) > { >- if (GUI_ObjectKeep((GUI_Object **) &font, afont)) >+ GUI_Object* temp; >+ temp = (GUI_Object *)font; >+ if (GUI_ObjectKeep(&temp, afont)){ >+ font = (GUI_Font *)temp; > MarkChanged(); >+ } >+ else >+ font = (GUI_Font *)temp; > // FIXME: should re-draw the text > } > >diff -Naur SDL_gui-0.10.3.old/src/Panel.cc SDL_gui-0.10.3/src/Panel.cc >--- SDL_gui-0.10.3.old/src/Panel.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Panel.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -58,11 +58,16 @@ > > void GUI_Panel::SetLayout(GUI_Layout *a_layout) > { >- if (GUI_ObjectKeep((GUI_Object **) &layout, a_layout)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)layout; >+ if (GUI_ObjectKeep(&temp, a_layout)) > { >+ layout = (GUI_Layout *)temp; > UpdateLayout(); > MarkChanged(); > } >+ else >+ layout = (GUI_Layout *)temp; > } > > extern "C" >diff -Naur SDL_gui-0.10.3.old/src/Picture.cc SDL_gui-0.10.3/src/Picture.cc >--- SDL_gui-0.10.3.old/src/Picture.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Picture.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -76,8 +76,14 @@ > > void GUI_Picture::SetImage(GUI_Surface *an_image) > { >- if (GUI_ObjectKeep((GUI_Object **) &image, an_image)) >+ GUI_Object *temp; >+ temp = (GUI_Object *)image; >+ if (GUI_ObjectKeep(&temp, an_image)){ >+ image = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ image = (GUI_Surface *)temp; > } > > void GUI_Picture::SetCaption(GUI_Widget *a_caption) >diff -Naur SDL_gui-0.10.3.old/src/ProgressBar.cc SDL_gui-0.10.3/src/ProgressBar.cc >--- SDL_gui-0.10.3.old/src/ProgressBar.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/ProgressBar.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -76,14 +76,26 @@ > > void GUI_ProgressBar::SetImage1(GUI_Surface *image) > { >- if (GUI_ObjectKeep((GUI_Object **) &image1, image)) >+ GUI_Object * temp; >+ temp = (GUI_Object *) image1; >+ if (GUI_ObjectKeep(&temp, image)){ >+ image1 = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ image1 = (GUI_Surface *)temp; > } > > void GUI_ProgressBar::SetImage2(GUI_Surface *image) > { >- if (GUI_ObjectKeep((GUI_Object **) &image2, image)) >+ GUI_Object * temp; >+ temp = (GUI_Object *) image2; >+ if (GUI_ObjectKeep(&temp, image)){ >+ image2 = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ image2 = (GUI_Surface *)temp; > } > > void GUI_ProgressBar::SetPosition(double a_value) >diff -Naur SDL_gui-0.10.3.old/src/Screen.cc SDL_gui-0.10.3/src/Screen.cc >--- SDL_gui-0.10.3.old/src/Screen.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/Screen.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -154,8 +154,14 @@ > > void GUI_Screen::SetBackground(GUI_Surface *image) > { >- if (GUI_ObjectKeep((GUI_Object **) &background, image)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)background; >+ if (GUI_ObjectKeep(&temp, image)){ >+ background = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ background = (GUI_Surface *)temp; > } > > void GUI_Screen::SetBackgroundColor(SDL_Color c) >diff -Naur SDL_gui-0.10.3.old/src/ScrollBar.cc SDL_gui-0.10.3/src/ScrollBar.cc >--- SDL_gui-0.10.3.old/src/ScrollBar.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/ScrollBar.cc 2006-03-31 00:29:39.000000000 -0500 >@@ -159,14 +159,26 @@ > > void GUI_ScrollBar::SetKnobImage(GUI_Surface *image) > { >- if (GUI_ObjectKeep((GUI_Object **) &knob, image)) >+ GUI_Object* temp; >+ temp = (GUI_Object *)knob; >+ if (GUI_ObjectKeep(&temp, image)){ >+ knob = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ knob = (GUI_Surface *)temp; > } > > void GUI_ScrollBar::SetBackgroundImage(GUI_Surface *image) > { >- if (GUI_ObjectKeep((GUI_Object **) &background, image)) >+ GUI_Object* temp; >+ temp = (GUI_Object *)background; >+ if (GUI_ObjectKeep(&temp, image)){ >+ background = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ background = (GUI_Surface *)temp; > } > > int GUI_ScrollBar::GetPosition(void) >@@ -186,7 +198,10 @@ > > void GUI_ScrollBar::SetMovedCallback(GUI_Callback *callback) > { >- GUI_ObjectKeep((GUI_Object **) &moved_callback, callback); >+ GUI_Object * temp; >+ temp = (GUI_Object *)moved_callback; >+ GUI_ObjectKeep(&temp, callback); >+ moved_callback = (GUI_Callback *)temp; > } > > extern "C" >diff -Naur SDL_gui-0.10.3.old/src/TextEntry.cc SDL_gui-0.10.3/src/TextEntry.cc >--- SDL_gui-0.10.3.old/src/TextEntry.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/TextEntry.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -164,7 +164,10 @@ > > void GUI_TextEntry::SetFont(GUI_Font *afont) > { >- GUI_ObjectKeep((GUI_Object **) &font, afont); >+ GUI_Object * temp; >+ temp = (GUI_Object *)font; >+ GUI_ObjectKeep(&temp, afont); >+ font = (GUI_Font *)temp; > /* FIXME: should re-draw the text in the new color */ > } > >@@ -195,30 +198,54 @@ > > void GUI_TextEntry::SetNormalImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &normal_image, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)normal_image; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ normal_image = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ normal_image = (GUI_Surface *)temp; > } > > void GUI_TextEntry::SetHighlightImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &highlight_image, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)highlight_image; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ highlight_image = (GUI_Surface *)temp; > MarkChanged(); >+ } >+ else >+ highlight_image = (GUI_Surface *)temp; > } > > void GUI_TextEntry::SetFocusImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &focus_image, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)focus_image; >+ if (GUI_ObjectKeep(&temp, surface)){ >+ focus_image = (GUI_Surface*)temp; > MarkChanged(); >+ } >+ else >+ focus_image = (GUI_Surface*)temp; > } > > void GUI_TextEntry::SetFocusCallback(GUI_Callback *callback) > { >- GUI_ObjectKeep((GUI_Object **) &focus_callback, callback); >+ GUI_Object * temp; >+ temp = (GUI_Object *)focus_callback; >+ GUI_ObjectKeep(&temp, callback); >+ focus_callback = (GUI_Callback *)temp; > } > > void GUI_TextEntry::SetUnfocusCallback(GUI_Callback *callback) > { >- GUI_ObjectKeep((GUI_Object **) &unfocus_callback, callback); >+ GUI_Object * temp; >+ temp = (GUI_Object *)unfocus_callback; >+ GUI_ObjectKeep(&temp, callback); >+ unfocus_callback = (GUI_Callback *)temp; > } > > extern "C" >diff -Naur SDL_gui-0.10.3.old/src/ToggleButton.cc SDL_gui-0.10.3/src/ToggleButton.cc >--- SDL_gui-0.10.3.old/src/ToggleButton.cc 2006-03-31 00:28:54.000000000 -0500 >+++ SDL_gui-0.10.3/src/ToggleButton.cc 2006-03-31 00:28:53.000000000 -0500 >@@ -62,26 +62,47 @@ > > void GUI_ToggleButton::SetOnNormalImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &on_normal, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)on_normal; >+ if (GUI_ObjectKeep(&temp, surface)){ > MarkChanged(); >+ } >+ else >+ on_normal = (GUI_Surface *)temp; > } > > void GUI_ToggleButton::SetOffNormalImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &off_normal, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)off_normal; >+ if (GUI_ObjectKeep(&temp, surface)){ > MarkChanged(); >+ } >+ else >+ off_normal = (GUI_Surface *)temp; > } > > void GUI_ToggleButton::SetOnHighlightImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &on_highlight, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)on_highlight; >+ if (GUI_ObjectKeep(&temp, surface)){ > MarkChanged(); >+ } >+ else >+ on_highlight = (GUI_Surface *)temp; >+ > } > > void GUI_ToggleButton::SetOffHighlightImage(GUI_Surface *surface) > { >- if (GUI_ObjectKeep((GUI_Object **) &off_highlight, surface)) >+ GUI_Object * temp; >+ temp = (GUI_Object *)off_highlight; >+ if (GUI_ObjectKeep(&temp, surface)){ > MarkChanged(); >+ } >+ else >+ off_highlight = (GUI_Surface *)temp; > } > > extern "C"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 128200
: 83476 |
83477