pombreda / pgreloaded

Automatically exported from code.google.com/p/pgreloaded
Other
0 stars 0 forks source link

Copy-paste error in pygame2/sdl/rwops.py #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

  @sdltype("SDL_RWFromConstMem", [ctypes.c_void_p, ctypes.c_int],
           ctypes.POINTER(SDL_RWops))
  def rw_from_const_mem(mem, size):
      """Creates a SDL_RWops from a contiguous memory region.

      size denotes the size of the memory region in bytes.
      """
      ptr = ctypes.c_void_p(mem)
      retval = dll.SDL_RWFromMem(ptr, size)
      if retval is None or not bool(retval):
          raise SDLError()
      return retval.contents

should be 

  @sdltype("SDL_RWFromConstMem", [ctypes.c_void_p, ctypes.c_int],
           ctypes.POINTER(SDL_RWops))
  def rw_from_const_mem(mem, size):
      """Creates a SDL_RWops from a contiguous memory region.
      It assumes the memory area is not writable.

      size denotes the size of the memory region in bytes.
      """
      ptr = ctypes.c_void_p(mem)
      retval = dll.SDL_RWFromConstMem(ptr, size)
      if retval is None or not bool(retval):
          raise SDLError()
      return retval.contents

Sorry, can't attach a patch right now.

Original issue reported on code.google.com by llxxn...@gmail.com on 19 Nov 2012 at 8:55

GoogleCodeExporter commented 9 years ago
Fixed in revision 576f97128d46, thanks!

Original comment by marcusvonappen@googlemail.com on 20 Nov 2012 at 7:00