diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-10-12 00:27:02 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-10-12 00:27:02 +0000 |
commit | 524660d2e3e96ac715623c052338c25a14938dfa (patch) | |
tree | 8c826840b836b21623b2673ebb37f3ee7aff55ab /libobjc | |
parent | 4d218f5c7208f133fd302e0e0628d5d03401c4d1 (diff) | |
download | gcc-524660d2e3e96ac715623c052338c25a14938dfa.zip gcc-524660d2e3e96ac715623c052338c25a14938dfa.tar.gz gcc-524660d2e3e96ac715623c052338c25a14938dfa.tar.bz2 |
In libobjc/: 2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
* selector.c (sel_getName): Return "<null selector>" for a NULL
argument.
(sel_get_name): Return 0 for a NULL argument.
* objc/runtime.h (sel_getName): Updated documentation.
* objc-private/hash.h (class_hash_table): Unused declaration
removed.
(module_hash_table): Same.
* objc/deprecated/hash.h: Same changes.
From-SVN: r165348
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/ChangeLog | 12 | ||||
-rw-r--r-- | libobjc/objc-private/hash.h | 3 | ||||
-rw-r--r-- | libobjc/objc/deprecated/hash.h | 3 | ||||
-rw-r--r-- | libobjc/objc/runtime.h | 3 | ||||
-rw-r--r-- | libobjc/selector.c | 6 |
5 files changed, 20 insertions, 7 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index e2d9310..e66df6a 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,15 @@ +2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com> + + * selector.c (sel_getName): Return "<null selector>" for a NULL + argument. + (sel_get_name): Return 0 for a NULL argument. + * objc/runtime.h (sel_getName): Updated documentation. + + * objc-private/hash.h (class_hash_table): Unused declaration + removed. + (module_hash_table): Same. + * objc/deprecated/hash.h: Same changes. + 2010-10-11 Nicola Pero <nicola.pero@meta-innovation.com> * class.c (objc_getClassList): New. diff --git a/libobjc/objc-private/hash.h b/libobjc/objc-private/hash.h index 7c57a4d..ba4c494 100644 --- a/libobjc/objc-private/hash.h +++ b/libobjc/objc-private/hash.h @@ -104,9 +104,6 @@ typedef struct cache } *cache_ptr; -/* Two important hash tables. */ -extern cache_ptr module_hash_table, class_hash_table; - /* Allocate and initialize a hash table. */ cache_ptr objc_hash_new (unsigned int size, diff --git a/libobjc/objc/deprecated/hash.h b/libobjc/objc/deprecated/hash.h index 52ee8c3..8b718a4 100644 --- a/libobjc/objc/deprecated/hash.h +++ b/libobjc/objc/deprecated/hash.h @@ -104,9 +104,6 @@ typedef struct cache } *cache_ptr; -/* Two important hash tables. */ -extern cache_ptr module_hash_table, class_hash_table; - /* Allocate and initialize a hash table. */ cache_ptr objc_hash_new (unsigned int size, diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h index b15c522..f3a19ec 100644 --- a/libobjc/objc/runtime.h +++ b/libobjc/objc/runtime.h @@ -168,7 +168,8 @@ object_getClass (id object) /** Implementation: the following functions are in selector.c. */ -/* Return the name of a given selector. */ +/* Return the name of a given selector. If 'selector' is NULL, return + "<null selector>". */ objc_EXPORT const char *sel_getName (SEL selector); /* Return the type of a given selector. diff --git a/libobjc/selector.c b/libobjc/selector.c index 93952fd..e51dd20 100644 --- a/libobjc/selector.c +++ b/libobjc/selector.c @@ -293,6 +293,9 @@ const char *sel_getName (SEL selector) { const char *ret; + if (selector == NULL) + return "<null selector>"; + objc_mutex_lock (__objc_runtime_mutex); if ((soffset_decode ((sidx)selector->sel_id) > 0) && (soffset_decode ((sidx)selector->sel_id) <= __objc_selector_max_index)) @@ -306,6 +309,9 @@ const char *sel_getName (SEL selector) /* Traditional GNU Objective-C Runtime API. */ const char *sel_get_name (SEL selector) { + if (selector == NULL) + return 0; + return sel_getName (selector); } |