Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 159574 Details for
Bug 193937
games-board/kombilo: A go games database program for pattern searches
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
workaround to the buffer_info() function when processing large database
kombilo-0.5m-patch-C-parser.diff (text/plain), 1.95 KB, created by
Mamy Ratsimbazafy
on 2008-07-04 22:22:21 UTC
(
hide
)
Description:
workaround to the buffer_info() function when processing large database
Filename:
MIME Type:
Creator:
Mamy Ratsimbazafy
Created:
2008-07-04 22:22:21 UTC
Size:
1.95 KB
patch
obsolete
>--- kombilo05/matchC.cc~ 2004-07-02 21:03:56.000000000 +0300 >+++ kombilo05/matchC.cc 2007-06-20 08:44:22.000000000 +0300 >@@ -842,16 +842,19 @@ > > > static PyObject* sortArray(PyObject* self, PyObject* args) { >- >- long* a; >+ PyObject* obj; >+ void* buffer; >+ Py_ssize_t buffer_len; > >- unsigned long adr; >+ long* a; > long l, r; // it's important that these are signed! > >- if (!PyArg_ParseTuple(args, "lii", &adr, &l, &r)) >+ if (!PyArg_ParseTuple(args, "Oii", &obj, &l, &r)) > return NULL; >+ if (PyObject_AsWriteBuffer(obj, &buffer, &buffer_len)) >+ return NULL; > >- a = (long*) adr; >+ a = (long*) buffer; > > sortCArray(a, l, r); > Py_INCREF(Py_None); >@@ -860,13 +863,18 @@ > > > static PyObject* buildOutput(PyObject* self, PyObject* args) { >+ PyObject* obj; >+ void* buffer; >+ Py_ssize_t buffer_len; > > long* a; >- unsigned long adr, length; >- if (!PyArg_ParseTuple(args, "li", &adr, &length)) >+ unsigned long length; >+ if (!PyArg_ParseTuple(args, "Oi", &obj, &length)) > return NULL; >+ if (PyObject_AsWriteBuffer(obj, &buffer, &buffer_len)) >+ return NULL; > >- a = (long*) adr; >+ a = (long*) buffer; > > long *b = new long[length]; > long bIndex = 0; >--- kombilo05/kombilo.py 2004-07-02 21:03:56.000000000 +0300 >+++ kombilo05/kombilo.py 2007-06-20 08:43:50.000000000 +0300 >@@ -2131,7 +2131,7 @@ > def sort(self): > > if CimportSucceeded: >- matchC.sortArray(self.data.buffer_info()[0], 0, self.dataIndex/2-1) >+ matchC.sortArray(self.data, 0, self.dataIndex/2-1) > else: > l = 0 > r = self.dataIndex/2 - 1 >@@ -2179,7 +2179,7 @@ > self.sort() > > if CimportSucceeded: >- hashT, hash = matchC.buildOutput(self.data.buffer_info()[0], self.dataIndex) >+ hashT, hash = matchC.buildOutput(self.data, self.dataIndex) > file = open(os.path.join(path[0], 'hashT' + path[1] + '.db'), 'wb') > file.write(hashT) > file.close()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 193937
:
131994
|
131996
|
131997
|
131998
|
159571
|
159573
| 159574 |
159576
|
194177
|
194178