Nux

Merge lp:~mc-return/nux/nux.merge-reduce-scope-of-variables.2 into lp:nux

Proposed by MC Return
Status: Merged
Approved by: Michi Henning
Approved revision: 745
Merged at revision: 743
Proposed branch: lp:~mc-return/nux/nux.merge-reduce-scope-of-variables.2
Merge into: lp:nux
Diff against target: 62 lines (+5/-8)
3 files modified
NuxGraphics/IOpenGLSurface.cpp (+1/-2)
NuxGraphics/IOpenGLVolume.cpp (+1/-2)
NuxGraphics/ImageSurface.cpp (+3/-4)
To merge this branch: bzr merge lp:~mc-return/nux/nux.merge-reduce-scope-of-variables.2
Reviewer Review Type Date Requested Status
Michi Henning (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+142400@code.launchpad.net

Commit message

Reduced the scope of various variables.

To post a comment you must log in.
Revision history for this message
Michi Henning (michihenning) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NuxGraphics/IOpenGLSurface.cpp'
2--- NuxGraphics/IOpenGLSurface.cpp 2012-11-12 20:59:56 +0000
3+++ NuxGraphics/IOpenGLSurface.cpp 2013-01-08 20:43:27 +0000
4@@ -319,14 +319,13 @@
5
6 CHECKGL(glPixelStorei(GL_UNPACK_ALIGNMENT, _BaseTexture->GetFormatRowMemoryAlignment()));
7
8- BYTE *DataPtr = 0;
9-
10 #ifndef NUX_OPENGLES_20
11 if (_STextureTarget == GL_TEXTURE_2D || _STextureTarget == GL_TEXTURE_RECTANGLE_ARB || _STextureTarget == GL_TEXTURE_CUBE_MAP || _STextureTarget == GL_TEXTURE_3D)
12 #else
13 if (_STextureTarget == GL_TEXTURE_2D)
14 #endif
15 {
16+ BYTE *DataPtr = 0;
17 int w = _Rect.right - _Rect.left;
18 int h = _Rect.bottom - _Rect.top;
19 CHECKGL(glBindTexture(_STextureTarget, _BaseTexture->_OpenGLID));
20
21=== modified file 'NuxGraphics/IOpenGLVolume.cpp'
22--- NuxGraphics/IOpenGLVolume.cpp 2011-10-19 20:32:38 +0000
23+++ NuxGraphics/IOpenGLVolume.cpp 2013-01-08 20:43:27 +0000
24@@ -272,10 +272,9 @@
25 CHECKGL(glPixelStorei(GL_UNPACK_ALIGNMENT, MemAlignment));
26 nuxAssert(MemAlignment == _VolumeTexture->GetFormatRowMemoryAlignment());
27
28- BYTE *DataPtr = 0;
29-
30 if (_STextureTarget == GL_TEXTURE_3D)
31 {
32+ BYTE *DataPtr = 0;
33 CHECKGL(glBindTexture(_STextureTarget, _VolumeTexture->_OpenGLID));
34
35 if (GetGraphicsDisplay()->GetGpuDevice()->UsePixelBufferObjects())
36
37=== modified file 'NuxGraphics/ImageSurface.cpp'
38--- NuxGraphics/ImageSurface.cpp 2012-10-28 15:59:17 +0000
39+++ NuxGraphics/ImageSurface.cpp 2013-01-08 20:43:27 +0000
40@@ -572,7 +572,6 @@
41 void ImageSurface::FlipVertical()
42 {
43
44- int i, j, k;
45 unsigned char *flip_data;
46
47 if (RawData_ == 0)
48@@ -589,11 +588,11 @@
49 {
50 flip_data = new unsigned char[m_Pitch*height_];
51
52- for (j = 0; j < height_; j++)
53+ for (int j = 0; j < height_; j++)
54 {
55- for (i = 0; i < width_; i++)
56+ for (int i = 0; i < width_; i++)
57 {
58- for (k = 0; k < bpe_; k++)
59+ for (int k = 0; k < bpe_; k++)
60 {
61 flip_data[ (j*m_Pitch) + i *bpe_ + k] = RawData_[ (height_-j-1) *m_Pitch + i * bpe_ + k];
62 }

Subscribers

People subscribed via source and target branches