projects
/
rrq
/
rrqmisc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added compilation variant
[rrq/rrqmisc.git]
/
typing
/
ItemKeyFun.c
diff --git
a/typing/ItemKeyFun.c
b/typing/ItemKeyFun.c
index 81e4b9ab2c74dc436f326cd522084caac1ab5ef0..2b1d3725c43248ca5d3d9302ee82f5c9eff79280 100644
(file)
--- a/
typing/ItemKeyFun.c
+++ b/
typing/ItemKeyFun.c
@@
-21,8
+21,7
@@
unsigned long ItemKeyFun_hashcode(void *this,void *key) {
*/
void *ItemKeyFun_itemkey(void *this,void *item) {
ItemKeyFun *type = (ItemKeyFun*) this;
*/
void *ItemKeyFun_itemkey(void *this,void *item) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- return type->itemkey? type->itemkey( type, item ) : item;
+ return ( type && type->itemkey )? type->itemkey( type, item ) : item;
}
/**
}
/**
@@
-30,8
+29,7
@@
void *ItemKeyFun_itemkey(void *this,void *item) {
*/
int ItemKeyFun_haskey(void *this,void *item,void *key) {
ItemKeyFun *type = (ItemKeyFun*) this;
*/
int ItemKeyFun_haskey(void *this,void *item,void *key) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- if ( type->haskey ) {
+ if ( type && type->haskey ) {
return type->haskey( this, item, key );
}
void *ikey = ItemKeyFun_itemkey( this, item );
return type->haskey( this, item, key );
}
void *ikey = ItemKeyFun_itemkey( this, item );
@@
-45,8
+43,7
@@
int ItemKeyFun_haskey(void *this,void *item,void *key) {
*/
void ItemKeyFun_releasekey(void *this,void *key) {
ItemKeyFun *type = (ItemKeyFun*) this;
*/
void ItemKeyFun_releasekey(void *this,void *key) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- if ( type->releasekey ) {
+ if( type && type->releasekey ) {
type->releasekey( type, key );
}
}
type->releasekey( type, key );
}
}
@@
-56,8
+53,7
@@
void ItemKeyFun_releasekey(void *this,void *key) {
*/
int ItemKeyFun_tostring(void *this,void *item,char *buffer,int limit) {
ItemKeyFun *type = (ItemKeyFun*) this;
*/
int ItemKeyFun_tostring(void *this,void *item,char *buffer,int limit) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- if ( type->tostring ) {
+ if( type && type->tostring ) {
return type->tostring( type, item, buffer, limit );
}
void *key = ItemKeyFun_itemkey( this, item );
return type->tostring( type, item, buffer, limit );
}
void *key = ItemKeyFun_itemkey( this, item );