From daeb7545ae89acc8af2c8d13315fa4cdc1c1de41 Mon Sep 17 00:00:00 2001 From: polos Date: Fri, 21 Apr 2017 11:13:49 +0200 Subject: [PATCH] replace "concatenate 'string" with "x:cc" --- helper/generate.lisp | 42 ++++++++++++++++++++---------------------- helper/html2text.lisp | 2 +- helper/parse.lisp | 6 +++--- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/helper/generate.lisp b/helper/generate.lisp index da1bc70..bc4afac 100644 --- a/helper/generate.lisp +++ b/helper/generate.lisp @@ -222,7 +222,7 @@ (caaar x)) (defun l2q-name (name) - (concatenate 'string "Q" (subseq name 1))) + (x:cc "Q" (subseq name 1))) (defun sub-class-name (x) (let ((sub (copy-seq (class-name* x)))) @@ -268,19 +268,18 @@ (not (find #\< type))))) (unless (and enum-as-int (find* type +special-typedefs-and-classes+)) - (concatenate 'string - (if (and (const-p arg) - (or (not return) - (not (string= "int" (first arg))))) - "const " - "") - (if enum-as-int "int" type) - (cond ((and (not return) - (reference-p arg)) - "&") - ((pointer-p arg) - "*") - (t "")))))))) + (x:cc (if (and (const-p arg) + (or (not return) + (not (string= "int" (first arg))))) + "const " + "") + (if enum-as-int "int" type) + (cond ((and (not return) + (reference-p arg)) + "&") + ((pointer-p arg) + "*") + (t "")))))))) (when (and return (search "QList" argc) (search "::" argc)) @@ -304,14 +303,13 @@ (error (format nil "No C null value defined for ~S" arg)))))) (defun arg-to-simple-c (arg) - (concatenate 'string - (if (and (const-p arg) - (pointer-p arg) - (string= "char" (first arg))) - "const " - "") - (first arg) - (if (pointer-p arg) "*" ""))) + (x:cc (if (and (const-p arg) + (pointer-p arg) + (string= "char" (first arg))) + "const " + "") + (first arg) + (if (pointer-p arg) "*" ""))) (defun default-to-c (arg &optional enum-class) (if-it (default-value arg) diff --git a/helper/html2text.lisp b/helper/html2text.lisp index 9b4c5ab..8df2a85 100644 --- a/helper/html2text.lisp +++ b/helper/html2text.lisp @@ -22,7 +22,7 @@ (write-sequence (x:string-to-bytes (qlocal8bit (|toPlainText| *web-frame*))) s)) (let ((file-name (file-namestring (probe-file *file*)))) - (rename-file file-name (concatenate 'string "html/" file-name))))) + (rename-file file-name (x:cc "html/" file-name))))) (defun html-loaded (ok) (if ok diff --git a/helper/parse.lisp b/helper/parse.lisp index 242b75a..2c5c866 100644 --- a/helper/parse.lisp +++ b/helper/parse.lisp @@ -274,11 +274,11 @@ (when (find #\( x:it) ;; special default values (x:when-it* (search " = QRect( QPoint( 0, 0 ), QSize( -1, -1 ) )" x:it) - (setf x:it (concatenate 'string (subseq x:it 0 x:it*) " = QRect_DEFAULT)"))) + (setf x:it (x:cc (subseq x:it 0 x:it*) " = QRect_DEFAULT)"))) (x:when-it* (search " = QMarginsF( 0, 0, 0, 0 )" x:it) - (setf x:it (concatenate 'string (subseq x:it 0 x:it*) " = QMarginsF_DEFAULT)"))) + (setf x:it (x:cc (subseq x:it 0 x:it*) " = QMarginsF_DEFAULT)"))) (x:when-it* (search " = QPageLayout( QPageSize( QPageSize::A4 ), QPageLayout::Portrait, QMarginsF() )" x:it) - (setf x:it (concatenate 'string (subseq x:it 0 x:it*) " = QPageLayout_DEFAULT)"))) + (setf x:it (x:cc (subseq x:it 0 x:it*) " = QPageLayout_DEFAULT)"))) (let* ((fun (tokenize x:it)) (new (and (not static) (x:starts-with (format nil "~A (" class) fun)))