[Skencil-commits] r686 - in skencil/branches/skencil-0.6: . Filter Pax Pax/Generate Sketch/Modules
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Jun 13 23:56:11 CEST 2006
Author: bh
Date: 2006-06-13 23:56:09 +0200 (Tue, 13 Jun 2006)
New Revision: 686
Modified:
skencil/branches/skencil-0.6/ChangeLog
skencil/branches/skencil-0.6/Filter/binfile.c
skencil/branches/skencil-0.6/Filter/filterobj.c
skencil/branches/skencil-0.6/Filter/subfilefilter.c
skencil/branches/skencil-0.6/Filter/zlibfilter.c
skencil/branches/skencil-0.6/Pax/Generate/typedefs.py
skencil/branches/skencil-0.6/Pax/borderobject.c
skencil/branches/skencil-0.6/Pax/cmapobject.c
skencil/branches/skencil-0.6/Pax/fontobject.c
skencil/branches/skencil-0.6/Pax/gcmethods.c
skencil/branches/skencil-0.6/Pax/gcobject.c
skencil/branches/skencil-0.6/Pax/imageobject.c
skencil/branches/skencil-0.6/Pax/paxtkinter.c
skencil/branches/skencil-0.6/Pax/paxutil.c
skencil/branches/skencil-0.6/Pax/pixmapobject.c
skencil/branches/skencil-0.6/Pax/regionobject.c
skencil/branches/skencil-0.6/Pax/tkwinobject.c
skencil/branches/skencil-0.6/Sketch/Modules/curveobject.c
skencil/branches/skencil-0.6/Sketch/Modules/pstokenize.c
skencil/branches/skencil-0.6/Sketch/Modules/skaux.c
skencil/branches/skencil-0.6/Sketch/Modules/skcolor.c
skencil/branches/skencil-0.6/Sketch/Modules/skdither.c
skencil/branches/skencil-0.6/Sketch/Modules/skfm.c
skencil/branches/skencil-0.6/Sketch/Modules/skpoint.c
skencil/branches/skencil-0.6/Sketch/Modules/skrect.c
skencil/branches/skencil-0.6/Sketch/Modules/sktrafo.c
Log:
Use Python memory allocation API correctly so that e.g. memory
allocated by PyObject_New is deallocated by PyObject_Del. Also,
use the function based API instead of the macros.
Modified: skencil/branches/skencil-0.6/ChangeLog
===================================================================
--- skencil/branches/skencil-0.6/ChangeLog 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/ChangeLog 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,3 +1,47 @@
+2006-06-13 Bernhard Herzog <bh at intevation.de>
+
+ * Sketch/Modules/sktrafo.c (SKTrafo_FromDouble, sktrafo_dealloc),
+ Sketch/Modules/skrect.c (fill_free_list, SKRect_FromDouble),
+ (skrect_dealloc),
+ Sketch/Modules/skpoint.c (SKPoint_FromXY, skpoint_dealloc),
+ Sketch/Modules/skfm.c (SKFontMetric_New, skfm_dealloc),
+ Sketch/Modules/skdither.c (skvisual_init_dither),
+ Sketch/Modules/skcolor.c (fill_free_list, SKColor_FromRGB)
+ (skcolor_dealloc, skvisual_pseudocolor_free)
+ (SKVisual_FromXVisualInfo, skvisual_dealloc),
+ Sketch/Modules/skaux.c (SKCache_New, SKCache_dealloc),
+ Sketch/Modules/pstokenize.c (PSTokenizer_FromStream)
+ (pstokenizer_dealloc),
+ Sketch/Modules/curveobject.c (SKCurve_New, curve_dealloc),
+ Pax/tkwinobject.c (TkWin_FromTkWindow, tkwin_dealloc)
+ (tkwin_CreateImage, tkwin_ShmCreateImage, try_shm_image)
+ (tkwin_PolygonRegion),
+ Pax/regionobject.c (PaxRegion_FromRegion, region_dealloc),
+ Pax/pixmapobject.c (pixmap_dealloc, PaxPixmap_FromPixmap),
+ Pax/paxutil.c (pax_checkshortlist),
+ Pax/paxtkinter.c (Tkapp_New, PythonCmdDelete)
+ (Tkapp_CreateCommand, NewFHCD, DeleteFHCD, Tktt_New)
+ (Tktt_Dealloc, Tkapp_Dealloc),
+ Pax/imageobject.c (image_dealloc, PaxImage_FromImage),
+ Pax/gcobject.c (pax_checkcharlist, PaxGC_FromGC)
+ (PaxGC_SetDashes, Dealloc),
+ Pax/fontobject.c (PaxFont_FromName, PaxFont_FromFont, Dealloc),
+ Pax/cmapobject.c (paxcm_AllocColorCells, paxcm_StoreColors)
+ (paxcm_QueryColors, paxcm_FreeColors, paxcm_dealloc)
+ (PaxCMap_FromColormap),
+ Pax/borderobject.c (PaxBorder_FromTkBorder, paxborder_dealloc)
+ (paxborder_Draw3DPolygon, paxborder_Fill3DPolygon),
+ Pax/Generate/typedefs.py (typedefs),
+ Filter/zlibfilter.c (dealloc_zlib, Filter_FlateDecode),
+ Filter/subfilefilter.c (dealloc_subfile, Filter_SubFileDecode),
+ Filter/filterobj.c (new_filter, filter_dealloc),
+ Filter/binfile.c (binfile_dealloc, BinFile_FromStream):
+ Use Python memory allocation API correctly so that e.g. memory
+ allocated by PyObject_New is deallocated by PyObject_Del. Also,
+ use the function based API instead of the macros.
+
+ * Pax/gcmethods.c: Regenerated
+
2006-06-05 Bernhard Herzog <bh at intevation.de>
Add the docbook version of the documentation.
Modified: skencil/branches/skencil-0.6/Filter/binfile.c
===================================================================
--- skencil/branches/skencil-0.6/Filter/binfile.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Filter/binfile.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999, 2001 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2001, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -277,7 +277,7 @@
binfile_dealloc(BinaryInputObject * self)
{
Py_DECREF(self->stream);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
@@ -650,7 +650,7 @@
return NULL;
}
- binfile = PyObject_NEW(BinaryInputObject, &BinaryInputType);
+ binfile = PyObject_New(BinaryInputObject, &BinaryInputType);
if (!binfile)
return NULL;
Modified: skencil/branches/skencil-0.6/Filter/filterobj.c
===================================================================
--- skencil/branches/skencil-0.6/Filter/filterobj.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Filter/filterobj.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999, 2001 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2001, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -118,15 +118,15 @@
{
FilterObject * self;
- self = PyObject_NEW(FilterObject, &FilterType);
+ self = PyObject_New(FilterObject, &FilterType);
if (!self)
return NULL;
- self->buffer = PyMem_NEW(char, FILTER_BUFSIZE + 1);
+ self->buffer = PyMem_Malloc(FILTER_BUFSIZE + 1);
if (!self->buffer)
{
error:
- PyMem_DEL(self);
+ PyObject_Del(self);
PyErr_NoMemory();
if (dealloc)
dealloc(client_data);
@@ -136,7 +136,7 @@
self->filtername = PyString_FromString(name);
if (!self->filtername)
{
- PyMem_DEL(self->buffer);
+ PyMem_Free(self->buffer);
goto error;
}
@@ -215,8 +215,8 @@
self->dealloc(self->client_data);
Py_DECREF(self->filtername);
Py_DECREF(self->stream);
- PyMem_DEL(self->buffer);
- PyMem_DEL(self);
+ PyMem_Free(self->buffer);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/branches/skencil-0.6/Filter/subfilefilter.c
===================================================================
--- skencil/branches/skencil-0.6/Filter/subfilefilter.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Filter/subfilefilter.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -90,7 +90,7 @@
{
SubFileDecodeState * state = (SubFileDecodeState*)clientdata;
Py_DECREF(state->delim_object);
- PyMem_DEL(state);
+ PyMem_Free(state);
}
static void
@@ -119,7 +119,7 @@
length = PyString_Size(delim_object);
if (length < 1)
return PyErr_Format(PyExc_ValueError, "empty delimiter");
- state = malloc(sizeof (SubFileDecodeState) + length * sizeof(int));
+ state = PyMem_Malloc(sizeof (SubFileDecodeState) + length * sizeof(int));
if (!state)
return PyErr_NoMemory();
state->delim_object = delim_object;
Modified: skencil/branches/skencil-0.6/Filter/zlibfilter.c
===================================================================
--- skencil/branches/skencil-0.6/Filter/zlibfilter.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Filter/zlibfilter.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999, 2000 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2000, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -82,7 +82,8 @@
{
FlateDecodeState * state = (FlateDecodeState*)clientdata;
inflateEnd(&state->zstr); /* XXX error handling */
- PyMem_DEL(state);
+ PyMem_Free(state->buffer);
+ PyMem_Free(state);
}
@@ -96,13 +97,13 @@
if (!PyArg_ParseTuple(args, "O", &target))
return NULL;
- state = PyMem_NEW(FlateDecodeState, 1);
+ state = PyMem_Malloc(sizeof(FlateDecodeState));
if (!state)
return PyErr_NoMemory();
- state->buffer = PyMem_NEW(char, INBUFSIZE);
+ state->buffer = PyMem_Malloc(INBUFSIZE);
if (!state->buffer)
{
- PyMem_DEL(state);
+ PyMem_Free(state);
return PyErr_NoMemory();
}
@@ -132,8 +133,8 @@
"FlateDecode: Zlib Error %i: %.200s",
result, state->zstr.msg);
}
- PyMem_DEL(state->buffer);
- PyMem_DEL(state);
+ PyMem_Free(state->buffer);
+ PyMem_Free(state);
return NULL;
}
Modified: skencil/branches/skencil-0.6/Pax/Generate/typedefs.py
===================================================================
--- skencil/branches/skencil-0.6/Pax/Generate/typedefs.py 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/Generate/typedefs.py 2006-06-13 21:56:09 UTC (rev 686)
@@ -24,7 +24,7 @@
'intlist': ('O',
'PyObject *%(arg)s; int *ints_%(arg)s; int nints_%(arg)s',
'checkintlist(%(arg)s, sizeof(int), &ints_%(arg)s, &nints_%(arg)s)',
- 'ints_%(arg)s, nints_%(arg)s', '', 'PyMem_DEL(ints_%(arg)s)'),
+ 'ints_%(arg)s, nints_%(arg)s', '', 'PyMem_Free(ints_%(arg)s)'),
'long': ('l', 'long %(arg)s', '', '', 'PyInt_FromLong(%(arg)s)'),
'unsigned int': ('i', 'unsigned int %(arg)s', '', '',
'PyInt_FromLong((long)%(arg)s)'),
@@ -38,7 +38,7 @@
'PyObject *%(arg)s; Atom *atoms_%(arg)s; int natoms_%(arg)s',
'checkintlist(%(arg)s, sizeof(Atom), &atoms_%(arg)s, &natoms_%(arg)s)',
'atoms_%(arg)s, natoms_%(arg)s', '',
- 'PyMem_DEL(atoms_%(arg)s)'),
+ 'PyMem_Free(atoms_%(arg)s)'),
'Bool': ('i', 'int %(arg)s', '', '(Bool)%(arg)s',
'PyInt_FromLong((long)%(arg)s)'),
'Boolean': ('i', 'int %(arg)s', '', '(Boolean)%(arg)s',
@@ -90,7 +90,7 @@
'PyObject *%(arg)s; XmString *tmp_%(arg)s; int nstrs_%(arg)s',
'checkxmstringlist(%(arg)s, &tmp_%(arg)s, &nstrs_%(arg)s)',
'tmp_%(arg)s, nstrs_%(arg)s', '',
- 'while (--nstrs_%(arg)s >= 0) XmStringFree(tmp_%(arg)s[nstrs_%(arg)s]); PyMem_DEL(tmp_%(arg)s)'),
+ 'while (--nstrs_%(arg)s >= 0) XmStringFree(tmp_%(arg)s[nstrs_%(arg)s]); PyMem_Free(tmp_%(arg)s)'),
'XmTextDirection': ('l', 'XmTextDirection %(arg)s', '', '',
'PyInt_FromLong((long)%(arg)s)'),
'XmTextPosition': ('l', 'XmTextPosition %(arg)s', '', '',
@@ -121,11 +121,11 @@
'argdict': ('O',
'PyObject *%(arg)s, *dict; ArgList tmp_%(arg)s; int nargs_%(arg)s',
'(dict = checkargdict(wClist, sizeof(wClist)/sizeof(wClist[0]), %(w)s, %(arg)s, &tmp_%(arg)s, &nargs_%(arg)s))',
- 'tmp_%(arg)s, nargs_%(arg)s', '', 'PyMem_DEL(tmp_%(arg)s)'),
+ 'tmp_%(arg)s, nargs_%(arg)s', '', 'PyMem_Free(tmp_%(arg)s)'),
'stringlist': ('O',
'PyObject *%(arg)s; char **tmp_%(arg)s; int nstrs_%(arg)s',
'checkstringlist(%(arg)s, &tmp_%(arg)s, &nstrs_%(arg)s)',
- 'tmp_%(arg)s, nstrs_%(arg)s', '', 'PyMem_DEL(tmp_%(arg)s)'),
+ 'tmp_%(arg)s, nstrs_%(arg)s', '', 'PyMem_Free(tmp_%(arg)s)'),
'cbfunc': ('O', 'PyObject *%(arg)s, *cbfunc', 'cbfunc = %(arg)s;',
'univ_callback', ''),
'cbarg': ('O', 'PyObject *%(arg)s, *cbarg',
@@ -154,20 +154,20 @@
'XPoint[]': ('O',
'PyObject *%(arg)s; XPoint *pts_%(arg)s; int npts_%(arg)s',
'checkshortlist(2, %(arg)s, (short**)&pts_%(arg)s, &npts_%(arg)s)',
- 'pts_%(arg)s, npts_%(arg)s', '', 'PyMem_DEL(pts_%(arg)s)'),
+ 'pts_%(arg)s, npts_%(arg)s', '', 'PyMem_Free(pts_%(arg)s)'),
'XSegment[]': ('O',
'PyObject *%(arg)s; XSegment *segs_%(arg)s; int nsegs_%(arg)s',
'checkshortlist(4, %(arg)s, (short**)&segs_%(arg)s, &nsegs_%(arg)s)',
- 'segs_%(arg)s, nsegs_%(arg)s', '', 'PyMem_DEL(segs_%(arg)s)'),
+ 'segs_%(arg)s, nsegs_%(arg)s', '', 'PyMem_Free(segs_%(arg)s)'),
'XRectangle[]': ('O',
'PyObject *%(arg)s; XRectangle *rects_%(arg)s; int nrects_%(arg)s',
'checkshortlist(4, %(arg)s, (short**)&rects_%(arg)s, &nrects_%(arg)s)',
'rects_%(arg)s, nrects_%(arg)s', '',
- 'PyMem_DEL(rects_%(arg)s)'),
+ 'PyMem_Free(rects_%(arg)s)'),
'XArc[]': ('O',
'PyObject *%(arg)s; XArc *arcs_%(arg)s; int narcs_%(arg)s',
'checkshortlist(6, %(arg)s, (short**)&arcs_%(arg)s, &narcs_%(arg)s)',
- 'arcs_%(arg)s, narcs_%(arg)s', '', 'PyMem_DEL(arcs_%(arg)s)'),
+ 'arcs_%(arg)s, narcs_%(arg)s', '', 'PyMem_Free(arcs_%(arg)s)'),
'XGCValues#': ('O',
'PyObject *%(arg)s; unsigned long mask; XGCValues values',
'PaxGC_MakeValues(%(arg)s, &mask, &values)',
Modified: skencil/branches/skencil-0.6/Pax/borderobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/borderobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/borderobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -15,7 +15,7 @@
{
PaxBorderObject * self;
- self = PyObject_NEW(PaxBorderObject, &PaxBorderType);
+ self = PyObject_New(PaxBorderObject, &PaxBorderType);
if (!self)
return NULL;
@@ -40,7 +40,7 @@
{
Tk_Free3DBorder(self->tkborder);
}
- PyMem_DEL(self);
+ PyObject_Del(self);
}
/* a converter function suitable for PyArg_ParseTuple */
@@ -115,7 +115,7 @@
Tk_Draw3DPolygon(self->tkwin, drawable, self->tkborder, points, npoints,
border_width, left_relief);
- PyMem_DEL(points);
+ PyMem_Free(points);
Py_INCREF(Py_None);
return Py_None;
@@ -142,7 +142,7 @@
Tk_Fill3DPolygon(self->tkwin, drawable, self->tkborder, points, npoints,
border_width, left_relief);
- PyMem_DEL(points);
+ PyMem_Free(points);
Py_INCREF(Py_None);
return Py_None;
Modified: skencil/branches/skencil-0.6/Pax/cmapobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/cmapobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/cmapobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -25,22 +25,22 @@
PyErr_BadArgument();
return NULL;
}
- plane_masks = PyMem_NEW(unsigned long, nplanes);
- pixels = PyMem_NEW(unsigned long, npixels);
+ plane_masks = PyMem_Malloc(sizeof(unsigned long) * nplanes);
+ pixels = PyMem_Malloc(sizeof(unsigned long) * npixels);
if (plane_masks == NULL || pixels == NULL)
{
if (plane_masks)
- PyMem_DEL(plane_masks);
+ PyMem_Free(plane_masks);
if (pixels)
- PyMem_DEL(pixels);
+ PyMem_Free(pixels);
return PyErr_NoMemory();
}
if (!XAllocColorCells(self->display, self->colormap, contig,
plane_masks, nplanes, pixels, npixels))
{
PyErr_SetString(PyExc_RuntimeError, "XAllocColorCells failed");
- PyMem_DEL(plane_masks);
- PyMem_DEL(pixels);
+ PyMem_Free(plane_masks);
+ PyMem_Free(pixels);
return NULL;
}
@@ -50,8 +50,8 @@
res2 = PyList_New(npixels);
for (i = 0; i < npixels; i++)
PyList_SetItem(res2, i, PyInt_FromLong(pixels[i]));
- PyMem_DEL(plane_masks);
- PyMem_DEL(pixels);
+ PyMem_Free(plane_masks);
+ PyMem_Free(pixels);
if (PyErr_Occurred())
{
Py_XDECREF(res1);
@@ -77,7 +77,7 @@
if (!PyArg_ParseTuple(args, "O!", &PyList_Type, &colorlist))
return NULL;
ncolors = PyList_Size(colorlist);
- color = PyMem_NEW(XColor, ncolors);
+ color = PyMem_Malloc(sizeof(XColor) * ncolors);
if (color == NULL)
return PyErr_NoMemory();
for (i = 0; i < ncolors; i++)
@@ -85,7 +85,7 @@
item = PyList_GetItem(colorlist, i);
if (!PyTuple_Check(item) || PyTuple_Size(item) != 5)
{
- PyMem_DEL(color);
+ PyMem_Free(color);
PyErr_BadArgument();
return NULL;
}
@@ -96,7 +96,7 @@
if (!PyArg_ParseTuple(item, "liiib", &color[i].pixel,
&red, &green, &blue, &color[i].flags))
{
- PyMem_DEL(color);
+ PyMem_Free(color);
return NULL;
}
color[i].red = red;
@@ -106,7 +106,7 @@
XStoreColors(self->display, self->colormap, color, ncolors);
- PyMem_DEL(color);
+ PyMem_Free(color);
if (PyErr_Occurred())
return NULL;
Py_INCREF(Py_None);
@@ -189,7 +189,7 @@
return NULL;
npixels = PyList_Size(pixels);
- defs = PyMem_NEW(XColor, npixels);
+ defs = PyMem_Malloc(sizeof(XColor) * npixels);
if (defs == NULL)
return PyErr_NoMemory();
@@ -221,7 +221,7 @@
}
}
done:
- PyMem_DEL(defs);
+ PyMem_Free(defs);
return list;
}
@@ -277,7 +277,7 @@
if (!PyArg_ParseTuple(args, "O!l", &PyList_Type, &pixellist, &planes))
return NULL;
npixels = PyList_Size(pixellist);
- pixels = PyMem_NEW(unsigned long, npixels);
+ pixels = PyMem_Malloc(sizeof(unsigned long) * npixels);
if (pixels == NULL)
return PyErr_NoMemory();
for (i = 0; i < npixels; i++)
@@ -285,7 +285,7 @@
item = PyList_GetItem(pixellist, i);
if (!PyInt_Check(item))
{
- PyMem_DEL(pixels);
+ PyMem_Free(pixels);
PyErr_BadArgument();
return NULL;
}
@@ -294,7 +294,7 @@
XFreeColors(self->display, self->colormap, pixels, npixels, planes);
- PyMem_DEL(pixels);
+ PyMem_Free(pixels);
if (PyErr_Occurred())
return NULL;
Py_INCREF(Py_None);
@@ -345,7 +345,7 @@
if (self->owner)
XFreeColormap(self->display, self->colormap);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
PyTypeObject PaxCMapType = {
@@ -369,7 +369,7 @@
PyObject *
PaxCMap_FromColormap(Colormap colormap, Display *display, int owner)
{
- PaxCMapObject *obj = PyObject_NEW(PaxCMapObject, &PaxCMapType);
+ PaxCMapObject *obj = PyObject_New(PaxCMapObject, &PaxCMapType);
if (obj == NULL)
return NULL;
obj->colormap = colormap;
Modified: skencil/branches/skencil-0.6/Pax/fontobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/fontobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/fontobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -61,7 +61,7 @@
PyObject *
PaxFont_FromName(Display *display, char *name)
{
- PaxFontObject *f = PyObject_NEW(PaxFontObject, &PaxFontType);
+ PaxFontObject *f = PyObject_New(PaxFontObject, &PaxFontType);
if (f == NULL)
return NULL;
f->from_id = 0;
@@ -69,7 +69,7 @@
f->font_struct = XLoadQueryFont(display, name);
if (f->font_struct == NULL)
{
- PyMem_DEL(f);
+ PyObject_Del(f);
PyErr_SetString(PyExc_RuntimeError, "no such font");
return NULL;
}
@@ -79,7 +79,7 @@
PyObject *
PaxFont_FromFont(Display *display, Font fid)
{
- PaxFontObject *f = PyObject_NEW(PaxFontObject, &PaxFontType);
+ PaxFontObject *f = PyObject_New(PaxFontObject, &PaxFontType);
if (f == NULL)
return NULL;
f->from_id = 1;
@@ -87,7 +87,7 @@
f->font_struct = XQueryFont(display, fid);
if (f->font_struct == NULL)
{
- PyMem_DEL(f);
+ PyObject_Del(f);
PyErr_SetString(PyExc_RuntimeError, "no such font");
return NULL;
}
@@ -269,7 +269,7 @@
XFreeFontInfo(NULL, self->font_struct, 1);
else
XFreeFont(self->display, self->font_struct);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
PyTypeObject PaxFontType = {
Modified: skencil/branches/skencil-0.6/Pax/gcmethods.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/gcmethods.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/gcmethods.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -45,7 +45,7 @@
}
XDrawArcs(self->display, self->drawable, self->gc,
arcs_arg1, narcs_arg1);
- PyMem_DEL(arcs_arg1);
+ PyMem_Free(arcs_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -113,7 +113,7 @@
XDrawLines(self->display, self->drawable, self->gc,
pts_arg1, npts_arg1,
arg2);
- PyMem_DEL(pts_arg1);
+ PyMem_Free(pts_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -151,7 +151,7 @@
XDrawPoints(self->display, self->drawable, self->gc,
pts_arg1, npts_arg1,
arg2);
- PyMem_DEL(pts_arg1);
+ PyMem_Free(pts_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -192,7 +192,7 @@
}
XDrawRectangles(self->display, self->drawable, self->gc,
rects_arg1, nrects_arg1);
- PyMem_DEL(rects_arg1);
+ PyMem_Free(rects_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -211,7 +211,7 @@
}
XDrawSegments(self->display, self->drawable, self->gc,
segs_arg1, nsegs_arg1);
- PyMem_DEL(segs_arg1);
+ PyMem_Free(segs_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -282,7 +282,7 @@
}
XFillArcs(self->display, self->drawable, self->gc,
arcs_arg1, narcs_arg1);
- PyMem_DEL(arcs_arg1);
+ PyMem_Free(arcs_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -307,7 +307,7 @@
pts_arg1, npts_arg1,
arg2,
arg3);
- PyMem_DEL(pts_arg1);
+ PyMem_Free(pts_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -348,7 +348,7 @@
}
XFillRectangles(self->display, self->drawable, self->gc,
rects_arg1, nrects_arg1);
- PyMem_DEL(rects_arg1);
+ PyMem_Free(rects_arg1);
Py_INCREF(Py_None);
return Py_None;
}
@@ -492,7 +492,7 @@
arg2,
rects_arg3, nrects_arg3,
arg4);
- PyMem_DEL(rects_arg3);
+ PyMem_Free(rects_arg3);
Py_INCREF(Py_None);
return Py_None;
}
Modified: skencil/branches/skencil-0.6/Pax/gcobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/gcobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/gcobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -140,7 +140,7 @@
n = PyList_Size(list);
*pnitems = n;
- *parray = PyMem_NEW(char, n);
+ *parray = PyMem_Malloc(n);
if (*parray == NULL)
{
PyErr_NoMemory();
@@ -152,7 +152,7 @@
PyObject *item = PyList_GetItem(list, i);
if (!PyInt_Check(item))
{
- PyMem_DEL(*parray);
+ PyMem_Free(*parray);
PyErr_SetString(PyExc_TypeError, "list of ints expected");
return 0;
}
@@ -180,7 +180,7 @@
PaxGC_FromGC(Display *display, Drawable drawable, GC gc, int shared,
PyObject * drawable_object)
{
- PaxGCObject *gp = PyObject_NEW(PaxGCObject, &PaxGCType);
+ PaxGCObject *gp = PyObject_New(PaxGCObject, &PaxGCType);
if (gp == NULL)
return NULL;
gp->display = display;
@@ -241,7 +241,7 @@
return NULL;
XSetDashes(self->display, self->gc, dash_offset, dashes, num_dashes);
- PyMem_DEL(dashes);
+ PyMem_Free(dashes);
Py_INCREF(Py_None);
return Py_None;
@@ -478,7 +478,7 @@
else if (self->shared == PAXGC_OWNED)
XFreeGC(self->display, self->gc);
Py_XDECREF(self->drawable_object);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
PyTypeObject PaxGCType =
Modified: skencil/branches/skencil-0.6/Pax/imageobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/imageobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/imageobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -159,7 +159,7 @@
#endif
XDestroyImage(self->ximage);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
PyTypeObject PaxImageType = {
@@ -193,7 +193,7 @@
PyObject *
PaxImage_FromImage(XImage *ximage)
{
- PaxImageObject *self = PyObject_NEW(PaxImageObject, &PaxImageType);
+ PaxImageObject *self = PyObject_New(PaxImageObject, &PaxImageType);
if (self == NULL)
return NULL;
Modified: skencil/branches/skencil-0.6/Pax/paxtkinter.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/paxtkinter.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/paxtkinter.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -504,7 +504,7 @@
TkappObject *v;
char *argv0;
- v = PyObject_NEW(TkappObject, &Tkapp_Type);
+ v = PyObject_New(TkappObject, &Tkapp_Type);
if (v == NULL)
return NULL;
@@ -1201,7 +1201,7 @@
ENTER_PYTHON
Py_XDECREF(data->self);
Py_XDECREF(data->func);
- PyMem_DEL(data);
+ PyMem_Free(data);
LEAVE_PYTHON
}
@@ -1222,7 +1222,7 @@
return NULL;
}
- data = PyMem_NEW(PythonCmd_ClientData, 1);
+ data = PyMem_Malloc(sizeof(PythonCmd_ClientData));
if (!data)
return NULL;
Py_XINCREF(self);
@@ -1236,7 +1236,7 @@
LEAVE_TCL
if (err == NULL) {
PyErr_SetString(Tkinter_TclError, "can't create Tcl command");
- PyMem_DEL(data);
+ PyMem_Free(data);
return NULL;
}
@@ -1283,7 +1283,7 @@
NewFHCD(PyObject *func, PyObject *file, int id)
{
FileHandler_ClientData *p;
- p = PyMem_NEW(FileHandler_ClientData, 1);
+ p = PyMem_Malloc(sizeof(FileHandler_ClientData));
if (p != NULL) {
Py_XINCREF(func);
Py_XINCREF(file);
@@ -1307,7 +1307,7 @@
*pp = p->next;
Py_XDECREF(p->func);
Py_XDECREF(p->file);
- PyMem_DEL(p);
+ PyMem_Free(p);
}
else
pp = &p->next;
@@ -1478,7 +1478,7 @@
{
TkttObject *v;
- v = PyObject_NEW(TkttObject, &Tktt_Type);
+ v = PyObject_New(TkttObject, &Tktt_Type);
if (v == NULL)
return NULL;
@@ -1499,7 +1499,7 @@
Py_XDECREF(func);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
@@ -1825,7 +1825,7 @@
ENTER_TCL
Tcl_DeleteInterp(Tkapp_Interp(self));
LEAVE_TCL
- PyMem_DEL(self);
+ PyObject_Del(self);
DisableEventHook();
}
Modified: skencil/branches/skencil-0.6/Pax/paxutil.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/paxutil.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/paxutil.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -12,7 +12,7 @@
}
n = PyList_Size(list);
*pnitems = n;
- *parray = PyMem_NEW(short, n*width);
+ *parray = PyMem_Malloc(sizeof(short) * n*width);
if (*parray == NULL)
{
PyErr_NoMemory();
@@ -25,7 +25,7 @@
if (!PyTuple_Check(item) || PyTuple_Size(item) != width)
{
char buf[100];
- PyMem_DEL(*parray);
+ PyMem_Free(*parray);
sprintf(buf, "list of %d-tuples expected", width);
PyErr_SetString(PyExc_TypeError, buf);
return 0;
@@ -35,7 +35,7 @@
PyObject *elem = PyTuple_GetItem(item, j);
if (!PyInt_Check(elem))
{
- PyMem_DEL(*parray);
+ PyMem_Free(*parray);
PyErr_SetString(PyExc_TypeError,
"list of tuples of ints expected");
return 0;
Modified: skencil/branches/skencil-0.6/Pax/pixmapobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/pixmapobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/pixmapobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -381,7 +381,7 @@
{
if (self->owner)
XFreePixmap(self->display, self->pixmap);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
PyTypeObject PaxPixmapType = {
@@ -405,7 +405,7 @@
PyObject *
PaxPixmap_FromPixmap(Display *display, Pixmap pixmap, int owner)
{
- PaxPixmapObject *p = PyObject_NEW(PaxPixmapObject, &PaxPixmapType);
+ PaxPixmapObject *p = PyObject_New(PaxPixmapObject, &PaxPixmapType);
if (p == NULL)
return NULL;
p->display = display;
Modified: skencil/branches/skencil-0.6/Pax/regionobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/regionobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/regionobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -8,7 +8,7 @@
PaxRegion_FromRegion(Region region)
{
PaxRegionObject *self;
- self = PyObject_NEW(PaxRegionObject, &PaxRegionType);
+ self = PyObject_New(PaxRegionObject, &PaxRegionType);
if (self == NULL)
return NULL;
self->region = region;
@@ -178,7 +178,7 @@
region_dealloc(PaxRegionObject *self)
{
XDestroyRegion(self->region);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
Modified: skencil/branches/skencil-0.6/Pax/tkwinobject.c
===================================================================
--- skencil/branches/skencil-0.6/Pax/tkwinobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Pax/tkwinobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -15,7 +15,7 @@
{
TkWinObject * self;
- self = PyObject_NEW(TkWinObject, &TkWinType);
+ self = PyObject_New(TkWinObject, &TkWinType);
if (self == NULL)
return NULL;
@@ -47,7 +47,7 @@
static void
tkwin_dealloc(TkWinObject * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
}
@@ -353,7 +353,7 @@
&data, &datalength, &width, &height, &bitmap_pad,
&bytes_per_line))
return NULL;
- newdata = PyMem_NEW(char, bytes_per_line * height);
+ newdata = PyMem_Malloc(bytes_per_line * height);
if (newdata == NULL)
return PyErr_NoMemory();
if (data)
@@ -365,7 +365,7 @@
if (ximage == NULL)
{
PyErr_SetString(PyExc_RuntimeError, "XCreateImage failed");
- PyMem_DEL(newdata);
+ PyMem_Free(newdata);
return NULL;
}
return PaxImage_FromImage(ximage);
@@ -390,7 +390,7 @@
return NULL;
/* create shminfo */
- shminfo = PyMem_NEW(XShmSegmentInfo, 1);
+ shminfo = PyMem_Malloc(sizeof(XShmSegmentInfo));
if (shminfo == NULL)
return PyErr_NoMemory();
shminfo->shmid = -1;
@@ -463,7 +463,7 @@
shmdt(shminfo->shmaddr);
if (shminfo->shmid != -1)
shmctl(shminfo->shmid, IPC_RMID, 0);
- PyMem_DEL(shminfo);
+ PyMem_Free(shminfo);
}
return NULL;
}
@@ -508,7 +508,7 @@
XShmSegmentInfo * shminfo = NULL;
/* create shminfo */
- shminfo = PyMem_NEW(XShmSegmentInfo, 1);
+ shminfo = PyMem_Malloc(sizeof(XShmSegmentInfo));
if (shminfo == NULL)
return PyErr_NoMemory();
shminfo->shmid = -1;
@@ -551,7 +551,7 @@
XDestroyImage(ximage);
shmdt(shminfo->shmaddr);
shmctl(shminfo->shmid, IPC_RMID, 0);
- PyMem_DEL(shminfo);
+ PyMem_Free(shminfo);
Py_INCREF(Py_None);
return Py_None;
}
@@ -567,7 +567,7 @@
shmdt(shminfo->shmaddr);
if (shminfo->shmid != -1)
shmctl(shminfo->shmid, IPC_RMID, 0);
- PyMem_DEL(shminfo);
+ PyMem_Free(shminfo);
}
return NULL;
}
@@ -704,7 +704,7 @@
return NULL;
}
reg = XPolygonRegion(points, npoints, fill_rule);
- PyMem_DEL(points);
+ PyMem_Free(points);
if (reg == NULL)
return PyErr_NoMemory();
return PaxRegion_FromRegion(reg);
Modified: skencil/branches/skencil-0.6/Sketch/Modules/curveobject.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/curveobject.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/curveobject.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -109,7 +109,7 @@
SKCurveObject * self;
int i;
- self = PyObject_NEW(SKCurveObject, &SKCurveType);
+ self = PyObject_New(SKCurveObject, &SKCurveType);
if (self == NULL)
return NULL;
@@ -119,7 +119,7 @@
self->segments = malloc(length * sizeof(CurveSegment));
if (!self->segments)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
return PyErr_NoMemory();
}
self->allocated = length;
@@ -220,7 +220,7 @@
curve_dealloc(SKCurveObject * self)
{
free(self->segments);
- PyMem_DEL(self);
+ PyObject_Del(self);
paths_allocated--;
}
Modified: skencil/branches/skencil-0.6/Sketch/Modules/pstokenize.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/pstokenize.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/pstokenize.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -685,7 +685,7 @@
{
PSTokenizerObject * self;
- self = PyObject_NEW(PSTokenizerObject, &PSTokenizerType);
+ self = PyObject_New(PSTokenizerObject, &PSTokenizerType);
if (!self)
return NULL;
@@ -702,7 +702,7 @@
pstokenizer_dealloc(PSTokenizerObject * self)
{
Py_DECREF(self->source);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/branches/skencil-0.6/Sketch/Modules/skaux.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/skaux.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/skaux.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1996, 1997, 1998, 1999, 2002 by Bernhard Herzog
+ * Copyright (C) 1996, 1997, 1998, 1999, 2002, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -280,14 +280,14 @@
static PyObject *
SKCache_New(void)
{
- SKCacheObject * self = PyObject_NEW(SKCacheObject, &SKCacheType);
+ SKCacheObject * self = PyObject_New(SKCacheObject, &SKCacheType);
if (!self)
return NULL;
self->dict = PyDict_New();
if (!self->dict)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
return NULL;
}
@@ -298,7 +298,7 @@
SKCache_dealloc(SKCacheObject * self)
{
Py_DECREF(self->dict);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/branches/skencil-0.6/Sketch/Modules/skcolor.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/skcolor.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/skcolor.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -42,7 +42,7 @@
fill_free_list(void)
{
SKColorObject *p, *q;
- p = PyMem_NEW(SKColorObject, N_COLOROBJECTS);
+ p = PyMem_Malloc(sizeof(SKColorObject) * N_COLOROBJECTS);
if (p == NULL)
return (SKColorObject *)PyErr_NoMemory();
q = p + N_COLOROBJECTS;
@@ -81,7 +81,7 @@
self->ob_type = &SKColorType;
_Py_NewReference(self);
#else
- self = PyObject_NEW(SKColorObject, &SKColorType);
+ self = PyObject_New(SKColorObject, &SKColorType);
if (!self)
return NULL;
#endif
@@ -103,7 +103,7 @@
self->ob_type = (PyTypeObject*)free_list;
free_list = self;
#else
- PyMem_DEL(self);
+ PyObject_Del(self);
#endif
#if SKCOLOR_COUNT_ALLOC
skcolor_allocated--;
@@ -478,20 +478,20 @@
{
for (j = 0; j < 8; j++)
{
- PyMem_DEL(self->dither_matrix[i][j]);
+ PyMem_Free(self->dither_matrix[i][j]);
}
- PyMem_DEL(self->dither_matrix[i]);
+ PyMem_Free(self->dither_matrix[i]);
}
- PyMem_DEL(self->dither_matrix);
+ PyMem_Free(self->dither_matrix);
}
if (self->dither_red)
- PyMem_DEL(self->dither_red);
+ PyMem_Free(self->dither_red);
if (self->dither_green)
- PyMem_DEL(self->dither_green);
+ PyMem_Free(self->dither_green);
if (self->dither_blue)
- PyMem_DEL(self->dither_blue);
+ PyMem_Free(self->dither_blue);
if (self->dither_gray)
- PyMem_DEL(self->dither_gray);
+ PyMem_Free(self->dither_gray);
}
static int
@@ -584,17 +584,17 @@
static PyObject *
SKVisual_FromXVisualInfo(Display *display, XVisualInfo *info, PyObject * args)
{
- SKVisualObject * self = PyObject_NEW(SKVisualObject, &SKVisualType);
+ SKVisualObject * self = PyObject_New(SKVisualObject, &SKVisualType);
int result = 0;
if (!self)
return NULL;
/* copy the XVisualInfo since it is probably allocated via Xlib */
- self->visualinfo = PyMem_NEW(XVisualInfo, 1);
+ self->visualinfo = PyMem_New(XVisualInfo, 1);
if (!self->visualinfo)
{
- PyMem_DEL(self);
+ PyMem_Free(self);
return PyErr_NoMemory();
}
memcpy(self->visualinfo, info, sizeof(XVisualInfo));
@@ -628,8 +628,8 @@
{
if (self->free_extra)
self->free_extra(self);
- free(self->visualinfo);
- PyMem_DEL(self);
+ PyMem_Free(self->visualinfo);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/branches/skencil-0.6/Sketch/Modules/skdither.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/skdither.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/skdither.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -84,22 +84,22 @@
/* alloc the ordered dither arrays for accelerated dithering */
- self->dither_red = PyMem_NEW(SKDitherInfo, 256);
- self->dither_green= PyMem_NEW(SKDitherInfo, 256);
- self->dither_blue = PyMem_NEW(SKDitherInfo, 256);
- self->dither_gray = PyMem_NEW(SKDitherInfo, 256);
+ self->dither_red = PyMem_New(SKDitherInfo, 256);
+ self->dither_green= PyMem_New(SKDitherInfo, 256);
+ self->dither_blue = PyMem_New(SKDitherInfo, 256);
+ self->dither_gray = PyMem_New(SKDitherInfo, 256);
red_ordered_dither = self->dither_red;
green_ordered_dither= self->dither_green;
blue_ordered_dither = self->dither_blue;
gray_ordered_dither = self->dither_gray;
- dither_matrix = PyMem_NEW(unsigned char**, 8);
+ dither_matrix = PyMem_New(unsigned char**, 8);
for (i = 0; i < 8; i++)
{
- dither_matrix[i] = PyMem_NEW(unsigned char*, 8);
+ dither_matrix[i] = PyMem_New(unsigned char*, 8);
for (j = 0; j < 8; j++)
- dither_matrix[i][j] = PyMem_NEW(unsigned char, 65);
+ dither_matrix[i][j] = PyMem_New(unsigned char, 65);
}
self->dither_matrix = dither_matrix;
Modified: skencil/branches/skencil-0.6/Sketch/Modules/skfm.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/skfm.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/skfm.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 2002 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 2002, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -75,7 +75,7 @@
{
SKFontMetric * self;
- self = PyObject_NEW(SKFontMetric, &SKFontMetricType);
+ self = PyObject_New(SKFontMetric, &SKFontMetricType);
if (self == NULL)
return NULL;
@@ -85,7 +85,7 @@
static void
skfm_dealloc(SKFontMetric * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
}
Modified: skencil/branches/skencil-0.6/Sketch/Modules/skpoint.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/skpoint.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/skpoint.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1996, 1997, 1998, 2001, 2002 by Bernhard Herzog
+ * Copyright (C) 1996, 1997, 1998, 2001, 2002, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -45,7 +45,7 @@
{
SKPointObject * self;
- self = PyObject_NEW(SKPointObject, &SKPointType);
+ self = PyObject_New(SKPointObject, &SKPointType);
if (self == NULL)
return NULL;
@@ -62,7 +62,7 @@
static void
skpoint_dealloc(SKPointObject * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
#if SKPOINT_COUNT_ALLOC
allocated -= 1;
#endif
Modified: skencil/branches/skencil-0.6/Sketch/Modules/skrect.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/skrect.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/skrect.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 1999, 2001, 2002 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 1999, 2001, 2002, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -61,7 +61,7 @@
fill_free_list(void)
{
SKRectObject *p, *q;
- p = PyMem_NEW(SKRectObject, N_RECTOBJECTS);
+ p = PyMem_Malloc(sizeof(SKRectObject) * N_RECTOBJECTS);
if (p == NULL)
return (SKRectObject *)PyErr_NoMemory();
q = p + N_RECTOBJECTS;
@@ -89,7 +89,7 @@
self->ob_type = &SKRectType;
_Py_NewReference(self);
#else
- self = PyObject_NEW(SKRectObject, &SKRectType);
+ self = PyObject_New(SKRectObject, &SKRectType);
if (self == NULL)
return NULL;
#endif
@@ -114,7 +114,7 @@
self->ob_type = (PyTypeObject*)free_list;
free_list = self;
#else
- PyMem_DEL(self);
+ PyObject_Del(self);
#endif
#if SKRECT_COUNT_ALLOC
allocated--;
Modified: skencil/branches/skencil-0.6/Sketch/Modules/sktrafo.c
===================================================================
--- skencil/branches/skencil-0.6/Sketch/Modules/sktrafo.c 2006-06-13 21:03:41 UTC (rev 685)
+++ skencil/branches/skencil-0.6/Sketch/Modules/sktrafo.c 2006-06-13 21:56:09 UTC (rev 686)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 2000, 2002 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 2000, 2002, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -61,7 +61,7 @@
{
SKTrafoObject * self;
- self = PyObject_NEW(SKTrafoObject, &SKTrafoType);
+ self = PyObject_New(SKTrafoObject, &SKTrafoType);
if (self == NULL)
return NULL;
@@ -82,7 +82,7 @@
static void
sktrafo_dealloc(SKTrafoObject * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
#if SKTRAFO_COUNT_ALLOC
allocated--;
#endif
More information about the Skencil-commits
mailing list