← Back to team overview

touch-packages team mailing list archive

[Bug 1052765] Re: Incorrect cast from int to pointer

 

** Changed in: nux (Ubuntu)
       Status: New => Fix Released

** Changed in: nux (Ubuntu)
   Importance: Undecided => Medium

** Changed in: nux (Ubuntu)
     Assignee: (unassigned) => Jay Taoko (jaytaoko)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to nux in Ubuntu.
https://bugs.launchpad.net/bugs/1052765

Title:
  Incorrect cast from int to pointer

Status in Nux:
  Fix Released
Status in Nux 3.0 series:
  Won't Fix
Status in Nux 4.0 series:
  Fix Released
Status in nux package in Ubuntu:
  Fix Released

Bug description:
  ./GpuDeviceVertex.cpp: In member function 'int nux::GpuDevice::DrawIndexedPrimitive(nux::ObjectPtr<nux::IOpenGLIndexBuff
  er>, nux::ObjectPtr<nux::IOpenGLVertexDeclaration>, nux::PRIMITIVE_TYPE, int)':
  ./GpuDeviceVertex.cpp:158:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

  The code is:

        CHECKGL(glVertexAttribPointer(shader_attribute_location,
          vtxelement.NumComponent,
          vtxelement.Type,
          GL_FALSE,
          vtxelement.stride_,
          (void*)vtxelement.Offset));

  vtxelement.Offset is of type int, so the compiler rightfully complains
  about a cast from a 4-byte int to an 8-byte void*.

  It looks like something is missing here, such as a stream pointer to
  which the offset should be added, but it's not clear to me what the
  correct fix is. But, as it stands, it's certainly incorrect.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nux/+bug/1052765/+subscriptions