hackathon-dev #1

Merged
amy merged 101 commits from hackathon-dev into develop 2019-12-12 13:56:11 -07:00
2 changed files with 3 additions and 4 deletions
Showing only changes of commit 864360f9fa - Show all commits

View File

@ -1,6 +1,7 @@
#include <string.h> #include <string.h>
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
#include <Python.h> #include <Python.h>
#include "scode.h"
#include "gfxobj.h" #include "gfxobj.h"
#include "bitmap.h" #include "bitmap.h"
#include "ep_types.h" #include "ep_types.h"
@ -48,7 +49,7 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds)
width = MAX(1, width); width = MAX(1, width);
height = MAX(1, height); height = MAX(1, height);
self->pbmp = BMP_Create(width, height, NULL); self->pbmp = BMP_Create(width, height, NULL);
if (!(self->bmp)) if (!(self->pbmp))
{ {
PyErr_SetString(PyExc_RuntimeError, "unable to create bitmap"); PyErr_SetString(PyExc_RuntimeError, "unable to create bitmap");
return -1; return -1;

View File

@ -165,14 +165,12 @@ static PyObject *devctxt_select_bitmap(DevCtxtObject *self, BitmapObject *newbmp
Py_DECREF(self->selected_bitmap); Py_DECREF(self->selected_bitmap);
self->selected_bitmap = newbmp; self->selected_bitmap = newbmp;
Py_INCREF(self->selected_bitmap); Py_INCREF(self->selected_bitmap);
return old_bitmap; return (PyObject *)old_bitmap;
} }
static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args) static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args)
{ {
PyObject *obj; PyObject *obj;
PBITMAP old_bitmap;
BitmapObject *old_bmp_object, *new_bmp_object;
if (!PyArg_ParseTuple(args, "O", &obj)) if (!PyArg_ParseTuple(args, "O", &obj))
return NULL; return NULL;