]> git.pld-linux.org Git - packages/vim.git/blob - 7.1.320
- recognize update_mime_database
[packages/vim.git] / 7.1.320
1 To: vim-dev@vim.org
2 Subject: Patch 7.1.320
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.1.320 (extra)
11 Problem:    Win64: Warnings while compiling Python interface.
12 Solution:   Use PyInt in more places.  Also update version message for the
13             console. (George Reilly)
14 Files:      src/if_python.c, src/version.c
15
16
17 *** ../vim-7.1.319/src/if_python.c      Wed Jun  4 13:33:15 2008
18 --- src/if_python.c     Fri Jun 20 14:45:59 2008
19 ***************
20 *** 50,60 ****
21   
22   #if !defined(FEAT_PYTHON) && defined(PROTO)
23   /* Use this to be able to generate prototypes without python being used. */
24 ! # define PyObject int
25 ! # define PyThreadState int
26 ! # define PyTypeObject int
27 ! struct PyMethodDef { int a; };
28 ! # define PySequenceMethods int
29   #endif
30   
31   #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
32 --- 50,60 ----
33   
34   #if !defined(FEAT_PYTHON) && defined(PROTO)
35   /* Use this to be able to generate prototypes without python being used. */
36 ! # define PyObject Py_ssize_t
37 ! # define PyThreadState Py_ssize_t
38 ! # define PyTypeObject Py_ssize_t
39 ! struct PyMethodDef { Py_ssize_t a; };
40 ! # define PySequenceMethods Py_ssize_t
41   #endif
42   
43   #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
44 ***************
45 *** 64,69 ****
46 --- 64,70 ----
47   # define PyIntIntArgFunc ssizessizeargfunc
48   # define PyIntObjArgProc ssizeobjargproc
49   # define PyIntIntObjArgProc ssizessizeobjargproc
50 + # define Py_ssize_t_fmt "n"
51   #else
52   # define PyInt int
53   # define PyInquiry inquiry
54 ***************
55 *** 71,76 ****
56 --- 72,78 ----
57   # define PyIntIntArgFunc intintargfunc
58   # define PyIntObjArgProc intobjargproc
59   # define PyIntIntObjArgProc intintobjargproc
60 + # define Py_ssize_t_fmt "i"
61   #endif
62   
63   /* Parser flags */
64 ***************
65 *** 85,93 ****
66   
67   #if defined(DYNAMIC_PYTHON) || defined(PROTO)
68   # ifndef DYNAMIC_PYTHON
69 ! #  define HINSTANCE int               /* for generating prototypes */
70   # endif
71   
72   /*
73    * Wrapper defines
74    */
75 --- 87,104 ----
76   
77   #if defined(DYNAMIC_PYTHON) || defined(PROTO)
78   # ifndef DYNAMIC_PYTHON
79 ! #  define HINSTANCE long_u            /* for generating prototypes */
80   # endif
81   
82 + /* This makes if_python.c compile without warnings against Python 2.5
83 +  * on Win32 and Win64. */
84 + #undef PyRun_SimpleString
85 + #undef PyArg_Parse
86 + #undef PyArg_ParseTuple
87 + #undef Py_BuildValue
88 + #undef Py_InitModule4
89 + #undef Py_InitModule4_64
90
91   /*
92    * Wrapper defines
93    */
94 ***************
95 *** 269,275 ****
96 --- 280,290 ----
97       {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
98       {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
99       {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
100 + # if (PY_VERSION_HEX >= 0x02050000) && SIZEOF_SIZE_T != SIZEOF_INT
101 +     {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
102 + # else
103       {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
104 + # endif
105       {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
106       {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
107       {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized},
108 ***************
109 *** 339,346 ****
110    * TRUE, else FALSE.
111    */
112       int
113 ! python_enabled(verbose)
114 !     int               verbose;
115   {
116       return python_runtime_link_init(DYNAMIC_PYTHON_DLL, verbose) == OK;
117   }
118 --- 354,360 ----
119    * TRUE, else FALSE.
120    */
121       int
122 ! python_enabled(int verbose)
123   {
124       return python_runtime_link_init(DYNAMIC_PYTHON_DLL, verbose) == OK;
125   }
126 ***************
127 *** 374,381 ****
128    */
129   
130   static void DoPythonCommand(exarg_T *, const char *);
131 ! static int RangeStart;
132 ! static int RangeEnd;
133   
134   static void PythonIO_Flush(void);
135   static int PythonIO_Init(void);
136 --- 388,395 ----
137    */
138   
139   static void DoPythonCommand(exarg_T *, const char *);
140 ! static PyInt RangeStart;
141 ! static PyInt RangeEnd;
142   
143   static void PythonIO_Flush(void);
144   static int PythonIO_Init(void);
145 ***************
146 *** 384,395 ****
147   /* Utility functions for the vim/python interface
148    * ----------------------------------------------
149    */
150 ! static PyObject *GetBufferLine(buf_T *, int);
151   static PyObject *GetBufferLineList(buf_T *, PyInt, PyInt);
152   
153 ! static int SetBufferLine(buf_T *, int, PyObject *, int *);
154 ! static int SetBufferLineList(buf_T *, PyInt, PyInt, PyObject *, int *);
155 ! static int InsertBufferLines(buf_T *, int, PyObject *, int *);
156   
157   static PyObject *LineToString(const char *);
158   static char *StringToLine(PyObject *);
159 --- 398,409 ----
160   /* Utility functions for the vim/python interface
161    * ----------------------------------------------
162    */
163 ! static PyObject *GetBufferLine(buf_T *, PyInt);
164   static PyObject *GetBufferLineList(buf_T *, PyInt, PyInt);
165   
166 ! static int SetBufferLine(buf_T *, PyInt, PyObject *, PyInt *);
167 ! static int SetBufferLineList(buf_T *, PyInt, PyInt, PyObject *, PyInt *);
168 ! static int InsertBufferLines(buf_T *, PyInt, PyObject *, PyInt *);
169   
170   static PyObject *LineToString(const char *);
171   static char *StringToLine(PyObject *);
172 ***************
173 *** 690,696 ****
174   static PyObject *OutputWritelines(PyObject *, PyObject *);
175   
176   typedef void (*writefn)(char_u *);
177 ! static void writer(writefn fn, char_u *str, int n);
178   
179   /* Output object definition
180    */
181 --- 704,710 ----
182   static PyObject *OutputWritelines(PyObject *, PyObject *);
183   
184   typedef void (*writefn)(char_u *);
185 ! static void writer(writefn fn, char_u *str, PyInt n);
186   
187   /* Output object definition
188    */
189 ***************
190 *** 812,818 ****
191       {
192         PyObject *line = PyList_GetItem(list, i);
193         char *str;
194 !       int len;
195   
196         if (!PyArg_Parse(line, "s#", &str, &len)) {
197             PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
198 --- 826,832 ----
199       {
200         PyObject *line = PyList_GetItem(list, i);
201         char *str;
202 !       PyInt len;
203   
204         if (!PyArg_Parse(line, "s#", &str, &len)) {
205             PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
206 ***************
207 *** 836,850 ****
208    */
209   
210   static char_u *buffer = NULL;
211 ! static int buffer_len = 0;
212 ! static int buffer_size = 0;
213   
214   static writefn old_fn = NULL;
215   
216       static void
217 ! buffer_ensure(int n)
218   {
219 !     int new_size;
220       char_u *new_buffer;
221   
222       if (n < buffer_size)
223 --- 850,864 ----
224    */
225   
226   static char_u *buffer = NULL;
227 ! static PyInt buffer_len = 0;
228 ! static PyInt buffer_size = 0;
229   
230   static writefn old_fn = NULL;
231   
232       static void
233 ! buffer_ensure(PyInt n)
234   {
235 !     PyInt new_size;
236       char_u *new_buffer;
237   
238       if (n < buffer_size)
239 ***************
240 *** 884,890 ****
241   }
242   
243       static void
244 ! writer(writefn fn, char_u *str, int n)
245   {
246       char_u *ptr;
247   
248 --- 898,904 ----
249   }
250   
251       static void
252 ! writer(writefn fn, char_u *str, PyInt n)
253   {
254       char_u *ptr;
255   
256 ***************
257 *** 895,901 ****
258   
259       while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL)
260       {
261 !       int len = ptr - str;
262   
263         buffer_ensure(buffer_len + len + 1);
264   
265 --- 909,915 ----
266   
267       while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL)
268       {
269 !       PyInt len = ptr - str;
270   
271         buffer_ensure(buffer_len + len + 1);
272   
273 ***************
274 *** 1022,1035 ****
275   {
276       PyObject_HEAD
277       BufferObject *buf;
278 !     int start;
279 !     int end;
280   }
281   RangeObject;
282   
283   #define RangeType_Check(obj) ((obj)->ob_type == &RangeType)
284   
285 ! static PyObject *RangeNew(buf_T *, int, int);
286   
287   static void RangeDestructor(PyObject *);
288   static PyObject *RangeGetattr(PyObject *, char *);
289 --- 1036,1049 ----
290   {
291       PyObject_HEAD
292       BufferObject *buf;
293 !     PyInt start;
294 !     PyInt end;
295   }
296   RangeObject;
297   
298   #define RangeType_Check(obj) ((obj)->ob_type == &RangeType)
299   
300 ! static PyObject *RangeNew(buf_T *, PyInt, PyInt);
301   
302   static void RangeDestructor(PyObject *);
303   static PyObject *RangeGetattr(PyObject *, char *);
304 ***************
305 *** 1069,1076 ****
306   
307   static struct PyMethodDef VimMethods[] = {
308       /* name,       function,          calling,    documentation */
309 !     {"command",            VimCommand,        1,          "" },
310 !     {"eval",       VimEval,           1,          "" },
311       { NULL,        NULL,              0,          NULL }
312   };
313   
314 --- 1083,1090 ----
315   
316   static struct PyMethodDef VimMethods[] = {
317       /* name,       function,          calling,    documentation */
318 !     {"command",            VimCommand,        1,          "Execute a Vim ex-mode command" },
319 !     {"eval",       VimEval,           1,          "Evaluate an expression using Vim evaluator" },
320       { NULL,        NULL,              0,          NULL }
321   };
322   
323 ***************
324 *** 1110,1116 ****
325    * Function to translate a typval_T into a PyObject; this will recursively
326    * translate lists/dictionaries into their Python equivalents.
327    *
328 !  * The depth parameter is too avoid infinite recursion, set it to 1 when
329    * you call VimToPython.
330    */
331       static PyObject *
332 --- 1124,1130 ----
333    * Function to translate a typval_T into a PyObject; this will recursively
334    * translate lists/dictionaries into their Python equivalents.
335    *
336 !  * The depth parameter is to avoid infinite recursion, set it to 1 when
337    * you call VimToPython.
338    */
339       static PyObject *
340 ***************
341 *** 1130,1136 ****
342   
343       /* Check if we run into a recursive loop.  The item must be in lookupDict
344        * then and we can use it again. */
345 !     sprintf(ptrBuf, "%ld", (long)our_tv);
346       result = PyDict_GetItemString(lookupDict, ptrBuf);
347       if (result != NULL)
348         Py_INCREF(result);
349 --- 1144,1150 ----
350   
351       /* Check if we run into a recursive loop.  The item must be in lookupDict
352        * then and we can use it again. */
353 !     sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U, (long_u)our_tv);
354       result = PyDict_GetItemString(lookupDict, ptrBuf);
355       if (result != NULL)
356         Py_INCREF(result);
357 ***************
358 *** 1184,1190 ****
359         if (our_tv->vval.v_dict != NULL)
360         {
361             hashtab_T   *ht = &our_tv->vval.v_dict->dv_hashtab;
362 !           int         todo = ht->ht_used;
363             hashitem_T  *hi;
364             dictitem_T  *di;
365   
366 --- 1198,1204 ----
367         if (our_tv->vval.v_dict != NULL)
368         {
369             hashtab_T   *ht = &our_tv->vval.v_dict->dv_hashtab;
370 !           long_u      todo = ht->ht_used;
371             hashitem_T  *hi;
372             dictitem_T  *di;
373   
374 ***************
375 *** 1273,1279 ****
376   }
377   
378       static PyObject *
379 ! RBItem(BufferObject *self, PyInt n, int start, int end)
380   {
381       if (CheckBuffer(self))
382         return NULL;
383 --- 1287,1293 ----
384   }
385   
386       static PyObject *
387 ! RBItem(BufferObject *self, PyInt n, PyInt start, PyInt end)
388   {
389       if (CheckBuffer(self))
390         return NULL;
391 ***************
392 *** 1288,1294 ****
393   }
394   
395       static PyObject *
396 ! RBSlice(BufferObject *self, PyInt lo, PyInt hi, int start, int end)
397   {
398       PyInt size;
399   
400 --- 1302,1308 ----
401   }
402   
403       static PyObject *
404 ! RBSlice(BufferObject *self, PyInt lo, PyInt hi, PyInt start, PyInt end)
405   {
406       PyInt size;
407   
408 ***************
409 *** 1312,1320 ****
410   }
411   
412       static PyInt
413 ! RBAssItem(BufferObject *self, PyInt n, PyObject *val, int start, int end, int *new_end)
414   {
415 !     int len_change;
416   
417       if (CheckBuffer(self))
418         return -1;
419 --- 1326,1334 ----
420   }
421   
422       static PyInt
423 ! RBAssItem(BufferObject *self, PyInt n, PyObject *val, PyInt start, PyInt end, PyInt *new_end)
424   {
425 !     PyInt len_change;
426   
427       if (CheckBuffer(self))
428         return -1;
429 ***************
430 *** 1335,1344 ****
431   }
432   
433       static PyInt
434 ! RBAssSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, int start, int end, int *new_end)
435   {
436 !     int size;
437 !     int len_change;
438   
439       /* Self must be a valid buffer */
440       if (CheckBuffer(self))
441 --- 1349,1358 ----
442   }
443   
444       static PyInt
445 ! RBAssSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, PyInt start, PyInt end, PyInt *new_end)
446   {
447 !     PyInt size;
448 !     PyInt len_change;
449   
450       /* Self must be a valid buffer */
451       if (CheckBuffer(self))
452 ***************
453 *** 1368,1386 ****
454   }
455   
456       static PyObject *
457 ! RBAppend(BufferObject *self, PyObject *args, int start, int end, int *new_end)
458   {
459       PyObject *lines;
460 !     int len_change;
461 !     int max;
462 !     int n;
463   
464       if (CheckBuffer(self))
465         return NULL;
466   
467       max = n = end - start + 1;
468   
469 !     if (!PyArg_ParseTuple(args, "O|i", &lines, &n))
470         return NULL;
471   
472       if (n < 0 || n > max)
473 --- 1382,1400 ----
474   }
475   
476       static PyObject *
477 ! RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end)
478   {
479       PyObject *lines;
480 !     PyInt len_change;
481 !     PyInt max;
482 !     PyInt n;
483   
484       if (CheckBuffer(self))
485         return NULL;
486   
487       max = n = end - start + 1;
488   
489 !     if (!PyArg_ParseTuple(args, "O|" Py_ssize_t_fmt, &lines, &n))
490         return NULL;
491   
492       if (n < 0 || n > max)
493 ***************
494 *** 1405,1413 ****
495   
496   static struct PyMethodDef BufferMethods[] = {
497       /* name,      function,           calling,    documentation */
498 !     {"append",            BufferAppend,       1,          "" },
499 !     {"mark",      BufferMark,         1,          "" },
500 !     {"range",     BufferRange,        1,          "" },
501       { NULL,       NULL,               0,          NULL }
502   };
503   
504 --- 1419,1427 ----
505   
506   static struct PyMethodDef BufferMethods[] = {
507       /* name,      function,           calling,    documentation */
508 !     {"append",            BufferAppend,       1,          "Append data to Vim buffer" },
509 !     {"mark",      BufferMark,         1,          "Return (row,col) representing position of named mark" },
510 !     {"range",     BufferRange,        1,          "Return a range object which represents the part of the given buffer between line numbers s and e" },
511       { NULL,       NULL,               0,          NULL }
512   };
513   
514 ***************
515 *** 1503,1511 ****
516         return NULL;
517   
518       if (strcmp(name, "name") == 0)
519 !       return Py_BuildValue("s",this->buf->b_ffname);
520       else if (strcmp(name, "number") == 0)
521 !       return Py_BuildValue("i",this->buf->b_fnum);
522       else if (strcmp(name,"__members__") == 0)
523         return Py_BuildValue("[ss]", "name", "number");
524       else
525 --- 1517,1525 ----
526         return NULL;
527   
528       if (strcmp(name, "name") == 0)
529 !       return Py_BuildValue("s", this->buf->b_ffname);
530       else if (strcmp(name, "number") == 0)
531 !       return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum);
532       else if (strcmp(name,"__members__") == 0)
533         return Py_BuildValue("[ss]", "name", "number");
534       else
535 ***************
536 *** 1520,1533 ****
537   
538       if (this->buf == INVALID_BUFFER_VALUE)
539       {
540 !       vim_snprintf(repr, 100, _("<buffer object (deleted) at %8lX>"),
541 !                                                               (long)(self));
542         return PyString_FromString(repr);
543       }
544       else
545       {
546         char *name = (char *)this->buf->b_fname;
547 !       int len;
548   
549         if (name == NULL)
550             name = "";
551 --- 1534,1546 ----
552   
553       if (this->buf == INVALID_BUFFER_VALUE)
554       {
555 !       vim_snprintf(repr, 100, _("<buffer object (deleted) at %p>"), (self));
556         return PyString_FromString(repr);
557       }
558       else
559       {
560         char *name = (char *)this->buf->b_fname;
561 !       PyInt len;
562   
563         if (name == NULL)
564             name = "";
565 ***************
566 *** 1572,1578 ****
567   BufferAssItem(PyObject *self, PyInt n, PyObject *val)
568   {
569       return RBAssItem((BufferObject *)(self), n, val, 1,
570 !                    (int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
571                      NULL);
572   }
573   
574 --- 1585,1591 ----
575   BufferAssItem(PyObject *self, PyInt n, PyObject *val)
576   {
577       return RBAssItem((BufferObject *)(self), n, val, 1,
578 !                    (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
579                      NULL);
580   }
581   
582 ***************
583 *** 1580,1586 ****
584   BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val)
585   {
586       return RBAssSlice((BufferObject *)(self), lo, hi, val, 1,
587 !                     (int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
588                       NULL);
589   }
590   
591 --- 1593,1599 ----
592   BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val)
593   {
594       return RBAssSlice((BufferObject *)(self), lo, hi, val, 1,
595 !                     (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
596                       NULL);
597   }
598   
599 ***************
600 *** 1588,1594 ****
601   BufferAppend(PyObject *self, PyObject *args)
602   {
603       return RBAppend((BufferObject *)(self), args, 1,
604 !                   (int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
605                     NULL);
606   }
607   
608 --- 1601,1607 ----
609   BufferAppend(PyObject *self, PyObject *args)
610   {
611       return RBAppend((BufferObject *)(self), args, 1,
612 !                   (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
613                     NULL);
614   }
615   
616 ***************
617 *** 1633,1645 ****
618       static PyObject *
619   BufferRange(PyObject *self, PyObject *args)
620   {
621 !     int start;
622 !     int end;
623   
624       if (CheckBuffer((BufferObject *)(self)))
625         return NULL;
626   
627 !     if (!PyArg_ParseTuple(args, "ii", &start, &end))
628         return NULL;
629   
630       return RangeNew(((BufferObject *)(self))->buf, start, end);
631 --- 1646,1658 ----
632       static PyObject *
633   BufferRange(PyObject *self, PyObject *args)
634   {
635 !     PyInt start;
636 !     PyInt end;
637   
638       if (CheckBuffer((BufferObject *)(self)))
639         return NULL;
640   
641 !     if (!PyArg_ParseTuple(args, Py_ssize_t_fmt Py_ssize_t_fmt, &start, &end))
642         return NULL;
643   
644       return RangeNew(((BufferObject *)(self))->buf, start, end);
645 ***************
646 *** 1650,1656 ****
647   
648   static struct PyMethodDef RangeMethods[] = {
649       /* name,      function,           calling,    documentation */
650 !     {"append",            RangeAppend,        1,          "" },
651       { NULL,       NULL,               0,          NULL }
652   };
653   
654 --- 1663,1669 ----
655   
656   static struct PyMethodDef RangeMethods[] = {
657       /* name,      function,           calling,    documentation */
658 !     {"append",            RangeAppend,        1,          "Append data to the Vim range" },
659       { NULL,       NULL,               0,          NULL }
660   };
661   
662 ***************
663 *** 1691,1697 ****
664    */
665   
666       static PyObject *
667 ! RangeNew(buf_T *buf, int start, int end)
668   {
669       BufferObject *bufr;
670       RangeObject *self;
671 --- 1704,1710 ----
672    */
673   
674       static PyObject *
675 ! RangeNew(buf_T *buf, PyInt start, PyInt end)
676   {
677       BufferObject *bufr;
678       RangeObject *self;
679 ***************
680 *** 1725,1733 ****
681   RangeGetattr(PyObject *self, char *name)
682   {
683       if (strcmp(name, "start") == 0)
684 !       return Py_BuildValue("i",((RangeObject *)(self))->start - 1);
685       else if (strcmp(name, "end") == 0)
686 !       return Py_BuildValue("i",((RangeObject *)(self))->end - 1);
687       else
688         return Py_FindMethod(RangeMethods, self, name);
689   }
690 --- 1738,1746 ----
691   RangeGetattr(PyObject *self, char *name)
692   {
693       if (strcmp(name, "start") == 0)
694 !       return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->start - 1);
695       else if (strcmp(name, "end") == 0)
696 !       return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->end - 1);
697       else
698         return Py_FindMethod(RangeMethods, self, name);
699   }
700 ***************
701 *** 1740,1747 ****
702   
703       if (this->buf->buf == INVALID_BUFFER_VALUE)
704       {
705 !       vim_snprintf(repr, 100, "<range object (for deleted buffer) at %8lX>",
706 !                                                               (long)(self));
707         return PyString_FromString(repr);
708       }
709       else
710 --- 1753,1760 ----
711   
712       if (this->buf->buf == INVALID_BUFFER_VALUE)
713       {
714 !       vim_snprintf(repr, 100, "<range object (for deleted buffer) at %p>",
715 !                                                                     (self));
716         return PyString_FromString(repr);
717       }
718       else
719 ***************
720 *** 1869,1875 ****
721   BufListLength(PyObject *self)
722   {
723       buf_T     *b = firstbuf;
724 !     int               n = 0;
725   
726       while (b)
727       {
728 --- 1882,1888 ----
729   BufListLength(PyObject *self)
730   {
731       buf_T     *b = firstbuf;
732 !     PyInt     n = 0;
733   
734       while (b)
735       {
736 ***************
737 *** 2115,2122 ****
738   
739       if (this->win == INVALID_WINDOW_VALUE)
740       {
741 !       vim_snprintf(repr, 100, _("<window object (deleted) at %.8lX>"),
742 !                                                               (long)(self));
743         return PyString_FromString(repr);
744       }
745       else
746 --- 2128,2134 ----
747   
748       if (this->win == INVALID_WINDOW_VALUE)
749       {
750 !       vim_snprintf(repr, 100, _("<window object (deleted) at %p>"), (self));
751         return PyString_FromString(repr);
752       }
753       else
754 ***************
755 *** 2128,2135 ****
756             ++i;
757   
758         if (w == NULL)
759 !           vim_snprintf(repr, 100, _("<window object (unknown) at %.8lX>"),
760 !                                                               (long)(self));
761         else
762             vim_snprintf(repr, 100, _("<window %d>"), i);
763   
764 --- 2140,2147 ----
765             ++i;
766   
767         if (w == NULL)
768 !           vim_snprintf(repr, 100, _("<window object (unknown) at %p>"),
769 !                                                                     (self));
770         else
771             vim_snprintf(repr, 100, _("<window %d>"), i);
772   
773 ***************
774 *** 2186,2192 ****
775   WinListLength(PyObject *self)
776   {
777       win_T     *w = firstwin;
778 !     int               n = 0;
779   
780       while (w != NULL)
781       {
782 --- 2198,2204 ----
783   WinListLength(PyObject *self)
784   {
785       win_T     *w = firstwin;
786 !     PyInt     n = 0;
787   
788       while (w != NULL)
789       {
790 ***************
791 *** 2254,2260 ****
792       else if (strcmp(name, "window") == 0)
793         return (PyObject *)WindowNew(curwin);
794       else if (strcmp(name, "line") == 0)
795 !       return GetBufferLine(curbuf, (int)curwin->w_cursor.lnum);
796       else if (strcmp(name, "range") == 0)
797         return RangeNew(curbuf, RangeStart, RangeEnd);
798       else if (strcmp(name,"__members__") == 0)
799 --- 2266,2272 ----
800       else if (strcmp(name, "window") == 0)
801         return (PyObject *)WindowNew(curwin);
802       else if (strcmp(name, "line") == 0)
803 !       return GetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum);
804       else if (strcmp(name, "range") == 0)
805         return RangeNew(curbuf, RangeStart, RangeEnd);
806       else if (strcmp(name,"__members__") == 0)
807 ***************
808 *** 2272,2278 ****
809   {
810       if (strcmp(name, "line") == 0)
811       {
812 !       if (SetBufferLine(curbuf, (int)curwin->w_cursor.lnum, value, NULL) == FAIL)
813             return -1;
814   
815         return 0;
816 --- 2284,2290 ----
817   {
818       if (strcmp(name, "line") == 0)
819       {
820 !       if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, value, NULL) == FAIL)
821             return -1;
822   
823         return 0;
824 ***************
825 *** 2344,2350 ****
826       /* Set sys.argv[] to avoid a crash in warn(). */
827       PySys_SetArgv(1, argv);
828   
829 !     mod = Py_InitModule("vim", VimMethods);
830       dict = PyModule_GetDict(mod);
831   
832       VimError = Py_BuildValue("s", "vim.error");
833 --- 2356,2362 ----
834       /* Set sys.argv[] to avoid a crash in warn(). */
835       PySys_SetArgv(1, argv);
836   
837 !     mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION);
838       dict = PyModule_GetDict(mod);
839   
840       VimError = Py_BuildValue("s", "vim.error");
841 ***************
842 *** 2369,2375 ****
843    * string object.
844    */
845       static PyObject *
846 ! GetBufferLine(buf_T *buf, int n)
847   {
848       return LineToString((char *)ml_get_buf(buf, (linenr_T)n, FALSE));
849   }
850 --- 2381,2387 ----
851    * string object.
852    */
853       static PyObject *
854 ! GetBufferLine(buf_T *buf, PyInt n)
855   {
856       return LineToString((char *)ml_get_buf(buf, (linenr_T)n, FALSE));
857   }
858 ***************
859 *** 2422,2428 ****
860    * deleted).
861    */
862       static void
863 ! py_fix_cursor(int lo, int hi, int extra)
864   {
865       if (curwin->w_cursor.lnum >= lo)
866       {
867 --- 2434,2440 ----
868    * deleted).
869    */
870       static void
871 ! py_fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra)
872   {
873       if (curwin->w_cursor.lnum >= lo)
874       {
875 ***************
876 *** 2454,2460 ****
877    * is set to the change in the buffer length.
878    */
879       static int
880 ! SetBufferLine(buf_T *buf, int n, PyObject *line, int *len_change)
881   {
882       /* First of all, we check the thpe of the supplied Python object.
883        * There are three cases:
884 --- 2466,2472 ----
885    * is set to the change in the buffer length.
886    */
887       static int
888 ! SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
889   {
890       /* First of all, we check the thpe of the supplied Python object.
891        * There are three cases:
892 ***************
893 *** 2477,2483 ****
894         {
895             deleted_lines_mark((linenr_T)n, 1L);
896             if (buf == curwin->w_buffer)
897 !               py_fix_cursor(n, n + 1, -1);
898         }
899   
900         curbuf = savebuf;
901 --- 2489,2495 ----
902         {
903             deleted_lines_mark((linenr_T)n, 1L);
904             if (buf == curwin->w_buffer)
905 !               py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1);
906         }
907   
908         curbuf = savebuf;
909 ***************
910 *** 2545,2551 ****
911    * is set to the change in the buffer length.
912    */
913       static int
914 ! SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_change)
915   {
916       /* First of all, we check the thpe of the supplied Python object.
917        * There are three cases:
918 --- 2557,2563 ----
919    * is set to the change in the buffer length.
920    */
921       static int
922 ! SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_change)
923   {
924       /* First of all, we check the thpe of the supplied Python object.
925        * There are three cases:
926 ***************
927 *** 2556,2562 ****
928       if (list == Py_None || list == NULL)
929       {
930         PyInt   i;
931 !       PyInt   n = hi - lo;
932         buf_T   *savebuf = curbuf;
933   
934         PyErr_Clear();
935 --- 2568,2574 ----
936       if (list == Py_None || list == NULL)
937       {
938         PyInt   i;
939 !       PyInt   n = (int)(hi - lo);
940         buf_T   *savebuf = curbuf;
941   
942         PyErr_Clear();
943 ***************
944 *** 2577,2583 ****
945             deleted_lines_mark((linenr_T)lo, (long)i);
946   
947             if (buf == curwin->w_buffer)
948 !               py_fix_cursor(lo, hi, -n);
949         }
950   
951         curbuf = savebuf;
952 --- 2589,2595 ----
953             deleted_lines_mark((linenr_T)lo, (long)i);
954   
955             if (buf == curwin->w_buffer)
956 !               py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
957         }
958   
959         curbuf = savebuf;
960 ***************
961 *** 2595,2601 ****
962         PyInt   i;
963         PyInt   new_len = PyList_Size(list);
964         PyInt   old_len = hi - lo;
965 !       int     extra = 0;      /* lines added to text, can be negative */
966         char    **array;
967         buf_T   *savebuf;
968   
969 --- 2607,2613 ----
970         PyInt   i;
971         PyInt   new_len = PyList_Size(list);
972         PyInt   old_len = hi - lo;
973 !       PyInt   extra = 0;      /* lines added to text, can be negative */
974         char    **array;
975         buf_T   *savebuf;
976   
977 ***************
978 *** 2706,2712 ****
979         changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
980   
981         if (buf == curwin->w_buffer)
982 !           py_fix_cursor(lo, hi, extra);
983   
984         curbuf = savebuf;
985   
986 --- 2718,2724 ----
987         changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
988   
989         if (buf == curwin->w_buffer)
990 !           py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra);
991   
992         curbuf = savebuf;
993   
994 ***************
995 *** 2734,2740 ****
996    * is set to the change in the buffer length.
997    */
998       static int
999 ! InsertBufferLines(buf_T *buf, int n, PyObject *lines, int *len_change)
1000   {
1001       /* First of all, we check the type of the supplied Python object.
1002        * It must be a string or a list, or the call is in error.
1003 --- 2746,2752 ----
1004    * is set to the change in the buffer length.
1005    */
1006       static int
1007 ! InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
1008   {
1009       /* First of all, we check the type of the supplied Python object.
1010        * It must be a string or a list, or the call is in error.
1011 *** ../vim-7.1.319/src/version.c        Fri Jun 20 12:55:28 2008
1012 --- src/version.c       Fri Jun 20 16:25:28 2008
1013 ***************
1014 *** 1367,1378 ****
1015   # ifdef FEAT_GUI_W32
1016   #  if defined(_MSC_VER) && (_MSC_VER <= 1010)
1017       /* Only MS VC 4.1 and earlier can do Win32s */
1018 !     MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
1019   #  else
1020   #   ifdef _WIN64
1021 !     MSG_PUTS(_("\nMS-Windows 64 bit GUI version"));
1022   #   else
1023 !     MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
1024   #   endif
1025   #  endif
1026       if (gui_is_win32s())
1027 --- 1374,1385 ----
1028   # ifdef FEAT_GUI_W32
1029   #  if defined(_MSC_VER) && (_MSC_VER <= 1010)
1030       /* Only MS VC 4.1 and earlier can do Win32s */
1031 !     MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
1032   #  else
1033   #   ifdef _WIN64
1034 !     MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
1035   #   else
1036 !     MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
1037   #   endif
1038   #  endif
1039       if (gui_is_win32s())
1040 ***************
1041 *** 1381,1397 ****
1042       MSG_PUTS(_(" with OLE support"));
1043   # endif
1044   # else
1045 !     MSG_PUTS(_("\nMS-Windows 32 bit console version"));
1046   # endif
1047   #endif
1048   #ifdef WIN16
1049 !     MSG_PUTS(_("\nMS-Windows 16 bit version"));
1050   #endif
1051   #ifdef MSDOS
1052   # ifdef DJGPP
1053 !     MSG_PUTS(_("\n32 bit MS-DOS version"));
1054   # else
1055 !     MSG_PUTS(_("\n16 bit MS-DOS version"));
1056   # endif
1057   #endif
1058   #ifdef MACOS
1059 --- 1388,1408 ----
1060       MSG_PUTS(_(" with OLE support"));
1061   # endif
1062   # else
1063 ! #  ifdef _WIN64
1064 !     MSG_PUTS(_("\nMS-Windows 64-bit console version"));
1065 ! #  else
1066 !     MSG_PUTS(_("\nMS-Windows 32-bit console version"));
1067 ! #  endif
1068   # endif
1069   #endif
1070   #ifdef WIN16
1071 !     MSG_PUTS(_("\nMS-Windows 16-bit version"));
1072   #endif
1073   #ifdef MSDOS
1074   # ifdef DJGPP
1075 !     MSG_PUTS(_("\n32-bit MS-DOS version"));
1076   # else
1077 !     MSG_PUTS(_("\n16-bit MS-DOS version"));
1078   # endif
1079   #endif
1080   #ifdef MACOS
1081 *** ../vim-7.1.319/src/version.c        Fri Jun 20 12:55:28 2008
1082 --- src/version.c       Fri Jun 20 16:25:28 2008
1083 ***************
1084 *** 668,669 ****
1085 --- 673,676 ----
1086   {   /* Add new patch number below this line */
1087 + /**/
1088 +     320,
1089   /**/
1090
1091 -- 
1092 The real
1093 trick is
1094 this: to
1095 keep the
1096 lines as
1097 short as
1098 possible
1099 and keep
1100 the size
1101 the same
1102 yet free
1103 from the
1104 need for
1105 hyphena-
1106 Dammit!!  (Matthew Winn)
1107
1108  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
1109 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1110 \\\        download, build and distribute -- http://www.A-A-P.org        ///
1111  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.415444 seconds and 3 git commands to generate.