CHANGES.current

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6269 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-09-26 01:14:49 +00:00
commit 15a5e3976f
15 changed files with 113 additions and 35 deletions

View file

@ -1,6 +1,55 @@
Version 1.3.23 (in progress)
==================================
09/26/2004: mmatus
- add %feature("exceptionclass") to identify a class used
as exception. Before swig identified and marked a class
using the "cplus:exceptionclass" attribute. However, the
class needed to appear on an throw() statement. Now
swig keeps trying to identify the exception classes, as
before, but it also allows the user to mark a class by
using the %feature explicitly. (mostly relevant for
python and chicken)
[Python]
- fix -modern option + exceptions, which mix old class
style with the new one. So, we always need to emit
the "nonmodern" python code.
- add the "python:nondynamic" feature and its handler
now if you have
%pythonnondynamic(1) A;
struct A {
int a;
int b;
};
then, in the python side
aa = A()
aa.a = 1 # ok
aa.b = 2 # ok
aa.c = 3 # error, the class can not be extended dynamically.
Since this is a feature, you can use
%pythonnondynamic(1);
or
%pythondynamic(0);
to force all the wrapped classes to be "nondynamic" ones.
The default, as in regular python, is that all the wrapped
classes are dynamics. So, careful with your spelling.
09/14/2004: mmatus
- Support the -I- option.

View file

@ -2,7 +2,7 @@
This test case tests that various types of arrays are working.
*/
#pragma SWIG nowarn=451,462
%warnfilter(451,462);
%module arrays_global

View file

@ -3,7 +3,7 @@
#include <istream>
%}
#pragma SWIG nowarn=-503
%warnfilter(503);
%inline

View file

@ -10,7 +10,7 @@
*/
/* activate all the name warnings */
#pragma SWIG nowarn=+315,+321,-403
%warnfilter(+315,+321,-403);
%inline
{

View file

@ -1,5 +1,8 @@
%module namespace_virtual_method
%warnfilter(515);
%inline %{
namespace A {

View file

@ -82,9 +82,9 @@
// Try your language module with and without
// these nowarn flags.
//
#pragma SWIG nowarn=451
//#pragma SWIG nowarn=515
//#pragma SWIG nowarn=509
%warnfilter(451);
//%warnfilter(515);
//%warnfilter(509);
%{
#include <stddef.h>

View file

@ -3,7 +3,7 @@
%warnfilter(801) agua;
/* no redundant warnings */
#pragma SWIG nowarn=-322
%warnfilter(322);
#if 1
//

View file

@ -1,6 +1,7 @@
%module refcount
#pragma SWIG nowarn=362
#warnfilter(362);
%{
#include <iostream>
#include "refcount.h"

View file

@ -2,7 +2,7 @@
%warnfilter(801) traits<double, double>; /* Ruby, wrong class name */
#pragma SWIG nowarn=320
%warnfilter(320);
%inline %{
template <class ArgType, class ResType>

View file

@ -4,7 +4,7 @@
%warnfilter(801) vector<int>; /* Ruby, wrong class name */
%warnfilter(801) vector<double>; /* Ruby, wrong class name */
%warnfilter(801) vector<int (*)[10]>; /* Ruby, wrong class name */
#pragma SWIG nowarn=320
%warnfilter(320);
/* Let's just grab the original header file here */

View file

@ -2,7 +2,7 @@
%warnfilter(801) traits<Double, Double>; /* Ruby, wrong class name */
#pragma SWIG nowarn=320
%warnfilter(320);
%inline %{
typedef double Double;

View file

@ -142,7 +142,9 @@ int
DohHashval(const DOH *obj) {
DohBase *b = (DohBase *) obj;
DohObjInfo *objinfo;
if (DohCheck(b)) {
/* obj is already checked and/or converted into DohBase* */
/* if (DohCheck(b)) */
{
objinfo = b->type;
if (objinfo->doh_hashval) {
return (objinfo->doh_hashval)(b);
@ -173,17 +175,33 @@ DohData(const DOH *obj) {
* DohCmp()
* ----------------------------------------------------------------------------- */
#define RawData(b) ((b->type->doh_data) ? (b->type->doh_data)(b) : 0)
/*
static void *
RawData(DohBase *b) {
DohObjInfo *objinfo = b->type;
return (objinfo->doh_data) ? (objinfo->doh_data)(b) : 0;
}
*/
int
DohCmp(const DOH *obj1, const DOH *obj2) {
DohBase *b1, *b2;
DohObjInfo *b1info, *b2info;
int c1, c2;
b1 = (DohBase *) obj1;
b2 = (DohBase *) obj2;
if ((!DohCheck(b1)) || (!DohCheck(b2))) {
c1 = DohCheck(b1);
c2 = DohCheck(b2);
/* most of the times, obj2 is a plain c string */
if (!c1 || !c2) {
if ((b1 == 0) && (b2 == 0)) return 0;
if (b1 && !b2) return 1;
if (!b1 && b2) return -1;
return strcmp((char *) DohData(b1),(char *) DohData(b2));
return strcmp((char *) (c1 ? RawData(b1) : (void*) obj1),
(char *) (c2 ? RawData(b2) : (void*) obj2));
}
b1info = b1->type;
b2info = b2->type;

View file

@ -249,13 +249,18 @@ static DOH *
Hash_getattr(DOH *ho, DOH *k) {
int hv;
HashNode *n;
DohObjInfo *k_type;
DohBase *nk;
Hash *h = (Hash *) ObjData(ho);
if (!DohCheck(k)) k = find_key(k);
hv = Hashval(k) % h->hashsize;
n = h->hashtable[hv];
k_type = ((DohBase*)k)->type;
while (n) {
if (Cmp(n->key, k) == 0) return n->object;
nk = n->key;
if ((k_type == nk->type) && ((k_type->doh_cmp)(k, nk) == 0)) return n->object;
n = n->next;
}
return 0;

View file

@ -27,6 +27,8 @@ typedef struct pool {
int len; /* Length of pool */
int blen; /* Byte length of pool */
int current; /* Current position for next allocation */
char* pbeg; /* Beg of pool */
char* pend; /* End of pool */
struct pool *next; /* Next pool */
} Pool;
@ -49,6 +51,8 @@ CreatePool() {
p->len = PoolSize;
p->blen = PoolSize*sizeof(DohBase);
p->current = 0;
p->pbeg = ((char *)p->ptr);
p->pend = p->pbeg + p->blen;
p->next = Pools;
Pools = p;
}
@ -74,12 +78,10 @@ InitPools() {
int
DohCheck(const DOH *ptr) {
Pool *p = Pools;
register Pool *p = Pools;
register char *cptr = (char *) ptr;
register char *pptr;
while (p) {
pptr = (char *) p->ptr;
if ((cptr >= pptr) && (cptr < (pptr + p->blen))) return 1;
if ((cptr >= p->pbeg) && (cptr < p->pend)) return 1;
/*
pptr = (char *) p->ptr;
if ((cptr >= pptr) && (cptr < (pptr+(p->current*sizeof(DohBase))))) return 1; */

View file

@ -111,25 +111,25 @@ String_len(DOH *so) {
static int
String_cmp(DOH *so1, DOH *so2)
{
String *s1, *s2;
char *c1, *c2;
int maxlen,i;
s1 = (String *) ObjData(so1);
s2 = (String *) ObjData(so2);
maxlen = s1->len;
if (s2->len < maxlen) maxlen = s2->len;
String * s1 = (String *) ObjData(so1);
String * s2 = (String *) ObjData(so2);
register char *c1;
register char *c2;
register int len = s1->len;
if (len != s2->len) return (len < s2->len ) ? -1 : 1;
c1 = s1->str;
c2 = s2->str;
for (i = 0; i < maxlen; i++,c1++,c2++) {
if (*c1 != *c2) break;
#if 1
/* this is better, but it could be not present in all the
systems ? */
return memcmp(c1, c2, len);
#else
/* faster loop with nonzero predicates */
for (; len ; --len,++c1,++c2) {
if (*c1 != *c2) return ((*c1 < *c2) ? -1 : 1);
}
if (i < maxlen) {
if (*c1 < *c2) return -1;
else return 1;
}
if (s1->len == s2->len) return 0;
if (s1->len > s2->len) return 1;
return -1;
return 0;
#endif
}
/* -----------------------------------------------------------------------------