summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-15 10:44:10 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-15 10:44:10 +0100
commit2e244d781b1b1096cddfd0df558ec7cee19b33a1 (patch)
tree577cbb7f02eebf2a6ebc5e21a051df55068547d9
parent63af3522ffbd5c3e1003a908d804c4e079d8f5e8 (diff)
System refactoring.
darcs-hash:961c2ecf3be60a2a4abcfd15f3e51b5ccfb163c0
-rw-r--r--Lisp/internal-utilities.lisp16
-rw-r--r--Lisp/libobjcl.lisp16
-rw-r--r--Objective-C/libobjcl.h4
-rw-r--r--objective-cl.asd3
4 files changed, 21 insertions, 18 deletions
diff --git a/Lisp/internal-utilities.lisp b/Lisp/internal-utilities.lisp
index 9be74a9..1c54068 100644
--- a/Lisp/internal-utilities.lisp
+++ b/Lisp/internal-utilities.lisp
@@ -27,22 +27,6 @@
(member symbol *features*))
-(defun objc-null (value)
- (or (null value)
- (and (typep value 'c-pointer-wrapper)
- (objc-pointer-null (pointer-to value)))))
-
-
-(defmacro objc-or (&rest forms)
- (let ((sym (gensym)))
- `(let ((,sym ,(first forms)))
- (if (objc-null ,sym)
- ,(if (rest forms)
- `(objc-or ,@(rest forms))
- 'nil)
- ,sym))))
-
-
(defmacro with-foreign-string-pool ((register-fn-name) &body body)
(let ((pool-var (gensym)))
`(let ((,pool-var (list)))
diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp
index 0858cb9..89930b8 100644
--- a/Lisp/libobjcl.lisp
+++ b/Lisp/libobjcl.lisp
@@ -375,6 +375,22 @@ conventional case for namespace identifiers in Objective-C."
(cffi:pointer-eq pointer (objcl-get-nil))))
+(defun objc-null (value)
+ (or (null value)
+ (and (typep value 'c-pointer-wrapper)
+ (objc-pointer-null (pointer-to value)))))
+
+
+(defmacro objc-or (&rest forms)
+ (let ((sym (gensym)))
+ `(let ((,sym ,(first forms)))
+ (if (objc-null ,sym)
+ ,(if (rest forms)
+ `(objc-or ,@(rest forms))
+ 'nil)
+ ,sym))))
+
+
(declaim (ftype (function (string) (or null selector))
find-selector-by-name))
(defun find-selector-by-name (selector-name)
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index cca5d12..35d6150 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -156,7 +156,9 @@ objcl_slot_value (id obj, const char *ivar_name);
/* The following function returns a freshly consed array that the caller
must deallocate. */
IVAR_T *
-objcl_class_direct_slots (Class class, unsigned int *count, unsigned int *element_size);
+objcl_class_direct_slots (Class class,
+ unsigned int *count,
+ unsigned int *element_size);
const char *
objcl_slot_name (IVAR_T ivar);
diff --git a/objective-cl.asd b/objective-cl.asd
index bf0fecb..9420f95 100644
--- a/objective-cl.asd
+++ b/objective-cl.asd
@@ -30,11 +30,12 @@
(:file "constant-data" :depends-on ("defpackage"))
(:file "conditions" :depends-on ("defpackage"))
(:file "parameters" :depends-on ("defpackage"))
- (:file "name-conversion" :depends-on ("defpackage"))
(:file "data-types" :depends-on ("defpackage"
"conditions"))
(:file "internal-utilities" :depends-on ("defpackage"
"data-types"))
+ (:file "name-conversion" :depends-on ("defpackage"
+ "internal-utilities"))
(:file "weak-hash-tables" :depends-on ("defpackage"))
(:file "performance-hacks" :depends-on ("defpackage"))
(:file "policy" :depends-on ("defpackage"