<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,20 @@
+2009/04/09 13:00:09  phil
+Print any exception raised by __dtor__.
+
+
+2009/04/01 15:07:01  phil
+Added support for PyQt4's support for signals that have overloaded methods.
+
+
+2009/03/30 19:48:55  phil
+Fixed a compiler warning message if sipCpp isn't used by %BIGetBufferCode.
+
+
+2009/03/30 12:48:19  phil
+Fixed the declaration of the module initialisation function when building
+static modules for Python v3.
+
+
 2009/03/27 19:08:22  phil
 Fixed a couple of missing calls to clear the error flag while parsing strings.
 </diff>
      <filename>ChangeLog</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ import siputils
 
 # Initialise the globals.
 sip_version = 0x040800
-sip_version_str = &quot;4.8-snapshot-20090327&quot;
+sip_version_str = &quot;4.8-snapshot-20090409&quot;
 py_version = sys.hexversion &gt;&gt; 8
 plat_py_site_dir = None
 plat_py_inc_dir = None</diff>
      <filename>configure.py</filename>
    </modified>
    <modified>
      <diff>@@ -301,7 +301,7 @@ ul.auto-toc {
 &lt;tr&gt;&lt;th class=&quot;docinfo-name&quot;&gt;Contact:&lt;/th&gt;
 &lt;td&gt;&lt;a class=&quot;first last reference&quot; href=&quot;mailto:info&amp;#64;riverbankcomputing.com&quot;&gt;info&amp;#64;riverbankcomputing.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
 &lt;tr&gt;&lt;th class=&quot;docinfo-name&quot;&gt;Version:&lt;/th&gt;
-&lt;td&gt;4.8-snapshot-20090327&lt;/td&gt;&lt;/tr&gt;
+&lt;td&gt;4.8-snapshot-20090409&lt;/td&gt;&lt;/tr&gt;
 &lt;tr&gt;&lt;th class=&quot;docinfo-name&quot;&gt;Copyright:&lt;/th&gt;
 &lt;td&gt;Copyright (c) 2009 Riverbank Computing Limited&lt;/td&gt;&lt;/tr&gt;
 &lt;/tbody&gt;
@@ -595,7 +595,7 @@ ul.auto-toc {
 &lt;/div&gt;
 &lt;div class=&quot;section&quot;&gt;
 &lt;h1&gt;&lt;a class=&quot;toc-backref&quot; href=&quot;#id25&quot; id=&quot;introduction&quot; name=&quot;introduction&quot;&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;Introduction&lt;/a&gt;&lt;/h1&gt;
-&lt;p&gt;This is the reference guide for SIP 4.8-snapshot-20090327.  SIP is a tool for
+&lt;p&gt;This is the reference guide for SIP 4.8-snapshot-20090409.  SIP is a tool for
 automatically generating &lt;a class=&quot;reference&quot; href=&quot;http://www.python.org&quot;&gt;Python&lt;/a&gt; bindings for C and
 C++ libraries.  SIP was originally developed in 1998 for
 &lt;a class=&quot;reference&quot; href=&quot;http://www.riverbankcomputing.com/software/pyqt/&quot;&gt;PyQt&lt;/a&gt; - the Python</diff>
      <filename>doc/sipref.html</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@
 -----------------
 
 :Contact:   info@riverbankcomputing.com
-:Version:   4.8-snapshot-20090327
+:Version:   4.8-snapshot-20090409
 :Copyright: Copyright (c) 2009 Riverbank Computing Limited
 
 .. contents::
@@ -17,7 +17,7 @@
 Introduction
 ============
 
-This is the reference guide for SIP 4.8-snapshot-20090327.  SIP is a tool for
+This is the reference guide for SIP 4.8-snapshot-20090409.  SIP is a tool for
 automatically generating `Python &lt;http://www.python.org&gt;`__ bindings for C and
 C++ libraries.  SIP was originally developed in 1998 for
 `PyQt &lt;http://www.riverbankcomputing.com/software/pyqt/&gt;`__ - the Python</diff>
      <filename>doc/sipref.txt</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,6 @@ typedef enum {
 /* An entry in the sorted array of methods. */
 typedef struct {
     memberDef *md;                      /* The method. */
-    int is_static;                      /* Set if all overloads are static. */
 } sortedMethTab;
 
 
@@ -225,7 +224,8 @@ static int generateSubClassConvertors(sipSpec *pt, moduleDef *mod, FILE *fp);
 static void generateNameCache(sipSpec *pt, FILE *fp);
 static const char *resultOwner(overDef *od);
 static void prCachedName(FILE *fp, nameDef *nd, const char *prefix);
-static void generateSignalTableEntry(classDef *cd, overDef *od, FILE *fp);
+static void generateSignalTableEntry(classDef *cd, overDef *sig, int membernr,
+        FILE *fp);
 static void generateTypesTable(sipSpec *pt, moduleDef *mod, FILE *fp);
 static int py2SlotOnly(slotType st);
 static int keepPyReference(argDef *ad);
@@ -2076,14 +2076,16 @@ static void generateModInitStart(moduleDef *mod, int gen_c, FILE *fp)
 &quot;/* The Python module initialisation function. */\n&quot;
 &quot;#if PY_MAJOR_VERSION &gt;= 3\n&quot;
 &quot;#define SIP_MODULE_ENTRY        PyInit_%s\n&quot;
+&quot;#define SIP_MODULE_TYPE         PyObject *\n&quot;
 &quot;#define SIP_MODULE_RETURN(r)    return (r)\n&quot;
 &quot;#else\n&quot;
 &quot;#define SIP_MODULE_ENTRY        init%s\n&quot;
+&quot;#define SIP_MODULE_TYPE         void\n&quot;
 &quot;#define SIP_MODULE_RETURN(r)    return\n&quot;
 &quot;#endif\n&quot;
 &quot;\n&quot;
 &quot;#if defined(SIP_STATIC_MODULE)\n&quot;
-&quot;%svoid SIP_MODULE_ENTRY()\n&quot;
+&quot;%sSIP_MODULE_TYPE SIP_MODULE_ENTRY()\n&quot;
 &quot;#else\n&quot;
 &quot;PyMODINIT_FUNC SIP_MODULE_ENTRY()\n&quot;
 &quot;#endif\n&quot;
@@ -3386,8 +3388,6 @@ static sortedMethTab *createFunctionTable(classDef *cd,int *nrp)
     for (md = cd-&gt;members; md != NULL; md = md-&gt;next)
     {
         mt-&gt;md = md;
-        mt-&gt;is_static = TRUE;
-
         ++mt;
     }
 
@@ -3458,14 +3458,13 @@ static sortedMethTab *createMethodTable(classDef *cd, int *nrp)
 
     for (vl = cd-&gt;visible; vl != NULL; vl = vl-&gt;next)
     {
-        int need_method, is_static;
+        int need_method;
         overDef *od;
 
         if (vl-&gt;m-&gt;slot != no_slot)
             continue;
 
         need_method = FALSE;
-        is_static = TRUE;
 
         for (od = vl-&gt;cd-&gt;overs; od != NULL; od = od-&gt;next)
         {
@@ -3477,19 +3476,12 @@ static sortedMethTab *createMethodTable(classDef *cd, int *nrp)
                 continue;
 
             if (!skipOverload(od,vl-&gt;m,cd,vl-&gt;cd,TRUE))
-            {
                 need_method = TRUE;
-
-                if (!isPrivate(od) &amp;&amp; !isStatic(od))
-                    is_static = FALSE;
-            }
         }
 
         if (need_method)
         {
             mt-&gt;md = vl-&gt;m;
-            mt-&gt;is_static = is_static;
-
             ++mt;
         }
     }
@@ -3540,18 +3532,12 @@ static int generateMethodTable(classDef *cd,FILE *fp)
         {
             memberDef *md = mtab[i].md;
 
-            /*
-             * For the moment we are suppressing the generation of
-             * METH_STATIC until we understand descriptors better.
-             * It could be that they will simplify the handling of
-             * lazy attributes and allow things to be cached in the
-             * type dictionary.
-             */
-            mtab[i].is_static = FALSE;
+            /* Save the index in the table. */
+            md-&gt;membernr = i;
 
             prcode(fp,
-&quot;    {SIP_PYMETHODDEF_CAST(%N), meth_%C_%s, METH_VARARGS%s, NULL}%s\n&quot;
-                ,md-&gt;pyname,classFQCName(cd),md-&gt;pyname-&gt;text,(mtab[i].is_static ? &quot;|METH_STATIC&quot; : &quot;&quot;),((i + 1) &lt; nr) ? &quot;,&quot; : &quot;&quot;);
+&quot;    {SIP_PYMETHODDEF_CAST(%N), meth_%C_%s, METH_VARARGS, NULL}%s\n&quot;
+                , md-&gt;pyname, classFQCName(cd), md-&gt;pyname-&gt;text, ((i + 1) &lt; nr) ? &quot;,&quot; : &quot;&quot;);
         }
 
         free(mtab);
@@ -4972,6 +4958,8 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd,
     /* The buffer interface functions. */
     if (cd-&gt;getbufcode != NULL)
     {
+        int need_cpp = usedInCode(cd-&gt;getbufcode, &quot;sipCpp&quot;);
+
         prcode(fp,
 &quot;\n&quot;
 &quot;\n&quot;
@@ -4984,15 +4972,19 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd,
                 , classFQCName(cd));
 
         prcode(fp,
-&quot;static int getbuffer_%C(PyObject *%s, void *sipCppV, Py_buffer *sipBuffer, int %s)\n&quot;
+&quot;static int getbuffer_%C(PyObject *%s, void *%s, Py_buffer *sipBuffer, int %s)\n&quot;
 &quot;{\n&quot;
-&quot;    &quot;, classFQCName(cd)
-     , argName(&quot;sipSelf&quot;, cd-&gt;getbufcode)
-     , argName(&quot;sipFlags&quot;, cd-&gt;getbufcode));
+            , classFQCName(cd), argName(&quot;sipSelf&quot;, cd-&gt;getbufcode), (generating_c || need_cpp ? &quot;sipCppV&quot; : &quot;&quot;), argName(&quot;sipFlags&quot;, cd-&gt;getbufcode));
 
-        generateClassFromVoid(cd, &quot;sipCpp&quot;, &quot;sipCppV&quot;, fp);
+        if (need_cpp)
+        {
+            prcode(fp, &quot;    &quot;);
+            generateClassFromVoid(cd, &quot;sipCpp&quot;, &quot;sipCppV&quot;, fp);
+            prcode(fp, &quot;;\n&quot;
+                );
+        }
 
-        prcode(fp, &quot;;\n&quot;
+        prcode(fp,
 &quot;    int sipRes;\n&quot;
 &quot;\n&quot;
             );
@@ -8220,6 +8212,10 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
 &quot;};\n&quot;
             );
 
+    /* Generate the attributes tables. */
+    nr_methods = generateMethodTable(cd,fp);
+    nr_enums = generateEnumMemberTable(pt, mod, cd, fp);
+
     /* Generate the PyQt4 signals table. */
     is_signals = FALSE;
 
@@ -8229,6 +8225,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
         for (md = cd-&gt;members; md != NULL; md = md-&gt;next)
         {
             overDef *od;
+            int membernr = md-&gt;membernr;
 
             for (od = cd-&gt;overs; od != NULL; od = od-&gt;next)
             {
@@ -8237,6 +8234,20 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
                 if (od-&gt;common != md || !isSignal(od))
                     continue;
 
+                if (membernr &gt;= 0)
+                {
+                    /* See if there is a non-signal overload. */
+
+                    overDef *nsig;
+
+                    for (nsig = cd-&gt;overs; nsig != NULL; nsig = nsig-&gt;next)
+                        if (nsig != od &amp;&amp; nsig-&gt;common == md &amp;&amp; !isSignal(nsig))
+                            break;
+
+                    if (nsig == NULL)
+                        membernr = -1;
+                }
+
                 if (!is_signals)
                 {
                     is_signals = TRUE;
@@ -8245,15 +8256,16 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
 &quot;\n&quot;
 &quot;\n&quot;
 &quot;/* Define this type's PyQt4 signals. */\n&quot;
-&quot;static const char *pyqt4_signals_%C[] = {\n&quot;
-                , classFQCName(cd));
+&quot;static const pyqt4QtSignal pyqt4_signals_%C[] = {\n&quot;
+                        , classFQCName(cd));
                 }
 
                 /*
                  * Default arguments are handled as multiple signals.  We make
                  * sure the largest is first and the smallest last.
                  */
-                generateSignalTableEntry(cd, od, fp);
+                generateSignalTableEntry(cd, od, membernr, fp);
+                membernr = -1;
 
                 nr_args = od-&gt;cppsig-&gt;nrArgs;
 
@@ -8263,7 +8275,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
                         break;
 
                     od-&gt;cppsig-&gt;nrArgs = a;
-                    generateSignalTableEntry(cd, od, fp);
+                    generateSignalTableEntry(cd, od, -1, fp);
                 }
 
                 od-&gt;cppsig-&gt;nrArgs = nr_args;
@@ -8272,15 +8284,11 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
 
         if (is_signals)
             prcode(fp,
-&quot;    0\n&quot;
+&quot;    {0, 0}\n&quot;
 &quot;};\n&quot;
                 );
     }
 
-    /* Generate the attributes tables. */
-    nr_methods = generateMethodTable(cd,fp);
-    nr_enums = generateEnumMemberTable(pt, mod, cd, fp);
-
     /* Generate the variable handlers. */
     nr_vars = 0;
 
@@ -8743,14 +8751,22 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp)
 /*
  * Generate an entry in the PyQt4 signal table.
  */
-static void generateSignalTableEntry(classDef *cd, overDef *od, FILE *fp)
+static void generateSignalTableEntry(classDef *cd, overDef *sig, int membernr,
+        FILE *fp)
 {
     prcode(fp,
-&quot;    \&quot;%s(&quot;, od-&gt;cppname);
+&quot;    {\&quot;%s(&quot;, sig-&gt;cppname);
 
-    generateCalledArgs(cd, od-&gt;cppsig, Declaration, TRUE, fp);
+    generateCalledArgs(cd, sig-&gt;cppsig, Declaration, TRUE, fp);
 
-    prcode(fp,&quot;)\&quot;,\n&quot;
+    prcode(fp,&quot;)\&quot;, &quot;);
+
+    if (membernr &gt;= 0)
+        prcode(fp, &quot;&amp;methods_%C[%d]&quot;, classFQCName(cd), membernr);
+    else
+        prcode(fp, &quot;0&quot;);
+
+    prcode(fp,&quot;},\n&quot;
         );
 }
 </diff>
      <filename>sipgen/gencode.c</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@
 #define PACKAGE &quot;sip&quot;
 #endif
 
-#define VERSION &quot;4.8-snapshot-20090327&quot;
+#define VERSION &quot;4.8-snapshot-20090409&quot;
 
 
 /* Global variables - see sip.h for their meaning. */</diff>
      <filename>sipgen/main.c</filename>
    </modified>
    <modified>
      <diff>@@ -867,6 +867,7 @@ typedef struct _enumDef {
 typedef struct _memberDef {
     nameDef *pyname;                    /* The Python name. */
     int memberflags;                    /* The member flags. */
+    int membernr;                       /* The index in the method table. */
     slotType slot;                      /* The slot type. */
     moduleDef *module;                  /* The owning module. */
     struct _memberDef *next;            /* Next in the list. */</diff>
      <filename>sipgen/sip.h</filename>
    </modified>
    <modified>
      <diff>@@ -51,7 +51,7 @@ extern &quot;C&quot; {
  * Define the SIP version number.
  */
 #define SIP_VERSION         0x040800
-#define SIP_VERSION_STR     &quot;4.8-snapshot-20090327&quot;
+#define SIP_VERSION_STR     &quot;4.8-snapshot-20090409&quot;
 
 
 /*
@@ -1377,6 +1377,21 @@ typedef struct _pyqt3ClassTypeDef {
  */
 
 /*
+ * The description of a Qt signal for PyQt4.
+ */
+typedef struct _pyqt4QtSignal {
+    /* The C++ name and signature of the signal. */
+    const char *signature;
+
+    /*
+     * If the signal is an overload of regular methods then this points to the
+     * code that implements those methods.
+     */
+    PyMethodDef *non_signals;
+} pyqt4QtSignal;
+
+
+/*
  * This is the PyQt4-specific extension to the generated class type structure.
  */
 typedef struct _pyqt4ClassTypeDef {
@@ -1402,7 +1417,7 @@ typedef struct _pyqt4ClassTypeDef {
      * The table of signals emitted by the type.  These are grouped by signal
      * name.
      */
-    const char **qt4_signals;
+    const pyqt4QtSignal *qt4_signals;
 } pyqt4ClassTypeDef;
 
 </diff>
      <filename>siplib/sip.h</filename>
    </modified>
    <modified>
      <diff>@@ -465,14 +465,16 @@ static int objectify(const char *s, PyObject **objp);
  */
 #if PY_MAJOR_VERSION &gt;= 3
 #define SIP_MODULE_ENTRY    PyInit_sip
+#define SIP_MODULE_TYPE     PyObject *
 #define SIP_FATAL(s)        return NULL
 #else
 #define SIP_MODULE_ENTRY    initsip
+#define SIP_MODULE_TYPE     void
 #define SIP_FATAL(s)        Py_FatalError(s)
 #endif
 
 #if defined(SIP_STATIC_MODULE)
-void SIP_MODULE_ENTRY(void)
+SIP_MODULE_TYPE SIP_MODULE_ENTRY(void)
 #else
 PyMODINIT_FUNC SIP_MODULE_ENTRY(void)
 #endif
@@ -3839,6 +3841,10 @@ static void callPyDtor(sipSimpleWrapper *self)
         /* Discard any result. */
         Py_XDECREF(res);
 
+        /* Handle any error the best we can. */
+        if (PyErr_Occurred())
+            PyErr_Print();
+
         SIP_RELEASE_GIL(sipGILState);
     }
 }
@@ -4621,7 +4627,10 @@ static int add_lazy_attrs(sipClassTypeDef *ctd)
         }
     }
 
-    /* Get any lazy attributes from registered getters. */
+    /*
+     * Get any lazy attributes from registered getters.  This must be done last
+     * to allow any existing attributes to be replaced.
+     */
     for (ag = sipAttrGetters; ag != NULL; ag = ag-&gt;next)
         if (ag-&gt;type == NULL || PyType_IsSubtype((PyTypeObject *)wt, ag-&gt;type))
             if (ag-&gt;getter((sipTypeDef *)ctd, dict) &lt; 0)</diff>
      <filename>siplib/siplib.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4b988d23eb47627dda821427b5293dbf46d7ae0f</id>
    </parent>
  </parents>
  <author>
    <name>Kevin Watters</name>
    <email>kevinwatters@gmail.com</email>
  </author>
  <url>http://github.com/kevinw/sip/commit/a4721a75c79e2875612e2511da24304099122935</url>
  <id>a4721a75c79e2875612e2511da24304099122935</id>
  <committed-date>2009-04-14T07:19:06-07:00</committed-date>
  <authored-date>2009-04-14T07:19:06-07:00</authored-date>
  <message>sip-4.8-snapshot-20090409</message>
  <tree>10d19f07801469572e37d9a8eec537583f5f3f9d</tree>
  <committer>
    <name>Kevin Watters</name>
    <email>kevinwatters@gmail.com</email>
  </committer>
</commit>
