*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@26 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a12b8f43ac
commit
b7b413d207
3 changed files with 13 additions and 2 deletions
|
|
@ -613,19 +613,25 @@ void DohDelitem(DOH *obj, int index) {
|
||||||
/* Set an item in an object */
|
/* Set an item in an object */
|
||||||
void DohInsertitem(DOH *obj, int index, DOH *value) {
|
void DohInsertitem(DOH *obj, int index, DOH *value) {
|
||||||
DOH *value_obj;
|
DOH *value_obj;
|
||||||
|
int no = 0;
|
||||||
DohBase *b = (DohBase *) obj;
|
DohBase *b = (DohBase *) obj;
|
||||||
DohError(DOH_CALLS,"DohInsertitem %x, %d, %x\n",obj,index, value);
|
DohError(DOH_CALLS,"DohInsertitem %x, %d, %x\n",obj,index, value);
|
||||||
if (DohIsSequence(obj)) {
|
if (DohIsSequence(obj)) {
|
||||||
if (!DohCheck(value)) {
|
if (!DohCheck(value)) {
|
||||||
DohError(DOH_CONVERSION,"Unknown object %x being converted to a string in Insertitem.\n", value);
|
DohError(DOH_CONVERSION,"Unknown object %x being converted to a string in Insertitem.\n", value);
|
||||||
value_obj = NewString(value);
|
value_obj = NewString(value);
|
||||||
|
no = 1;
|
||||||
|
Incref(value_obj);
|
||||||
} else {
|
} else {
|
||||||
value_obj = value;
|
value_obj = value;
|
||||||
}
|
}
|
||||||
if (b->objinfo->doh_sequence->doh_insitem) {
|
if (b->objinfo->doh_sequence->doh_insitem) {
|
||||||
(b->objinfo->doh_sequence->doh_insitem)(obj,index,value_obj);
|
(b->objinfo->doh_sequence->doh_insitem)(obj,index,value_obj);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
if (no) {
|
||||||
|
Delete(value_obj);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (DohCheck(obj)) {
|
if (DohCheck(obj)) {
|
||||||
DohError(DOH_UNSUPPORTED,"No insitem method defined for type '%s'\n", b->objinfo->objname);
|
DohError(DOH_UNSUPPORTED,"No insitem method defined for type '%s'\n", b->objinfo->objname);
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,7 @@ void DohObjFree(DOH *ptr) {
|
||||||
Fragment *f;
|
Fragment *f;
|
||||||
extern int doh_debug_level;
|
extern int doh_debug_level;
|
||||||
|
|
||||||
|
|
||||||
if (!DohCheck(ptr)) {
|
if (!DohCheck(ptr)) {
|
||||||
DohError(DOH_MEMORY,"DohObjFree. %x not a DOH object!\n", ptr);
|
DohError(DOH_MEMORY,"DohObjFree. %x not a DOH object!\n", ptr);
|
||||||
return; /* Oh well. Guess we're leaky */
|
return; /* Oh well. Guess we're leaky */
|
||||||
|
|
@ -246,7 +247,8 @@ void DohFree(void *ptr) {
|
||||||
int size;
|
int size;
|
||||||
size = *((int *) (cptr - 8));
|
size = *((int *) (cptr - 8));
|
||||||
free(cptr-8);
|
free(cptr-8);
|
||||||
_DohMemoryCurrent -= (size+8);
|
_DohMemoryCurrent = _DohMemoryCurrent - (size+8);
|
||||||
|
/* printf("Free %x %d\n", ptr, size);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@
|
||||||
#ifndef _DOH_H
|
#ifndef _DOH_H
|
||||||
#define _DOH_H
|
#define _DOH_H
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue