Bug 91699 - KSnake: address of temporary
Summary: KSnake: address of temporary
Status: RESOLVED FIXED
Alias: None
Product: ksnake
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Andrew Chant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-19 18:34 UTC by Marcin Garski
Modified: 2004-11-04 21:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Garski 2004-10-19 18:34:34 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

In rattler.cpp there is line:

bitBlt(this, 0, 0, &pix->levelPix(), 0, 0, rect().width(), rect().height());

During compile compiler said:
warning: taking address of temporary

Suggested resolution (taken from http://kde.gnusoft.net/3.1.4/AIX/patches/kdegames-3.1.4-xlc.patch):

QPixmap levelPix = pix->levelPix();
bitBlt(this, 0, 0, &levelPix, 0, 0, rect().width(), rect().height());
Comment 1 Albert Astals Cid 2004-11-04 21:39:34 UTC
CVS commit by aacid: 

One warning less
BUG: 91699


  M +2 -1      rattler.cpp   1.47


--- kdegames/ksnake/rattler.cpp  #1.46:1.47
@@ -158,5 +158,6 @@ void Rattler::timerEvent( QTimerEvent * 
                 levelUp();
 
-        bitBlt(this, 0, 0, &pix->levelPix(), 0, 0, rect().width(), rect().height());
+        QPixmap levelPix = pix->levelPix();
+        bitBlt(this, 0, 0, &levelPix, 0, 0, rect().width(), rect().height());
 }