瀏覽代碼

python: Make swig bindings python independent.

tags/mesa_7_5_rc1
José Fonseca 16 年之前
父節點
當前提交
bb84ce7159
共有 2 個檔案被更改,包括 8 行新增10 行删除
  1. 1
    2
      src/gallium/state_trackers/python/gallium.i
  2. 7
    8
      src/gallium/state_trackers/python/p_texture.i

+ 1
- 2
src/gallium/state_trackers/python/gallium.i 查看文件

@@ -37,7 +37,6 @@
%{

#include <stdio.h>
#include <Python.h>

#include "pipe/p_screen.h"
#include "pipe/p_context.h"
@@ -58,7 +57,7 @@
%}

%include "typemaps.i"
%include "exception.i"
%include "cstring.i"

%include "carrays.i"

+ 7
- 8
src/gallium/state_trackers/python/p_texture.i 查看文件

@@ -347,16 +347,15 @@
assert(p_atomic_read(&$self->reference.count) > 0);
if(offset > $self->size) {
PyErr_SetString(PyExc_ValueError, "offset must be smaller than buffer size");
return;
}
if(offset > $self->size)
SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size");

if(offset + LENGTH > $self->size) {
PyErr_SetString(PyExc_ValueError, "data length must fit inside the buffer");
return;
}
if(offset + LENGTH > $self->size)
SWIG_exception(SWIG_ValueError, "data length must fit inside the buffer");

pipe_buffer_write(screen, $self, offset, LENGTH, STRING);

fail:
return;
}
};

Loading…
取消
儲存