[svn:ponie] r372 - trunk/perl
[email protected] 8 Dec 2005 16:52:50 -0000
| Newsgroups | perl.ponie.changes |
|---|---|
| Message-ID | <[email protected]> |
Author: nicholas
Date: Thu Dec 8 08:52:49 2005
New Revision: 372
Modified:
trunk/perl/embed.fnc
trunk/perl/proto.h
trunk/perl/sv.c
Log:
ptr_table_delete should return bool rather than void *
Modified: trunk/perl/embed.fnc
==============================================================================
--- trunk/perl/embed.fnc (original)
+++ trunk/perl/embed.fnc Thu Dec 8 08:52:49 2005
@@ -954,7 +954,7 @@ Ap |void |sys_intern_dup |struct interp_
#endif
#endif
Ap |PTR_TBL_t*|ptr_table_new
-Ap |void* |ptr_table_delete|PTR_TBL_t *tbl|void *sv
+Ap |bool |ptr_table_delete|PTR_TBL_t *tbl|void *sv
Ap |void* |ptr_table_fetch|PTR_TBL_t *tbl|void *sv
Ap |void |ptr_table_store|PTR_TBL_t *tbl|void *oldsv|void *newsv
Ap |void |ptr_table_inc|PTR_TBL_t *tbl|void *oldv
Modified: trunk/perl/proto.h
==============================================================================
--- trunk/perl/proto.h (original)
+++ trunk/perl/proto.h Thu Dec 8 08:52:49 2005
@@ -914,7 +914,7 @@ PERL_CALLCONV void Perl_sys_intern_dup(p
#endif
#endif
PERL_CALLCONV PTR_TBL_t* Perl_ptr_table_new(pTHX);
-PERL_CALLCONV void* Perl_ptr_table_delete(pTHX_ PTR_TBL_t *tbl, void *sv);
+PERL_CALLCONV bool Perl_ptr_table_delete(pTHX_ PTR_TBL_t *tbl, void *sv);
PERL_CALLCONV void* Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv);
PERL_CALLCONV void Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldsv, void *newsv);
PERL_CALLCONV void Perl_ptr_table_inc(pTHX_ PTR_TBL_t *tbl, void *oldv);
Modified: trunk/perl/sv.c
==============================================================================
--- trunk/perl/sv.c (original)
+++ trunk/perl/sv.c Thu Dec 8 08:52:49 2005
@@ -9335,7 +9335,7 @@ S_del_pte(pTHX_ struct ptr_tbl_ent*p)
/* Return the pointer "newval" for this entry. Or NULL for not found.
Given that it's a pointer table map, we assume that no-one ever puts
NULL in as their newval */
-void *
+bool
Perl_ptr_table_delete(pTHX_ PTR_TBL_t *tbl, void *sv)
{
PTR_TBL_ENT_t **tblent;
@@ -9346,7 +9346,6 @@ Perl_ptr_table_delete(pTHX_ PTR_TBL_t *t
PTR_TBL_ENT_t *current = *tblent;
if (current->oldval == sv) {
/* Found it. */
- void *result = current->val_u.newval;
if (tbl->iteration_nesting == 0) {
*tblent = current->next;
S_del_pte(aTHX_ current);
@@ -9358,12 +9357,12 @@ Perl_ptr_table_delete(pTHX_ PTR_TBL_t *t
current->oldval = 0;
current->val_u.newval = 0;
}
- return result;
+ return TRUE;
}
tblent = &(current->next);
}
/* Failed to find it. */
- return NULL;
+ return FALSE;
}
/* map an existing pointer using a table */