diff --git a/src/ep_bitmap.c b/src/ep_bitmap.c index 9f99ac6..4f4f3a6 100755 --- a/src/ep_bitmap.c +++ b/src/ep_bitmap.c @@ -1,6 +1,7 @@ #include #define PY_SSIZE_T_CLEAN #include +#include "scode.h" #include "gfxobj.h" #include "bitmap.h" #include "ep_types.h" @@ -48,7 +49,7 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds) width = MAX(1, width); height = MAX(1, height); self->pbmp = BMP_Create(width, height, NULL); - if (!(self->bmp)) + if (!(self->pbmp)) { PyErr_SetString(PyExc_RuntimeError, "unable to create bitmap"); return -1; diff --git a/src/ep_devctxt.c b/src/ep_devctxt.c index 09c0687..1300692 100755 --- a/src/ep_devctxt.c +++ b/src/ep_devctxt.c @@ -165,14 +165,12 @@ static PyObject *devctxt_select_bitmap(DevCtxtObject *self, BitmapObject *newbmp Py_DECREF(self->selected_bitmap); self->selected_bitmap = newbmp; Py_INCREF(self->selected_bitmap); - return old_bitmap; + return (PyObject *)old_bitmap; } static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args) { PyObject *obj; - PBITMAP old_bitmap; - BitmapObject *old_bmp_object, *new_bmp_object; if (!PyArg_ParseTuple(args, "O", &obj)) return NULL;