[Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.8,2.9
A.M. Kuchling
python-dev@python.org
Sat, 3 Jun 2000 12:41:44 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv21410
Modified Files:
mmapmodule.c
Log Message:
Add missing PyArg_NoArgs() calls to methods that didn't take arguments
(Pointed out by Moshe Zadka)
Index: mmapmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v
retrieving revision 2.8
retrieving revision 2.9
diff -C2 -r2.8 -r2.9
*** mmapmodule.c 2000年05月03日 23:44:32 2.8
--- mmapmodule.c 2000年06月03日 19:41:42 2.9
***************
*** 2,6 ****
/ Author: Sam Rushing <rushing@nightmare.com>
/ Hacked for Unix by A.M. Kuchling <amk1@bigfoot.com>
! / $Id: mmapmodule.c,v 2.8 2000年05月03日 23:44:32 guido Exp $
/ mmapmodule.cpp -- map a view of a file into memory
--- 2,6 ----
/ Author: Sam Rushing <rushing@nightmare.com>
/ Hacked for Unix by A.M. Kuchling <amk1@bigfoot.com>
! / $Id: mmapmodule.c,v 2.9 2000年06月03日 19:41:42 akuchling Exp $
/ mmapmodule.cpp -- map a view of a file into memory
***************
*** 76,79 ****
--- 76,81 ----
mmap_close_method (mmap_object * self, PyObject * args)
{
+ if (!PyArg_NoArgs(args))
+ return NULL;
#ifdef MS_WIN32
UnmapViewOfFile (self->data);
***************
*** 119,122 ****
--- 121,126 ----
char * where;
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
if (self->pos >= 0 && self->pos < self->size) {
where = self->data + self->pos;
***************
*** 132,136 ****
static PyObject *
mmap_read_line_method (mmap_object * self,
! PyObject * args)
{
char * start = self->data+self->pos;
--- 136,140 ----
static PyObject *
mmap_read_line_method (mmap_object * self,
! PyObject * args)
{
char * start = self->data+self->pos;
***************
*** 140,143 ****
--- 144,149 ----
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
eol = memchr(start, '\n', self->size - self->pos);
***************
*** 154,158 ****
static PyObject *
mmap_read_method (mmap_object * self,
! PyObject * args)
{
long num_bytes;
--- 160,164 ----
static PyObject *
mmap_read_method (mmap_object * self,
! PyObject * args)
{
long num_bytes;
***************
*** 226,230 ****
static PyObject *
mmap_write_byte_method (mmap_object * self,
! PyObject * args)
{
char value;
--- 232,236 ----
static PyObject *
mmap_write_byte_method (mmap_object * self,
! PyObject * args)
{
char value;
***************
*** 242,248 ****
static PyObject *
mmap_size_method (mmap_object * self,
! PyObject * args)
{
CHECK_VALID(NULL);
#ifdef MS_WIN32
--- 248,256 ----
static PyObject *
mmap_size_method (mmap_object * self,
! PyObject * args)
{
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
#ifdef MS_WIN32
***************
*** 347,350 ****
--- 355,360 ----
{
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
return (Py_BuildValue ("l", self->pos) );
}
***************
*** 463,470 ****
static int
! mmap_buffer_getreadbuf(self, index, ptr)
! mmap_object *self;
! int index;
! const void **ptr;
{
CHECK_VALID(-1);
--- 473,477 ----
static int
! mmap_buffer_getreadbuf(mmap_object *self, int index, const void **ptr)
{
CHECK_VALID(-1);
***************
*** 868,869 ****
--- 875,877 ----
}
+